Ir al contenido

vaultlog

Python 3.11+ AES-256-GCM PBKDF2-HMAC-SHA256 Textual TUI cryptography Security MIT

GitHub: stevenvo780/vaultlog


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.

ComponentRole
vaultlog/crypto.pyPBKDF2-HMAC-SHA256 key derivation + AES-256-GCM encrypt/decrypt
vaultlog/store.pyVault CRUD — atomic writes, manifest, password rotation with staged re-encryption
vaultlog/tui.pyTextual TUI — sidebar, markdown editor, panic mode (F8), idle auto-lock
vaultlog/cli.pyargparse CLI — init, open, new, backup, verify, doctor, and more
vaultlog/gitops.pyGit backup engine + embedded pre-commit hook script
scripts/build_deb.shReproducible .deb packaging with bundled venv under /opt/vaultlog/

  1. 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 into config.json; the password and derived key do not.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Ventana de terminal
git clone https://github.com/stevenvo780/vaultlog.git
cd vaultlog
python3 -m venv .venv
.venv/bin/pip install -e .
# The `vaultlog` command is now available inside the venv

Initialize a new vault (prompts for master password):

Ventana de terminal
vaultlog init

Open the TUI editor:

Ventana de terminal
vaultlog open

Common CLI commands:

Ventana de terminal
# List all entries (metadata only)
vaultlog list
# Create an entry — prefer --body-stdin to avoid shell history leaks
echo "my private note" | vaultlog new --title "daily log" --body-stdin
# Show a decrypted entry; use --metadata-only to avoid scrollback exposure
vaultlog show daily-log --metadata-only
# Verify all entries decrypt correctly
vaultlog 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 check
vaultlog doctor --verify
# Install the pre-commit hook in the project repo
vaultlog install-git-hook

KeyAction
Ctrl+NNew entry
Ctrl+RRename entry
Ctrl+SSave
Ctrl+BVerify, commit, and push the encrypted vault
Ctrl+LLock the session
F8Panic mode — camouflage the screen as ordinary source code
Ctrl+GFocus the entry list
Ctrl+EFocus the editor
Ctrl+QQuit

LayerTechnology
Authenticated encryptionAES-256-GCM (cryptography.hazmat.primitives.ciphers.aead.AESGCM)
Key derivationPBKDF2-HMAC-SHA256, 390 000 iterations (cryptography.hazmat.primitives.kdf.pbkdf2)
TUI frameworkTextual >=8.2
CLIargparse (stdlib)
Atomic writesos.replace + fsync (stdlib)
Git backupsubprocess calling git (no extra dep)
Packagingsetuptools + scripts/build_deb.sh.deb with bundled venv
RuntimePython 3.11+
LicenseMIT