Skip to content
MoskyeraPublic

About

Local, offline, single-file encrypted secret vault. No accounts, no server, no network code.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Protector

Encrypted secret vault with no quantum-vulnerable cryptography, for Windows & Linux.

Local, zero-knowledge, no accounts, no backdoors. Without your master password or threshold Shamir shares, the .protector file is cryptographically useless: even to you.

On "quantum"

There is no RSA, no elliptic curve and no Diffie–Hellman anywhere in this vault, so Shor's algorithm has nothing to attack. Grover's algorithm is the only quantum attack that applies, and against AES-256 it is not a practical one, published circuit-level estimates put it at 2^190–2^245 gates (Jaques et al., Eurocrypt 2020), and once surface-code error correction is priced in the quantum attack costs more than the 2^256 classical one (UK NCSC, 2024). "Grover halves AES" is a query count, not a cost model.

We therefore do not claim "post-quantum cryptography". PQC (ML-KEM, ML-DSA) exists to replace asymmetric algorithms. This vault has none, so there is nothing to replace. Shamir Secret Sharing over GF(256) is information-theoretically secure: fewer than k shares reveal zero information to any adversary, quantum or not, with unlimited time.

Your master password is the weakest link, not the cipher. The key is Argon2id(password), so effective security is bounded by how hard your password is to guess. That is why Protector enforces an entropy floor and ships a passphrase generator, and why a "quantum-resistant" banner would be misdirection.

Features

Feature Description
Passwords Site logins with generator, optional TOTP seed on the login itself
Secure notes Free-form encrypted notes
API keys Service tokens
TOTP seeds Live 6-digit codes (RFC 6238), validated on entry
Recovery codes Multi-line backup codes
Seed phrases BIP39 12–24 words (validated)
Custom fields Arbitrary name/value pairs, individually maskable
Folders & tags Grouping and search across both
Edit & history Change any entry; the previous 10 versions are kept and restorable
Trash Deletion is recoverable, and auto-purged after 30 days
Health report Weak, reused, stale, HTTP-only and unprotected logins, computed locally
Import Chrome/Firefox/Bitwarden/1Password/KeePass CSV, Bitwarden JSON
Key file Optional second unlock factor alongside the master password
Shamir recovery K-of-N DEK shares (optional)
Portable file *.protector export/import across OS installs
Clipboard Auto-clear after copy, excluded from Windows clipboard history
Auto-lock Inactivity lock in GUI

Security model

  • AES-256-GCM: bulk encryption
  • Argon2id: memory-hard KDF, calibrated at vault creation to ~1s on your machine (floor 256 MiB, ceiling 1 GiB)
  • DEK/KEK hierarchy: random 256-bit data key wrapped by password-derived key
  • Key commitment. An HMAC-SHA-512 tag binds each file to exactly one KEK. AES-GCM alone is not key-committing, which enables partitioning-oracle attacks; note that switching to AES-GCM-SIV or XChaCha20-Poly1305 would not fix this
  • Honest failure modes. A wrong password and a tampered file are reported differently, so "invalid password" never hides an attack
  • Entropy floor: master passwords must clear both a pattern check (zxcvbn) and a size check; P@ssw0rd!2026 is rejected
  • Shamir Secret Sharing (GF(256)): optional recovery, information-theoretically secure: below the threshold, shares reveal nothing to any adversary
  • No RSA/ECC in the vault confidentiality path
  • Owner-only files: mode 0600/0700 on Unix; on Windows an explicit owner-only DACL with inheritance disabled
  • Single-writer sessions. An advisory lock on <vault>.lock plus an authenticated save epoch, so two instances cannot silently overwrite each other
  • Secrets never on the command line: passwords, TOTP seeds and Shamir shares are read from hidden stdin, never from argv
  • Clipboard excluded from Windows Clipboard History and Cloud Clipboard, in addition to the timed auto-clear
  • panic = "unwind" in release, so destructors run and keys are zeroized even on a crash; panic payloads are suppressed in release because they can carry secrets

Key file (optional second factor)

KEK' = HMAC-SHA-512(key = Argon2id(password), "protector-v3-keyfile" ‖ SHA-256(file))

The HMAC is keyed with the password-derived KEK, so stealing the key file alone gains an attacker nothing. They still face the full Argon2id cost, and cannot even begin without the password. Both factors are required; neither is sufficient.

The requirement is recorded in the header and covered by the AAD and the commitment tag, so flipping the flag on disk does not strip it.

Losing the key file is exactly as fatal as forgetting the password. Back it up separately from the vault. Shamir shares are the only recovery path, and note that shares reconstruct the DEK directly, below both factors, so recovery resets the vault to password-only.

Import

Every supported export format is plaintext, which makes the export file the least protected copy of your entire password history that has ever existed. --shred overwrites and deletes it afterwards; on SSDs and copy-on-write filesystems the original blocks may still survive, so treat it as removing the file rather than erasing every trace.

1PUX and KDBX are deliberately unsupported. Both are container formats that would mean a new dependency parsing attacker-supplied files inside the process holding the master key, and the CSV path already covers the same data from both tools.

