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.2.1.tar.gz
(39.6 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.2.1-py3-none-any.whl
(25.1 kB
view details)
File details
Details for the file gpmaster-1.2.1.tar.gz.
File metadata
- Download URL: gpmaster-1.2.1.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c571361cd66d81cb107beb2b7c0f2ade88aff9b9a2069743d25bd7ce3ef3440
|
|
| MD5 |
7ed64422d35c1bd475255b8b8cffb1cb
|
|
| BLAKE2b-256 |
14dab3ad46f0c561e38814e271da52fbc06bfea50fb59f53911e5101d4607e83
|
File details
Details for the file gpmaster-1.2.1-py3-none-any.whl.
File metadata
- Download URL: gpmaster-1.2.1-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfa64e7826364df57a8c613a243c90a36a0fa3822dce4f9e1e8541663af9431e
|
|
| MD5 |
7c76a446547cb1ed9526551cfa0d2b2d
|
|
| BLAKE2b-256 |
5dedd8e13c7ff99e830bd48c162e632c6fa4a1aa8c7b9f3fa84b9f6839d54f89
|