▢ Case study · 2026
VaultX
A self-hosted, zero-knowledge password manager with a web vault and Chrome extension. Everything is encrypted on your device, so the server only ever stores ciphertext.

- Role
- Solo full-stack developer
- Year
- 2026
- Timeline
- Sep to Oct 2026
- Built with
- TypeScriptReactViteNode.jsFastifyPostgreSQLlibsodiumWebAuthnChrome Extensions (MV3)DockerVitestPlaywright
01
The problem
Most password managers ask you to trust their servers with your most sensitive data. Self-hosted options give you control, but then you’re the operator. If your server or database leaks, your passwords shouldn’t go with it.
I wanted a password manager where the server is treated as untrusted by design. It should store only encrypted data. It shouldn’t be able to read, swap or quietly roll back anything without the client noticing.
02
What he built
VaultX is a zero-knowledge password manager with three parts:
API: a Fastify and Postgres server that stores only ciphertext
Web vault: a React app
Extension: a Manifest V3 Chrome extension for autofill
How the encryption works. Your master password never leaves your device. It’s stretched with Argon2id (64 MiB, 3 iterations by default), then split with HKDF into two values:
a key that unlocks your vault key
a separate auth hash, used only to log in
Every item is encrypted on the client with XChaCha20-Poly1305 and a fresh random nonce on every save.
Features
Logins, secure notes, cards and identities, with folders, tags, favorites, password history and a 30-day trash with undo
Two-factor login with authenticator codes or phishing-resistant passkeys, plus recovery codes and a printable emergency kit
Live 2FA codes for saved sites, which the extension can fill
Extension autofill with Public Suffix List matching, a keyboard shortcut, a right-click menu, “save this password?” prompts, and card and address filling
Import from Chrome, Firefox, Bitwarden and 1Password, plus encrypted backups
A password health report (weak, reused and old passwords), checked entirely on your device
An opt-in breach check against Have I Been Pwned that sends only hash prefixes
A passphrase generator using EFF’s word list
The code is split into five packages: crypto, item-format, server, web and extension. All cryptography lives in a single package.
03
The hard parts
A server that can’t cheat. Encrypting items isn’t enough on its own. A malicious server could still swap two items, serve an old version, or hide one entirely. I closed each of those gaps:
Swaps and stale revisions: every item’s ID and revision are bound into its encryption, so a swapped or relabeled item fails to decrypt.
Hidden, added or rolled-back items: an encrypted vault manifest lists every item and revision, and only the vault key can write it. Any device, even a brand-new one, can check the items it’s served against the manifest.
An older copy of the whole vault: a vault checkpoint, a fingerprint only your key can compute, lets you compare devices or your emergency kit.
No silent trust. A vault with no trustworthy manifest opens read-only until you confirm it. That stops a server from quietly resetting your state.
Protecting the KDF. The client receives its KDF settings from the server. A hostile server could send weak ones to make cracking easier, or huge ones to freeze the client. So the client enforces strict minimums and maximums.
For an email that doesn’t exist, the prelogin endpoint returns a deterministic fake salt. That way it can’t be used to find out who has an account.
Securing two-factor and sessions. TOTP secrets are encrypted at rest under a key kept outside the database, so a leaked database or backup doesn’t expose them. Auth hashes are checked in constant time, and both auth hashes and session tokens are stored only as hashes. Logins are rate-limited per IP and per account. Changing your master password rotates the vault key and re-encrypts every item.
Autofill that doesn’t leak. The extension uses the Public Suffix List, so a login saved for one github.io site never fills on another. Nothing fills without a click.
04
How it turned out
VaultX is live at vaultx.piyushydv.com (opens in a new tab), with a working Chrome extension.
About 41K lines of TypeScript across 5 packages, with 61 test files
Known-answer crypto tests checked against independent implementations
Seeded fuzz tests for every parser of untrusted input
Integration tests that scan every raw database row to prove no plaintext or key material is ever stored
End-to-end Playwright suites for the web vault (including passkeys) and the extension
Reproducible web builds that can be verified against published SHA-256 checksums
A threat model covering seven attack scenarios, with an honest list of what VaultX doesn’t protect against
Gallery · 4



