Zero-knowledge on a free plan: what my own server can't see
Keyhaven's server stores all my passwords and has never seen one. Here's the key split that makes that work, using only the browser's built-in crypto, and the limits I'm not going to hide.

A password manager has one job it can never get wrong: the place that stores your passwords must not be able to read them. That’s what “zero-knowledge” means. The server keeps everything, and knows nothing useful.
For Keyhaven, that rule shaped every line of the crypto. It also had to fit inside Cloudflare’s free plan, which turned out to push in the same direction.
One password, two keys
Everything starts with my master password, on my device:
master password + salt
└─ PBKDF2-SHA256, 600,000 rounds ──▶ master key (256 bits)
├─ HKDF "auth" ──▶ auth key → sent to the server, to sign in
└─ HKDF "enc" ──▶ encryption key → never leaves the device
encryption key ── AES-256-GCM ──▶ wraps the vault key (random, 256 bits)
vault key ── AES-256-GCM ──▶ every item, every alias note, the mail key

PBKDF2 is deliberately slow: 600,000 rounds take about half a second when I unlock. That’s the point. Every guess an attacker makes costs them the same half-second. The salt and the round count are stored with the account, so the count can go up later, and the app refuses anything below 600,000.
HKDF then splits the master key in two. Same input, two different labels, two keys that have nothing to do with each other. The auth key proves it’s me. The encryption key opens the vault. Knowing one tells you nothing about the other, so the server can check the first without ever being able to compute the second.
What the server does with the auth key
It doesn’t even keep it. It keeps a keyed hash of it: an HMAC with a per-account salt and a secret “pepper” that lives in Cloudflare’s secrets, not in the database. A stolen copy of the database alone can’t be used to sign in. It can be used to test password guesses offline, though: the wrapped vault key confirms a right guess, with no pepper involved. So the real protection is a long passphrase and a slow stretch, and new accounts use Argon2id.
Why a fast hash and not another slow one? Two reasons:
- the auth key is already the result of 600,000 rounds: 256 random-looking bits nobody is going to guess directly
- the free plan wouldn’t allow it anyway. A Worker gets about 10 ms of CPU per request, and Workers cap PBKDF2 at 100,000 rounds
So the slow part runs on my device, where it’s free, and the server only does cheap work. The free plan and good design agreed here.
The expensive maths happens where I hold the password. The server only ever sees its results.
Why there’s a separate vault key
The encryption key doesn’t encrypt my items directly. It wraps a random vault key, and the vault key encrypts everything else. The vault key is the one my devices keep in memory while unlocked; the browser extension keeps it in session storage, which is wiped when I lock or close the browser.
Changing the master password makes a new salt, a new auth key and a new vault key. My device re-encrypts every item, every alias note and the mail key, and sends it all in one request that the server applies in one transaction. Every signed-in device is signed out, and the emergency kit (below) is re-wrapped, so it keeps working. An old backup or database copy still opens with the old password, though: changing it protects what happens next, not copies someone already has.
One item, one envelope
Each vault item is encrypted on its own, with AES-256-GCM:
- a fresh random 96-bit IV every time it’s saved
- the item’s id as associated data: a ciphertext moved to another item simply fails to decrypt, and after decrypting, the id inside must match the row it came from
- a small version prefix in front, so the format can change one day without guesswork
The server sees each item’s id, its size and when it last changed. Nothing else.
Getting back in, without a back door
Until version 1.3.0, forgetting my master password meant losing everything. 1.3.0 added a few ways around the lock screen, all optional, and each one built so the server still can’t open the vault on its own:
- An emergency kit. A 160-bit recovery code, made on my device and shown once, to print or download. It wraps the same vault key, so “Forgot your master password?” lets me choose a new one and keep every item, alias and mail. The server keeps that wrapped copy and a keyed hash of a proof made from the code, never the code itself. The catch is real: anyone holding the paper (plus my 2FA code, if it’s on) can take over the vault. So it lives with my passport.
- A PIN, or Windows Hello, per device. The vault key is wrapped by a key made from the PIN together with a random half that only the server holds. The server counts wrong PINs, and the fifth one deletes its half: after that, only the master password works. A copied browser profile can’t be brute-forced offline, because half of the key isn’t in it. The price: it needs a connection.
- Stay unlocked, for as long as the tab is open, a day or seven days. This one is honestly less safe, and the app says so: anyone who can use that browser profile in that time opens the vault without any password. The Lock button still locks at once. The server holds half of what it takes, and decides when that ends.
- A password hint, if I want one. It’s stored in plain text, because it has to be readable before anything is unlocked. A hint, never a piece of the password. Since 1.15.0 it can go to the Trash, where it isn’t plain, and a restore puts it back in plain text.
- My fingerprint with no connection, since 1.14.0, off by default. It opens the saved copy on that device. This one is less safe too, and the setting says how: with no connection, the server can’t count tries or take it back. Turning it on asks for my master password, and a PIN never works offline. On Android, setup asks for a passkey, which may sync with the phone’s password manager, so the secret can reach my other devices. On its own it opens nothing, but with no connection a copy of this device’s data plus that passkey is enough. The page says so when the authenticator reports a passkey that can sync.
- Someone I trust, since 1.18.0 (update, 12 November 2026). Emergency access lets a person with their own Keyhaven ask for my vault if something happens to me. We check each other’s key fingerprint, and my own device seals my vault key to their public key, so the server only ever holds a copy it can’t open. It hands that copy over after the waiting time I chose (1 day to 30 days), unless I say no first, and only to read or to take over, as I picked. Every step goes into a trail I can read.

