vaultlog
Python 3.11+
AES-256-GCM
PBKDF2-HMAC-SHA256
Textual TUI
cryptography
Security
MIT
Ventana de terminal Ventana de terminal Ventana de terminal
Ventana de terminal
Ventana de terminal
Ventana de terminal
GitHub: stevenvo780/vaultlog
What it is
Sección titulada «What it is»vaultlog is a CLI + TUI journal where every entry lives as ciphertext on disk, unlocked with a single master password and optionally backed up to a private Git repository — without ever committing plaintext.
The master password is never stored. It is used exclusively to derive a 32-byte key in memory; the derived key and the password are discarded as soon as the vault is locked. If the password is lost, the encrypted content cannot be recovered.
| Component | Role |
|---|---|
vaultlog/crypto.py | PBKDF2-HMAC-SHA256 key derivation + AES-256-GCM encrypt/decrypt |
vaultlog/store.py | Vault CRUD — atomic writes, manifest, password rotation with staged re-encryption |
vaultlog/tui.py | Textual TUI — sidebar, markdown editor, panic mode (F8), idle auto-lock |
vaultlog/cli.py | argparse CLI — init, open, new, backup, verify, doctor, and more |
vaultlog/gitops.py | Git backup engine + embedded pre-commit hook script |
scripts/build_deb.sh | Reproducible .deb packaging with bundled venv under /opt/vaultlog/ |
Encryption architecture
Sección titulada «Encryption architecture»- Key derivation. On
init, a random 16-byte salt is generated. The master password and salt are run through PBKDF2-HMAC-SHA256 (390 000 iterations) to produce a 32-byte key. Salt and iteration count go intoconfig.json; the password and derived key do not. - Verifier. A small known payload is encrypted with the derived key and stored in the config. On
unlock, vaultlog re-derives the key and decrypts the verifier to confirm the password. - Per-record encryption. Each entry and the manifest are serialized to JSON and sealed with AES-256-GCM. A fresh random 12-byte nonce is generated per encryption call; GCM provides both confidentiality and tamper detection.
- On-disk layout (default
./.vaultlog/):config.json— version, salt, KDF iterations, encrypted verifier, settings. No plaintext content.manifest.enc— encrypted index of entry metadata.entries/<id>.enc— one encrypted file per entry.
- Password rotation re-encrypts the entire vault into a staging directory, verifies it decrypts cleanly, then atomically swaps it in and timestamps the previous state.
Installation
Sección titulada «Installation»git clone https://github.com/stevenvo780/vaultlog.gitcd vaultlogpython3 -m venv .venv.venv/bin/pip install -e .# The `vaultlog` command is now available inside the venvgit clone https://github.com/stevenvo780/vaultlog.gitcd vaultlogpython3 -m venv .venv && .venv/bin/pip install -e .scripts/build_deb.sh# Output: dist/vaultlog_<version>_<arch>.debsudo dpkg -i dist/vaultlog_*.deb# Installs self-contained under /opt/vaultlog/; adds /usr/bin/vaultlog shimpython3 -m venv .venv && .venv/bin/pip install -e ..venv/bin/python -m unittest discover -s tests# Covers: crypto roundtrip, store CRUD + password rotation,# git backup isolation, pre-commit hook enforcement, TUI autosaveInitialize a new vault (prompts for master password):
vaultlog initOpen the TUI editor:
vaultlog openCommon CLI commands:
# List all entries (metadata only)vaultlog list
# Create an entry — prefer --body-stdin to avoid shell history leaksecho "my private note" | vaultlog new --title "daily log" --body-stdin
# Show a decrypted entry; use --metadata-only to avoid scrollback exposurevaultlog show daily-log --metadata-only
# Verify all entries decrypt correctlyvaultlog verify
# Encrypted Git backup (init repo inside vault, push to private remote)vaultlog backup --init-git --remote git@github.com:YOU/PRIVATE_VAULT.git --push
# Rotate master password (staged re-encryption, atomic swap)vaultlog change-password
# Quick health checkvaultlog doctor --verify
# Install the pre-commit hook in the project repovaultlog install-git-hookTUI shortcuts
Sección titulada «TUI shortcuts»| Key | Action |
|---|---|
Ctrl+N | New entry |
Ctrl+R | Rename entry |
Ctrl+S | Save |
Ctrl+B | Verify, commit, and push the encrypted vault |
Ctrl+L | Lock the session |
F8 | Panic mode — camouflage the screen as ordinary source code |
Ctrl+G | Focus the entry list |
Ctrl+E | Focus the editor |
Ctrl+Q | Quit |
| Layer | Technology |
|---|---|
| Authenticated encryption | AES-256-GCM (cryptography.hazmat.primitives.ciphers.aead.AESGCM) |
| Key derivation | PBKDF2-HMAC-SHA256, 390 000 iterations (cryptography.hazmat.primitives.kdf.pbkdf2) |
| TUI framework | Textual >=8.2 |
| CLI | argparse (stdlib) |
| Atomic writes | os.replace + fsync (stdlib) |
| Git backup | subprocess calling git (no extra dep) |
| Packaging | setuptools + scripts/build_deb.sh → .deb with bundled venv |
| Runtime | Python 3.11+ |
| License | MIT |