DEV Community

Spicy
Spicy

Posted on

Passkeys Under the Hood: What's Actually Happening When You Use Face ID to Log In

Every developer I know understands that passwords are broken. What fewer people have actually dug into is why passkeys fix this at the protocol level — and how surprisingly simple the WebAuthn API is to implement.

Here's the full picture: what's happening cryptographically, how the browser API works, and a quick comparison of the libraries worth using in production.


The Core Problem With Passwords (The Actual Technical One)

Passwords fail not because users pick weak ones. They fail because of how the authentication model works:

  1. User creates a password
  2. Server stores a hash of it
  3. User sends the password on every login
  4. Server hashes it and compares

Step 3 is the problem. The credential gets transmitted. That transmission can be intercepted (phishing), the hash can be cracked (breach), or the same credential works on other sites (credential stuffing). Every "password best practice" is mitigation, not a fix.

Passkeys change the model entirely.


How Passkeys Actually Work

Passkeys use asymmetric cryptography (FIDO2/WebAuthn). Here's the flow:

Registration:

Top comments (0)