Lion Cipher Lab

Verify WebAuthn/FIDO2 registrations and assertions from scratch (no library)

Why it matters

WebAuthn/FIDO2 (the technology behind passkeys) is the strongest widely-deployed answer to phishing, because the secret that proves who you are -- a private key -- never leaves your device and never travels to a server that could leak or be tricked into revealing it. Instead, your server (the RELYING PARTY) sends a random CHALLENGE, the authenticator signs it, and the server VERIFIES the signature. But that verification is the whole ballgame: a relying party that checks the signature but forgets to check the ORIGIN throws away the phishing resistance entirely, because an attacker's site could…

What you'll learn

Steps in this lab

  1. The model: two ceremonies, one relying party, and origin binding
  2. Build a software authenticator to make real test vectors (with a tiny CBOR codec)
  3. Registration verification from scratch: parse the attestationObject byte by byte
  4. Authentication verification from scratch: recompute the signed bytes, verify ES256, check the counter
  5. Prove the rejections: replay, wrong origin, wrong rpId, cloned authenticator
  6. The judgment: attestation, UP vs UV, the challenge rules, the counter caveat, and the library

Open the full interactive lab →