Master passwords themselves got stricter too: 12 characters or more, and rated “Strong” by an offline estimator that isn’t fooled by repeated words, look-alike swaps like P@ssw0rd, or a word plus a year.
What the server sees, and what it doesn’t
| The server knows | The server never sees |
|---|---|
| how many items, their sizes and change times | the master password |
| a peppered hash of the auth key | the encryption key or the vault key |
| alias addresses (mail routing needs them) | any item: logins, notes, cards, 2FA secrets |
| when mail arrived, and how big it was | alias notes, or what an alias is used for |
| my mail public key | any readable mail |
| the names of my signed-in devices | the emergency kit’s recovery code, or a PIN |
| the password hint, if I set one |
One honest exception: if I turn on a 2FA code for signing in to Keyhaven itself, the server has to check that code, so it can use that one secret. It’s stored encrypted with a key that comes from the server’s secret, not in the clear.
Another one since version 1.11.0: a login can show its site’s logo, and my own server is what fetches it, so the site never sees my device. That means the server sees the site’s name at that moment. It keeps nothing, the logo is saved encrypted with the login, and a setting turns it off.
And two since version 1.14.0, because they have to work with the app closed. A note that destroys itself means the server knows that item’s id and a time, never its contents. A one-time inbox means it knows which alias is one-time and when it goes, and it never reads a mail for that. The converter’s currency rates also come through my own server, which sends nothing about who asked, and no amounts.
Version 1.15.0 added 58 options to Settings. Fixed choices about how the app behaves are stored in the clear on the server, like my other settings. Generator defaults, the default vault, the Trash filter and the default country are in the encrypted hidden item, and device-only choices stay on the device. No option turns off zero-knowledge.
Update, 12 November 2026 (1.18.0): a few more things the server knows. A security key for signing in means it keeps that key’s public half. Emergency access means it knows that a trusted person exists, their key’s public half, the waiting time and the trail, and, if I add one, an address for their notices, in plain text so the mail can reach them. Replies through an alias mean it keeps a reply address for each person I answer, stored so that the table names nobody: only a hash of the address’s token, and the person’s address encrypted with a key that comes from that token.
Everything uses WebCrypto, the crypto built into browsers and Node: PBKDF2, HKDF, AES-GCM, ECDH, HMAC, SHA. No home-made cryptography, and the same file runs in the site, the extension and the tests.
The limits, honestly
- Nobody has audited it. I built it (with AI help) and reviewed it myself. That’s why I keep an encrypted export somewhere safe.
- Forget the master password and the vault is gone, unless I made the emergency kit. The server can’t reset anything, by design. And the kit is only as safe as the drawer it’s in.
- A device with malware (a keylogger, a bad extension) can read what I type and what’s on screen. No password manager can protect an unlocked vault on a compromised device.
- Whoever controls the hosting account could change the site’s code to capture my master password the next time I type it. That’s true of every password manager that runs as a web page. The extension’s copy of the code only changes when I update it.
- A copy of the database can be attacked offline. The rate limits below only work against the server. With a copy, the only defence is how slow each guess is and a passphrase long enough that guessing never ends, which is why the app insists on a strong one.
- Metadata is visible: the counts, sizes, times and addresses in the table above.
- Stay unlocked trades safety for comfort. While it’s on, the browser profile and its session are the only lock.
- Wrong passwords are rate-limited per address and, for unknown devices, in total. A device that signed in before, a PIN and a recovery code don’t pay the shared limit, so someone hammering the server can’t lock me out of those.
None of that is unusual for a password manager. I’d just rather write it down than pretend it isn’t there.