Overview
Unlike traditional authentication systems where biometrics unlock a stored key, BioKey derives the cryptographic identity from the biometric authentication event itself. This means:- No biometric data ever leaves your device
- No keys stored in vendor clouds (iCloud, Google Password Manager)
- Your identity travels with your biometric, not your device
- The server only stores public keys, never secrets
The Flow
Here’s how BioKey works from enrollment to authentication:1. Enrollment
What happens during enrollment:- Browser generates a random 32-byte challenge and 16-byte user ID
- WebAuthn API triggers the platform authenticator (fingerprint sensor, Face ID)
- User provides biometric authentication
- Authenticator returns either:
- V2 (PRF): A hardware-backed 32-byte secret (preferred)
- V1 (rawId): A credential identifier to derive with HKDF (fallback)
- Browser derives a 256-bit Identity Key from the authenticator response
- Identity stored locally:
{credentialId, publicKey, deviceId, enrolledAt, method} - Public key sent to server for future verification
2. Authentication
What happens during authentication:- Browser fetches a fresh challenge from server (32 bytes, single-use, 5-minute TTL)
- WebAuthn API triggers platform authenticator with stored credential ID
- User provides biometric authentication (same finger/face as enrollment)
- Authenticator re-derives the same secret using PRF or rawId
- Browser compares re-derived key against stored
publicKey - If match: send challenge to server for verification
- Server validates challenge and confirms identity
Key Derivation Paths
BioKey supports two derivation methods, automatically selecting the best available:V2: WebAuthn PRF Extension (Preferred)
- Hardware-backed cryptographic operation
- Secret never exposed outside the authenticator
- No reliance on credential identifier as keying material
- Deterministic: same biometric always produces same output
- ✅ Android Chrome (excellent support)
- ✅ Safari 18+ on macOS/iOS (improving)
- ⚠️ Other browsers (varies)
V1: rawId + HKDF (Fallback)
Security note:
rawId is a credential identifier, not a secret value. It may be observed during WebAuthn operations. V1 provides a stable identity seed for platforms without PRF support but doesn’t carry the same security guarantees as V2.Automatic Method Selection
The BioKey library automatically attempts V2 first and falls back to V1:method field is stored with the identity so authentication can use the same derivation path.
Identity Storage
After enrollment, the client stores this identity object locally (typically inlocalStorage):
Why store locally? The identity is re-derivable from the biometric, but storing it locally allows faster verification and offline authentication scenarios.
Challenge-Response Protocol
To prevent replay attacks, BioKey uses a challenge-response protocol:- Server issues challenge: 32 random bytes, hex-encoded
- Challenge properties:
- Single-use (deleted after first verification attempt)
- Time-limited (5-minute expiration)
- Cryptographically random
- Client authenticates: Proves biometric ownership by including challenge
- Server verifies: Checks challenge validity and looks up public key
Offline Authentication
For local device unlock or offline scenarios, BioKey can authenticate without a server:Next Steps
Key Derivation
Deep dive into PRF and HKDF cryptographic operations
Security Model
Understand threat models and trust boundaries