Grab your favourite brew and let's explore how passkeys work — from the cryptography behind them to a hands-on demo you can try right here.
Passkeys are a modern replacement for passwords based on the WebAuthn (Web Authentication) standard. Instead of memorising a secret string, your device creates a public/private key pair that is unique to you and the website. The private key never leaves your device — only a cryptographic proof is sent to the server.
Think of it like a coffee shop loyalty card that only your fingerprint can stamp — even if someone photocopies the card, they can't forge your stamp.
| Passwords | Passkeys | |
|---|---|---|
| Storage | Server stores a hash of your secret | Server stores only your public key |
| Phishing | Can be typed into fake sites | Cryptographically bound to the real domain |
| Reuse | Users often reuse across sites | Unique key pair per site, automatically |
| Breach impact | Hashed passwords can be cracked | Public keys are useless to attackers |
| User effort | Must remember or use a manager | Biometric/PIN unlock — nothing to remember |
Passkeys use asymmetric (public-key) cryptography. During registration your authenticator (the device's secure enclave, a hardware key like YubiKey, or the OS credential manager) generates a key pair:
During login, the server sends a random challenge. Your authenticator signs the challenge with your
private key. The server verifies the signature using the stored public key. If it matches — you're in.
Like ordering your first cup — the barista (server) needs to get to know you:
Coming back for another cup — the barista recognises your order:
The website/server you are authenticating to. Identified by its domain (rpId). The authenticator binds the key pair to this domain, which prevents phishing — like how your loyalty card only works at one coffee chain.
A random value generated by the server for each ceremony. Prevents replay attacks — a captured response cannot be reused because the challenge changes every time. Think of it as the daily special that changes each morning.
A unique identifier for each passkey. The server stores this so it can tell the authenticator which key to use during login — like the order number on your receipt.
The authenticator's response during registration. Contains the new public key, credential ID, and optionally proof of the authenticator model.
The authenticator's response during login. Contains a signature over the challenge and some metadata, proving possession of the private key.
The authenticator can require biometrics, PIN, or device unlock before using the key. This provides "something you are" or "something you know" on top of "something you have" (the device) — two factors in one sip.
Time to taste-test! Enter your surname below and register a passkey, then log in with it. All data is stored in server memory only — it resets when the server restarts, like a fresh pot of coffee each morning.
When you clicked Register:
challenge and options (steps 1-2 in the diagram above).When you clicked Login: