RustVault: Self-Hosted Password Vault and Privacy Toolkit
A password vault and privacy toolkit written in Rust that runs only on your own machine: encrypted vault, recovery key, automatic backups, Firefox hardening and a script-blocking browser extension.
Project Overview
RustVault is a password vault that never leaves your computer. One Rust binary serves a terminal menu and a web interface over the same encrypted vault, and the web interface listens on 127.0.0.1 only. There is no account, no subscription and no sync server to breach.
Around the vault sit privacy tools: Firefox hardening profiles, a JavaScript kill switch, the Script Guard extension, sandboxed browsers in Firejail, a Tailscale exit-node panel and DNS-over-HTTPS.
Implementation Process
- Encryption: every entry is encrypted with AES-256-GCM using a random data key; the key is wrapped twice, once by the master password (Argon2id, 64 MB, 3 passes) and once by a 28-character recovery key.
- Storage: PostgreSQL or a local SQLite file.
- Lockout: five wrong passwords or recovery keys lock unlocking for 10 minutes, doubling on repeat.
- Backups: made in the background at unlock when the last one is too old, with old automatic ones pruned.
- Script Guard: a Firefox extension that blocks every page script by default and rewrites the page security policy to allow only approved script URLs and SHA-256 hashes of approved inline code.
Results
- Forgetting the master password no longer loses data: the recovery key restores access with every entry intact.
- Existing vaults upgrade themselves on the next unlock without re-encrypting a single entry.
- Password health checks flag weak, reused, year-old and undecryptable entries without displaying any password.
Benefits
- No third-party server holds your vault.
- The whole codebase can be read end to end.
- The vault only connects out when you ask it to.
Challenges & Solutions
The hardest bugs only appeared with real use: a rate-limiter deadlock that hung every unlock after five logins, a password reset that made every entry unreadable, a backup screen that showed made-up numbers, and an API that answered any website (Access-Control-Allow-Origin: *). All are fixed and covered by regression tests. The full story is in the RustVault blog post.
Conclusion
Next steps are keeping the unlocked key in memory only, wrapping the data key for every recovery method, continuous integration, k-anonymity breach checks and TOTP codes.
Contents
Related Projects
Interested in more security projects?
Explore my other security implementations and solutions.
View All Projects