Skip to content

Personal Password Manager: The Server Keeps the Vault but Cannot Open It

I built my own password manager. Every field is encrypted on my devices, and the server stores ciphertext and a wrapped key it cannot open.

I built it to take back my freedom, privacy and security. I don't trust big tech with my passwords.

It has three clients: a web app that installs as a PWA, an iPhone app with AutoFill, and a browser extension. They share one backend on Cloudflare, under my own account: Pages for the app, Pages Functions for the API, D1 for storage and two small cron workers. It is single-user by design, with no sign-up. The repo has 233 commits, from January to September 2026. Most of the later ones are numbered rounds of audit fixes, up to R87.

What it does

  • Logins, passkeys, cards, identities and notes, with tags, folders, attachments, password history and TOTP codes.
  • A Security Center for weak, reused, breached and overdue passwords. The breach check calls Have I Been Pwned, a third-party service, with only the first five characters of a SHA-1 hash. It is the one outside request the app makes.
  • Sync with conflict detection, an offline queue and offline unlock.
  • Import from Bitwarden, 1Password, KeePass and CSV, and share links that carry their key in the URL fragment, which never reaches the server.

What the server can and cannot see

The first rule in the repo's notes: nothing on the server can see inside the vault, so no feature may assume it can. Search, sorting and breach checks run in the client. The server holds three things:

  • Ciphertext. Every field, names and URLs included, as an AES-256-GCM envelope.
  • The vault key, wrapped under a key derived from my master password.
  • A salted hash of a login proof. Never the password.

It still sees row ids, timestamps, how many entries there are, sessions and failed sign-ins. AES-GCM keeps the length of what it encrypts, so plaintext is padded to a size bucket first: every value of 24 characters or fewer is the same size on the wire.

Getting this right took several rounds. Five critical bugs in R56 to R59 were the same mistake: server code that assumed a field held plaintext. A breach-check worker hashed ciphertext and reported "no breaches" for good. Length limits sized for plaintext sliced envelopes and made entries unrecoverable.

The key hierarchy

master password
  -> PBKDF2-SHA256, fixed salt, 600,000 iterations
       = login proof: sent, salted again, stored
  -> PBKDF2-SHA256, random salt, 600,000 iterations
       = wrapping key: never leaves the device
       -> unwraps the vault key (32 random bytes)
            -> AES-256-GCM, slot in the AAD: every field

The two derivations use different salts, so the proof decrypts nothing. The server hashes it again with a random salt at 100,000 iterations, the most Cloudflare Workers will run, so the expensive work stays in the client. Until R81, in August 2026, the browser sent the password itself to sign in. Now no client can.

Each envelope is bound to its slot. The additional authenticated data names the entry and the field, and an envelope moved anywhere else fails its GCM tag. Before R87, a malicious server could have moved a bank password into an entry whose URL it controlled, and the app would have autofilled it there. Because the vault key is random, a password change now re-wraps one blob and rewrites nothing else.

Three clients

  • Web app. React, TypeScript and Vite. All crypto is Web Crypto. Sessions are a one-hour token in an HttpOnly cookie, and nothing goes into localStorage.
  • iPhone. A Capacitor shell around the same app, with Face ID unlock through the Keychain and an AutoFill extension for Safari and other apps.
  • Browser extension. Manifest V3 in plain JavaScript, for Chromium browsers and Firefox. Content scripts never hold a secret: when I submit a form, the page gets back one word, new, same or changed. Which sites may receive a credential is decided by the Public Suffix List plus about 150 multi-tenant hosts it misses.

How it is tested

  • 87 Vitest files: unit tests, plus every server handler against a scripted D1. Parity tests run the proof derivation from all three places it lives, and seal in the web app and open in the extension, both ways.
  • About 80 Playwright tests against the built app, with the API mocked and the crypto real. One types canary strings into the entry form and fails if any appears in the outgoing request. Another unlocks with Chromium's virtual authenticator.
  • A claims test ties each promise on the app's public security and privacy pages to the code that makes it true.

CI runs the typecheck and both suites before the deploy script, which exports D1, migrates, deploys and checks health. Backups are sealed to my certificate, so the runner can make one but never open one.

Trade-offs

The web app is trusted code. The server serves the JavaScript that asks for my master password, so whoever controls it could ship a page that steals the password as I type. A strict CSP, Subresource Integrity and no third-party scripts narrow that risk. They cannot remove it. The extension and the iPhone app are installed separately and are not exposed to it.

iOS AutoFill uses a second, simpler format. The AutoFill extension never sees the master password or the vault key. The app publishes a small index for it, host, username and password per login, sealed with a random key held in the Keychain behind Face ID. I chose that over porting the vault crypto to Swift, because two copies of the code that protects every password is the drift that lost data here before. The cost is a second copy on disk, so it holds logins only and is cleared on lock and sign-out.