Passkeys Can Do More Than Sign You In: What I Learned Using Them for End-to-End Encryption
ยท 17 min read
Most of us think of passkeys as a login feature. You add one to your account, you stop typing passwords, and that's the end of it. But under the hood, a passkey is a cryptographic key that's protected by hardware, synced across your devices, and unlocked with your fingerprint or face. Signing in is just the first thing we've used it for.
I recently shipped end-to-end encrypted messaging in a production web app, and passkeys are how users unlock their encryption keys on every device. When I started, I saw passkeys the way most engineers do, as a nicer replacement for the password field. By the time we shipped, I'd come to see them as one of the most underrated tools on the web platform, and I think most product teams are only using a small part of what they offer.
This article is the mental model I wish I had at the start. We'll look at what a passkey actually is, why synced passkeys matter more than any single feature, the capability most teams overlook, and the lessons that only showed up once real users got involved. I've written a separate hands-on guide for the implementation, so this piece focuses on why it matters and what to watch out for.
The real problem with passwords is that they're a shared secret. Every fix from the last fifteen years has tried to make that secret stronger, but none of them changed the fact that it's shared.
A shared secret has to live in at least two places: the user's head and the server's database. Each copy can be attacked. Someone can trick the user into typing it on the wrong site, the server can leak it, and because people reuse passwords, one leak often opens accounts on other sites too.
The numbers haven't moved much. Verizon's 2025 Data Breach Investigations Report found that compromised credentials were the initial access vector in 22% of the breaches it reviewed. In separate research using single sign-on provider logs, Verizon found that on a median day, 19% of all authentication attempts were credential stuffing, and on the worst day that figure reached 44%. In other words, a large share of login traffic is bots replaying leaked passwords.
If you look at the layers we've added on top of passwords, you'll notice they share the same weakness:
- Complexity rules made passwords harder to remember, which pushed people to reuse them even more.
- SMS codes added a second shared secret, and it travels over a channel attackers can hijack with a SIM swap.
- Authenticator apps made the second secret harder to steal from storage, but a convincing fake page can still collect the code and replay it within its 30-second window.
Each of these asks a person to read something and type it somewhere, and anything a person can read and type, a phishing page can collect. The only real fix is to stop making people carry secrets and to make sure no secret needs to sit on the server at all. That's the problem passkeys were designed to solve.
If you strip away the branding, a passkey comes down to four properties. Once you understand them, most passkey design decisions start to make sense.
A passkey is a public and private key pair. The private key stays with the user, and the website stores only the public key. When the user signs in, the site sends a random challenge, the user's device signs it with the private key, and the site checks the signature with the public key.
This means the server no longer holds anything worth stealing. If an attacker breaches a database of public keys, they can't use them to sign in anywhere, and credential stuffing has nothing to work with.
Every passkey belongs to a single domain, called its relying party ID. The browser decides which passkeys a page is allowed to use, not the user. So a passkey created for bank.com simply isn't available on bank-secure-login.com.
This is what makes passkeys phishing-resistant. Every earlier defence depended on the user noticing they were on the wrong URL. Passkeys move that check into the browser, which doesn't get tired, distracted or rushed.
Using a passkey requires user verification, which means a fingerprint, a face scan or the device PIN. The biometric never leaves the device, and the website never sees it. It only unlocks the private key on the user's own hardware.
That's a bigger change than it looks. Proving "this is really the user" now comes from a local hardware check instead of knowing a string.
A passkey can be device-bound, meaning it lives on one piece of hardware like a security key. It can also be synced, meaning it lives in a password manager such as Apple Passwords, Google Password Manager or 1Password, which copies it end-to-end encrypted to all of the user's devices.
This fourth property is what took passkeys from a niche security tool to something billions of people use, so we'll look at it more closely in a moment.
You'll come across three names:
As an application developer, WebAuthn is the only one you'll call directly.
You register a passkey once, and then you use it to sign in as many times as you need. Both steps follow the same pattern: the website sends a challenge, and the device answers it without ever revealing the private key.
Two details make this hard to attack. First, the challenge is new every time, so an attacker who captures a response can't replay it later. Second, the browser includes the website's domain in every response it signs, so a response produced on a look-alike domain won't work on the real one. Neither protection depends on the user noticing anything.
The cryptography behind passkeys has been around for decades. What changed was sync.
For years, strong authentication meant buying a hardware security key. The security was excellent, but the experience wasn't: you had to buy one, carry it around and register a backup in case you lost it. If you lost both, you were locked out. Outside of security teams and journalists, very few people bothered.
That changed on 5 May 2022, when Apple, Google and Microsoft jointly committed to two capabilities. The first let users access their FIDO credentials on all their devices, including new ones, without re-enrolling every account. The second let a phone sign the user in on a nearby computer, whatever operating system or browser that computer was running. Together, those two commitments are what we now call passkeys.
Sync solved the problem that had held strong authentication back for years, which was losing the device. When you get a new phone now, your passkeys are already on it. The security model moved from "protect this one object" to "protect this account with the platform", and that's a trade most people should be happy to make.
|
Synced passkey |
Device-bound passkey |
| Where it lives |
A password manager that syncs across the user's devices |
One piece of hardware |
| Survives a lost device |
Yes |
No |
| Typical examples |
Apple Passwords, Google Password Manager, 1Password |
Hardware security keys |
| Best for |
Almost everyone |
High-assurance and regulated settings |
You can see the effect in the adoption numbers. In May 2026, the FIDO Alliance surveyed 11,000 adults across 10 countries and found that 90% of consumers were familiar with passkeys and 75% had enabled them on at least some accounts. At the time, it estimated 5 billion passkeys were in active use. By October 2026, that estimate had grown to 7 billion, and more than a third of successful sign-ins at the services it tracks used a passkey.
That installed base is what makes the rest of this article possible. Billions of hardware-protected, user-verified key pairs that already work across devices are sitting in people's pockets, so it's worth asking what else they can do.
A passkey can do more than sign challenges. Through a WebAuthn extension called PRF, it can also produce a stable secret that only the user can unlock, which turns it from an authentication tool into a key-management tool.
PRF stands for pseudo-random function. You give the passkey a fixed input, and it gives you back 32 bytes. 1Password's engineers summed up the two properties that make those bytes useful: the output is deterministic, and it's unpredictable.
- Deterministic means the same passkey and the same input produce the same bytes on every device the passkey has synced to.
- Unpredictable means nobody can compute those bytes without the passkey and the user's biometric or PIN. That includes attackers, the website and you as the developer.
Put those together and you get something cryptographers have wanted in consumer software for a long time: a strong secret that follows the user across devices, doesn't need to be memorised, unlocks with a touch and never reaches the server.
The hard part of end-to-end encryption has never been the maths. It's key management. Where does the user's key live? How does it get to their new phone? What happens when they forget the passphrase? Historically, products answered these questions by asking users to write down a 64-digit recovery code or remember yet another strong password. Most users opted out, and most products ended up keeping the keys on the server anyway.
PRF lets you hand that whole problem to the passkey sync systems that Apple, Google and Microsoft already run for billions of users. You encrypt the user's data key with a secret derived from their passkey, store the encrypted result on your server, and let the passkey unlock it on whatever device the user signs in from.
Platform support has caught up too. During 2026, PRF became available on Android, on Apple platforms from iOS 18 and macOS 15, and on Windows Hello after Microsoft's February 2026 update, according to Corbado's community-tested support matrix. It's not universal yet, and I'll come back to what that means in practice, but it's no longer a niche bet.
The cryptography turned out to be the easy part. Almost everything that went wrong happened where the protocol meets real devices and real people. Here are the lessons I'd pass on to any team trying the same thing.
The specification allows an authenticator to return PRF output when the passkey is created, and synced passkeys from Apple and Google often do. Many other authenticators only confirm that PRF is supported at creation and wait until sign-in to produce the output. So for a meaningful share of users, setup means two biometric prompts in a row.
Nothing is broken, but it looks broken to the user. Adding one line of interface copy, such as "you may be asked twice", saves you a support ticket and saves the user a lot of doubt. Protocol quirks become product problems the moment a person sees them.
The safest place for an unlocked encryption key in a browser is memory, not disk. Keys on disk can be read by malware, by an extension with storage access, or by anyone who picks up the unlocked laptop. Keys in memory disappear when the tab closes.
The downside is that users have to unlock again after every full page reload. With a password, that's a terrible experience, so teams end up caching keys on disk to avoid it. With a passkey, unlocking is a single touch. This is the point I think gets overlooked: passkeys don't just replace a weak control, they make strong controls affordable. Several security decisions I would have compromised on became easy once unlocking took one tap.
If an unlock dialog can be closed, people will close it, often by accident while clicking around. They then land on a screen full of content they can't read, and every part of your app has to handle that half-loaded state. Treat the unlock step as a gate that stays in place until the key is loaded or the user signs out. It may feel heavy-handed in design review, but it's the right call in production.
The most serious bug I dealt with wasn't directly about passkeys. Users who went through setup more than once ended up with several active key pairs without realising it. Senders encrypted messages to all of them, up to a cap, and a device that could unlock only the newest key failed on messages it should have been able to read. To the user, it looked like random messages were refusing to open.
This applies well beyond my app. When keys follow users across devices, the most dangerous state is a second key the user doesn't know about. Check for an existing enrolment before you generate a new key, send returning users to "unlock" instead of "set up", and always derive key identifiers from the key itself rather than trusting a cached label.
A passkey carries a user name and a display name, and your app will probably label each unlock method on its settings screen. It's tempting to treat these as plumbing, but they're part of the user experience. A passkey saved under a generic name like "user" looks the same as every other entry in a password manager's list. A label built from navigator.platform reads "MacIntel", even on modern Apple Silicon Macs. Users manage passkeys by recognising them, so use names a person would use, like the account email, "MacBook" or "iPhone".
The same property that stops phishing also means a passkey created on localhost or a staging domain won't work in production. Every environment needs its own test passkeys, and if you might change domains in the future, you need a migration plan from day one. Rebrands are usually where teams find this out the hard way.
Your setup flow might publish a public key early so other users can start encrypting messages to the new user. If that user abandons setup before saving any unlock method, you're left with a published key whose private half nobody holds. Others will keep encrypting to it, and nobody will ever be able to read those messages. To avoid this, revoke the key when setup is cancelled.
When a user cancels the biometric prompt, the browser throws a NotAllowedError. Treat it as a choice the user made, not an error, so skip the red toast and calmly offer the alternative. When a provider reports that PRF isn't available, say so in one sentence and move on. The fallback isn't just an apology for old browsers. For some users, on some days, it's the main way they'll use your product.
Passkeys have largely solved sign-in. What they haven't solved is the user who loses everything, and that problem gets harder, not easier, once you use passkeys for encryption.
For login, recovery is a business process. If a user loses every device, you can verify them another way and let them register a new passkey. It's annoying, but it's solvable, because your server still controls the account.
For encryption, that option is gone by design. If your server could recover a user's data key, it could also read the user's data, which defeats the purpose. So if a user loses every passkey and every recovery method, their encrypted data is gone for good. You can't bring it back, your support team can't, and neither can a court order.
Three principles have helped me here:
- Say it plainly, before setup. Tell users in one sentence that losing every unlock method means losing their history, and that nobody can recover it. If you bury this in a help article, users will discover it at the worst possible moment.
- Make the safe path the obvious one. Recommend one synced passkey plus one independent recovery method. Synced passkeys already survive the most common kind of loss, which is getting a new phone.
- Treat recovery methods as equals. In your architecture, a recovery password should be just another way to unlock the same key, not a special backdoor. That keeps the system simple and makes it easier to add better recovery options later.
The industry is still working out what better recovery looks like, from recovery contacts who each hold a share of a key, to printed recovery kits, to a hardware key kept in a drawer. I expect a lot of the most interesting product work in authentication over the next few years to happen here.
If your product stores anything users would rather you couldn't read, passkey-based encryption is now a reasonable item for your roadmap, not just a research project. Here's how I'd approach it:
- Ship passkey sign-in first if you haven't already. It removes your largest attack surface and puts the credential on users' devices, which every later capability builds on.
- Decide what your servers don't need to see. That could be messages, notes, health data, documents or financial records. The best encryption feature is one where you can honestly tell users "we can't read this".
- Build the fallback before the passkey path. PRF support is broad but not universal. A recovery password wrapper gets every user working on day one, and passkeys then make the common case much smoother.
- Budget for the edge cases, not the maths. Most of your effort will go into browser quirks, key lifecycle, error states and interface copy, so staff and plan for that.
- Write down your invariants. For example: one identity key per user, keys in memory only, and every unlock method wraps the same key. Make them explicit, test them, and alert when they break.
- Remember the web's limit. On the web, the server that stores the ciphertext also ships the JavaScript that encrypts it. Passkeys remove the need to trust your storage, but users still have to trust your code delivery. A strict Content Security Policy and careful release practices matter even more here.
Passwords taught a generation of engineers to think of authentication as a gate. Passkeys let us think of it as a key the user carries with them. Teams that make that shift early can ship privacy features that used to be too painful for ordinary people, using infrastructure that's already on billions of devices.
If you want to build this yourself, my companion guide walks through the full implementation with WebAuthn PRF, from registration to unlocking on a new device.