GPG-backed lockbox for secrets management
Project description
GPMaster
A GPG-backed lockbox for secure secrets management with a custom binary format.
Features
- Custom Binary Format (.gpb): Efficient storage with unencrypted metadata for fast operations
- GPG Encryption & Signing: All secrets encrypted with GPG, with optional signature verification
- TOTP Support: Store and generate TOTP codes for two-factor authentication
- File Support: Securely store and manage files in the vault with multiple retrieval options
- Interactive TOTP Viewer: Real-time TOTP code viewer with countdown timer
- Multiple Export Formats: Dump secrets as list, JSON, or POSIX shell variables
- Minimal Dependencies: Only requires
python-gnupgandpyotp - Environment Configuration: Customize default paths via environment variables
- Retry Logic: Smart retry for GPG operations when hardware tokens are unreliable
- Quiet Mode: Minimal output for scripting
Installation
Arch Linux
makepkg -si
Debian/Ubuntu
dpkg-buildpackage -b -uc -us
sudo dpkg -i ../gpmaster_1.0.0-1_all.deb
From Source
pip install .
Quick Start
Create a Lockbox
# Create a new lockbox with your GPG key
gpmaster create YOUR_GPG_KEY_ID
# Or set default key and auto-create on first use
export GPMASTER_KEY_ID=YOUR_GPG_KEY_ID
gpmaster add mypassword --key-id YOUR_GPG_KEY_ID
Add Secrets
# Add a regular secret
gpmaster add github_token
# Enter secret: [type your secret]
# Add a TOTP secret
gpmaster add google_2fa --totp
# Enter secret: [paste your TOTP base32 secret]
Retrieve Secrets
# Get a secret
gpmaster get github_token
# Generate TOTP code
gpmaster get google_2fa --totp-code
# Monitor a TOTP code
gpmaster get -i google_2fa --totp-code
File Operations
# Add a file to the vault (moves the file by default)
gpmaster file add /path/to/document.pdf
# Add a file but keep the original
gpmaster file add /path/to/certificate.pem --keep-source
# List all files in the vault
gpmaster file list
# Retrieve a file and save to specific path
gpmaster file get document.pdf --path ~/Downloads/document.pdf
# Retrieve a file to a tmpfile (/tmp/gpmaster.$UID.filename)
gpmaster file get document.pdf --tmp
# Retrieve a file and output to stdout (binary)
gpmaster file get document.pdf --text
# Remove a file from the vault
gpmaster file remove document.pdf
Dump Secrets
# Dump all secrets in list format
gpmaster dump
# Dump as JSON
gpmaster dump --format json
# Dump as POSIX shell variables (for eval)
gpmaster dump --format sh
Show Lockbox Info
# List all secrets and files, verify note signature
gpmaster info
Other Operations
# Rename a secret
gpmaster rename old_name new_name
# Delete a secret
gpmaster delete secret_name
# Edit notes document (opens $EDITOR and signs)
gpmaster note
# Validate lockbox integrity
gpmaster validate
# Change encryption key
gpmaster rekey NEW_KEY_ID
Environment Variables
GPMASTER_LOCKBOX_PATH: Default lockbox file path (default:~/.local/state/gpmaster.gpb)GPMASTER_KEY_ID: Default GPG key ID for auto-creating lockboxesGPMASTER_QUIET: Enable quiet mode globally
Command Reference
Global Options
-l, --lockbox PATH: Specify lockbox file path-q, --quiet: Minimal output mode
Commands
create KEY_ID: Create a new lockboxadd NAME [--totp] [--key-id KEY]: Add a secretget NAME [--totp-code] [-i]: Retrieve a secretrename OLD NEW: Rename a secretdelete NAME: Delete a secretinfo: Show lockbox info and verify note signaturenote: Edit notes document with $EDITOR (signed)validate: Validate lockbox integrity and signaturerekey NEW_KEY_ID: Change encryption keydump [--format {list,json,sh}]: Dump all secrets in various formatsfile add PATH [--keep-source] [--key-id KEY]: Add a file to the vaultfile remove FILENAME: Remove a file from the vaultfile list: List all files in the vaultfile get FILENAME [--text|--path PATH|--tmp]: Retrieve a file
Binary Format
The .gpb lockbox format contains:
- Magic header: "GPMASTER"
- Version number
- GPG key ID (unencrypted)
- Metadata JSON with titles and note content (unencrypted)
- Signature (optional)
- Note signature (for signed note content)
- SHA256 checksum for integrity
- Encrypted secrets data
This design allows listing contents and viewing metadata without decryption.
Security Considerations
- The lockbox format stores secret titles and note content unencrypted
- Note content is signed by the lockbox owner to ensure authenticity
- Secret values are always encrypted with GPG
- Signatures are verified on every access when present
- Checksums prevent corruption and tampering
- Always validate your lockbox with
gpmaster validate
Dependencies
- Python 3.8+
- python-gnupg
- pyotp
- GnuPG
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpmaster-1.5.0.tar.gz
(45.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gpmaster-1.5.0-py3-none-any.whl
(31.3 kB
view details)
File details
Details for the file gpmaster-1.5.0.tar.gz.
File metadata
- Download URL: gpmaster-1.5.0.tar.gz
- Upload date:
- Size: 45.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2387d4163e918d5b7d0d84ecf5ebbd6071cddac48f771c7414ddc31e03d4a63
|
|
| MD5 |
f05d8bfc21d7202b41ae048a4df9aff2
|
|
| BLAKE2b-256 |
3be244c6263465e5df3d51c07b9441294d2342463d692d448e1a3e96ec4b4ced
|
File details
Details for the file gpmaster-1.5.0-py3-none-any.whl.
File metadata
- Download URL: gpmaster-1.5.0-py3-none-any.whl
- Upload date:
- Size: 31.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4c3018d31503a5655cd124e3ef7bba70916d370580656b8b512ad81f53b0a70
|
|
| MD5 |
94e5e855fd9cea4f5a330d3b20d73b08
|
|
| BLAKE2b-256 |
a917b3ba7c1a363200cf485fe7e56de41eb80080c96b0eab034e8d14dc772e80
|