Known limitations

  • On Linux/macOS the clipboard cannot be marked sensitive (no arboard API), so there the timed clear is the only protection.
  • The plaintext header discloses the KDF parameters, the save epoch, and whether Shamir is configured; the file size discloses roughly how much is stored (the payload is not padded).
  • Nothing outside the file records its epoch, so restoring a whole older copy of the vault is still accepted. Splicing parts of an old file into a new one is not.
  • Shares are raw id-hex with no checksum: a mistyped share fails late and undiagnosably.
  • Shamir shares sit below the master password. They recover the DEK directly, so changing the password does not revoke them. Use disable_shamir / re-issue to rotate the DEK.
  • Entry secrets pass through Strings that reallocate, so heap copies can outlive zeroize. There is no page locking or core-dump suppression yet.
  • Entry history keeps up to 10 previous versions inside the vault, so a rotated password lingers until it is pushed off the stack. Trash behaves the same way until it is purged.
  • There is no breach check (HIBP or otherwise). It would be the first network request this application ever makes, and that is the user's decision to opt into, not a default.

If you forget the master password and do not have enough Shamir shares, recovery is impossible by design.

Project layout

protector/
├── protector-core/          # crypto, vault, shamir, bip39, totp, paths
├── protector-cli/           # protector CLI
├── protector-gui/           # native desktop app (egui)
├── installer/               # Windows NSIS/MSI
├── installer/linux/         # Linux tarball, .deb, install scripts
└── .github/workflows/ci.yml # CI Linux + Windows

Build

Requirements: Rust 1.95.0, pinned in rust-toolchain.toml so that CI, release builds and anyone reproducing a release use the same compiler. rustup installs it automatically.

The GUI builds without screen-reader support by default: AccessKit would publish revealed secrets and live TOTP codes to the OS accessibility tree. Build protector-gui with --features accessibility if you need it; the trade-off is documented in SECURITY.md.

Windows

cd protector
cargo build --release
# target\release\protector.exe  target\release\protector-gui.exe

Linux

# Ubuntu/Debian GUI deps
sudo apt install build-essential pkg-config \
  libxkbcommon-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
  libgtk-3-dev

cd protector
cargo build --release
# target/release/protector  target/release/protector-gui

# Package tarball + .deb
bash installer/linux/build.sh
cargo test --workspace

Default vault locations

OS Path
Linux ~/.local/share/protector/vault.protector (XDG)
Windows %USERPROFILE%\Protector\vault.protector
macOS ~/Library/Application Support/Protector/vault.protector

Vault files are portable across OSes: copy the .protector file and use the same master password.

Windows installer

powershell -ExecutionPolicy Bypass -File .\installer\build.ps1
powershell -ExecutionPolicy Bypass -File .\installer\build.ps1 -Msi

Outputs in installer\dist\:

File Description
Protector-Setup-0.1.0.exe NSIS installer
Protector-Portable-0.1.0.zip Portable ZIP
Protector-0.1.0.msi MSI (with WiX)

Linux install

# From release tarball (installer/linux/dist/)
tar xzf protector-0.1.0-linux-x86_64.tar.gz -C /tmp/protector
cd /tmp/protector   # contents: bin/, share/, install.sh
./install.sh --user           # ~/.local/bin + desktop entry
# or
sudo ./install.sh --system    # /usr/local

# From .deb
sudo dpkg -i protector_0.1.0_amd64.deb

# Uninstall (vault files are kept)
./uninstall.sh --user

