2FA and passkeys: how they work
How one-time codes, notifications, security keys and passkeys work, and why only some methods resist phishing.
One-time codes
Authenticator apps use a secret shared with the site at setup, usually through a QR code. From that secret and the current time, the app calculates a six-digit code every 30 seconds; the site does the same calculation and compares the results. No connection is needed: the code is generated on the phone.
Cryptographic keys
Security keys and passkeys work differently, based on public-key cryptography.
- 01
Registration
The device creates a key pair dedicated to that site. The site stores only the public key.
- 02
Login
The site sends a random challenge. The device signs it with the private key, after you confirm with fingerprint, face, PIN or a touch.
- 03
Verification
The site checks the signature with the public key. No secret travels over the network.
- 04
Binding to the domain
The key responds only to the domain it was created for: a fake page with a different address receives nothing.
2FA and passkeys: configuration
How to turn on two-factor authentication and passkeys on your accounts, with backup methods so you are never locked out.
The pages of this topic
Back to the overview2FA and passkeys: pitfalls to avoid
The most common mistakes with two-factor authentication, from reading codes out over the phone to approving notifications you did not request.
2FA and passkeys: the risks
SIM swap, real-time phishing, notification bombing and losing your device: the remaining risks and how to reduce them.
2FA and passkeys: the procedure to protect your accounts
A six-step plan to turn on second factors and passkeys on all important accounts without risking losing access.
2FA and passkeys: the tools
Authenticator apps, physical security keys and password managers supporting passkeys: what to use and how to choose.
2FA and passkeys: the checklist
The checks to make sure your accounts are protected by a second factor and that you can always get back in.
2FA and passkeys: frequently asked questions
Short answers to the most common doubts about two-step verification, codes, security keys and passkeys.