black-bag
black-bag is a zero-trace, no-compromise command-line vault for high-risk operators. It ships as a single Rust binary with the strongest defaults we can provide: Argon2id hardening, ML-KEM-1024 cascaded wrapping (Kyber), XChaCha20-Poly1305 payload encryption, zeroization of every secret buffer, and page-locked memory on Unix. There is no optional telemetry, no cloud, no GUI—just a laser-focused CLI that keeps secrets safe even under hostile conditions.
Highlights
- Zero-trace posture – secrets never touch stdout, logs, temp files, or the clipboard. All input happens via hidden TTY prompts and is stored only after AEAD encryption.
- Modern crypto pipeline – Argon2id → ML-KEM-1024 (Kyber) → random 32-byte DEKs sealed with XChaCha20-Poly1305. Writes are atomic/fdatasync’d with strict permissions and zeroized in memory on drop.
- Rich record catalogue – logins, contacts, identity docs, secure notes, payment cards, SSH keys, PGP keys, TOTP seeds, recovery kits, bank accounts, Wi-Fi profiles, API credentials, and crypto wallets. Every record supports tagging and full-text queries.
- Cross-platform parity – builds cleanly on macOS, Linux, and Windows.
mlockis enabled automatically on supported Unix platforms and degrades gracefully elsewhere. - Security by default – all protective features are enabled in every binary; there are no configuration flags that weaken the threat posture.
Quick start
# prerequisites: Rust toolchain 1.81+ (via rustup) and a standard build environment
Recommended hygiene:
- Run from an encrypted disk.
- Disable shell history or use
HISTCONTROL=ignorespacewith leading spaces. - Set
RUST_BACKTRACE=0in operational shells.
Creating your vault
You’ll be prompted for the master passphrase twice. The vault stores under the platform data directory (e.g., ~/.config/black_bag/vault.cbor).
Adding records
# login
# contact
# identity document
# secure note
# bank account
# Wi-Fi profile
# API credential
# crypto wallet
# totp secret
# totp codes
Sensitive fields (passwords, passphrases, API secrets, private keys) are collected via hidden prompts after the command issues—nothing sensitive ever appears in argv or shell history.
Listing, filtering, and querying
Inspect a specific record:
Rotation, health, and recovery
black-bag rotate– rewraps the master DEK with fresh randomness.black-bag doctor– prints health info (Argon2 params, feature flags, item counts).black-bag recovery split/combine– manage Shamir shares for catastrophic recovery.
Threat model (summary)
See docs/THREAT_MODEL.md for assumptions, adversary capabilities, and residual risks. Treat the vault ciphertext as sensitive and keep backups offline.
Building and testing
CI should run the same three commands on every commit. Tests cover cryptographic round-trips, helper utilities, and zero-trace guarantees.
Mission-ready checklist
- Argon2id + ML-KEM-1024 + XChaCha20-Poly1305 enabled by default
- No GUI, clipboard, or plaintext log exposure
- Cross-platform parity (Windows/macOS/Linux)
- Comprehensive record catalogue with search & tagging
- Lint/tests clean with zero warnings
- Operator docs and threat model committed
For production roll-out, schedule an independent cryptography/code audit and set up fuzzing pipelines (see docs/FURTHER_HARDENING.md).