Artifacts: installer/linux/dist/*.tar.gz and *.deb.

Uninstall never deletes *.protector vault files.

CLI quick start

# create vault (uses platform default path if -p omitted)
protector create -n "My Vault"
protector create -p ~/.local/share/protector/vault.protector -n "My Vault"

# passwords, seeds, totp
protector add-password -p vault.protector -t GitHub -u alice --generate
protector add-seed -p vault.protector -t "Main wallet" --generate --words 24
protector totp --prompt-secret
protector totp -p vault.protector --entry "GitHub 2FA" --watch

# export / shamir
protector export -p vault.protector -d ~/backup/vault.protector
protector shamir-setup -p vault.protector -k 3 -n 5

# recovery: shares are prompted for, hidden, one per line
protector shamir-recover -p vault.protector
protector shamir-recover -p vault.protector --shares-file ~/shares.txt

# edit an entry (secret fields are prompted for, never passed as arguments)
protector set -p vault.protector <id> --field password
protector set -p vault.protector <id> --field folder --value "Work/Infra"
protector history -p vault.protector <id>
protector history -p vault.protector <id> --restore 0

# trash: deletion is recoverable
protector delete -p vault.protector <id>
protector trash -p vault.protector
protector restore -p vault.protector <id>
protector empty-trash -p vault.protector

# audit, entirely offline
protector health -p vault.protector

# import from another manager, then destroy the plaintext export
protector import -p vault.protector --from ~/Downloads/chrome-passwords.csv --shred

# key file as a second factor
protector keyfile -p vault.protector create --file /media/usb/protector.key
protector --keyfile /media/usb/protector.key list -p vault.protector

Secrets are never accepted as command-line arguments. Master passwords, TOTP seeds and Shamir shares are read from hidden stdin (or, for shares, a file you control), so they never reach your shell history or the process table.

GUI

cargo run -p protector-gui --release
# or after install: protector-gui
  1. Create or Open a vault
  2. Add passwords, seeds, TOTP, etc.
  3. Open a TOTP entry for a live 6-digit code
  4. Copy secrets: clipboard auto-clears (default 45s; clears on Lock)
  5. Export… before uninstalling
  6. Optional Shamir recovery shares

Uninstall / reinstall workflow

  1. Export or copy vault.protector to external storage
  2. Uninstall the app
  3. Install Protector on the new machine (Windows or Linux)
  4. Open the .protector file with your master password

Vault file

  • Extension: .protector
  • Format version: 3 (JSON envelope + Base64 AEAD blobs)
  • Cipher: AES-256-GCM, plus an HMAC-SHA-512 KEK commitment tag
  • KDF: Argon2id, calibrated at creation (≥256 MiB, t=3, p=4). Parameters outside the accepted range are rejected, not clamped, clamping meant deriving with different parameters than the ones authenticated, which silently bricked files.
  • AAD covers: magic, version, cipher, quantum_profile, every KDF parameter, the Shamir flags, the vault id and the save epoch.

Version 2 files still open and are migrated to v3 on their next save.

What the identity and epoch buy you: blobs from one vault no longer authenticate in another even with identical KDF parameters, an old payload cannot be spliced into a newer header, and save() refuses to overwrite a file whose epoch it did not load.

Session model

  • Unlock derives a session KEK held only in the open vault object.
  • Vault::save() takes no password: wrong-password re-wrap lockout cannot happen on routine saves.
  • GUI does not store the master password after unlock (only on auth screens), and the editor's undo history for every secret field is wiped on lock.
  • Opening a vault takes an exclusive advisory lock on a sidecar <vault>.lock file, held until the session is dropped. A second instance gets vault is in use by another Protector session rather than silently clobbering the first one's writes. The sidecar carries no data and is safe to delete when no session is running.

Recovery notes

  • Shamir setup / re-issue always rotates the DEK and saves before returning the shares, so the shares you are shown always belong to a rotation that is committed to disk.
  • Old shares stop working for this file. Older copies and backups of the vault still accept their own shares: rotation cannot reach a file you already copied elsewhere.
  • Shamir recovery also rotates the DEK and clears Shamir flags; re-run setup for new shares.
  • Password change does not invalidate shares: shares recover the DEK directly, below the password. Re-issue or disable Shamir to revoke them.

Verifying a release

Releases ship SHA256SUMS, a detached SHA256SUMS.sig, a BUILDINFO record and a CycloneDX SBOM.

protector-sign verify --manifest SHA256SUMS --pubkey protector-release.pub

Not yet in force. Neither signature is switched on: no SLH-DSA key has been generated and no Authenticode certificate obtained, so a forged build would not be detected. Both are implemented and one command away. See SECURITY.md for what each costs and closes.

Windows builds are also meant to carry an Authenticode signature, which the operating system checks by itself. Rehearse the pipeline without buying anything:

.\installer\build.ps1 -SignSelfSigned

That checks the SLH-DSA-SHA2-128s (FIPS 205) signature over the manifest and then the hash of every file it lists. SLH-DSA is hash-based. Its security rests on the hash function alone, with no lattice or number-theoretic assumption, which is why CNSA 2.0 requires hash-based signatures for software signing. This is the one place in the project where post-quantum cryptography is actually warranted; the vault itself needs none.

Verifying a download with a binary from that same download proves nothing. It is meaningful for updates once you trust one copy, and for anyone checking a release against the public key obtained from a different channel.

Rebuilding a release yourself

scripts/release.sh
diff dist/SHA256SUMS /path/to/published/SHA256SUMS

Identical output means the published binaries were built from this source and nothing else. The build pins the toolchain (rust-toolchain.toml), resolves with --locked, uses a single codegen unit, and remaps absolute build paths. CI builds the CLI twice on every push and fails if the bytes differ.

Supply chain

cargo deny check

Gates advisories, licences, banned crates and source registries: see deny.toml, where every accepted advisory carries its reasoning. There are no git dependencies; everything resolves from crates.io through Cargo.lock. CI runs this on every push and weekly, because a dependency that is clean today can carry an advisory tomorrow.

Security

SECURITY.md has the full threat model: what Protector defends against, what it explicitly does not, the honest position on quantum computing, and how to report a vulnerability.

Short version of the part people usually get wrong: Protector uses no quantum-vulnerable cryptography. No RSA, no elliptic curve, no Diffie–Hellman. That is a smaller and more accurate claim than "quantum-proof". There is no third-party audit.

License

MIT

About

Local, offline, single-file encrypted secret vault. No accounts, no server, no network code.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages