Skip to main content

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
  • 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-gnupg and pyotp
  • 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

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 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 lockboxes
  • GPMASTER_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 lockbox
  • add NAME [--totp] [--key-id KEY]: Add a secret
  • get NAME [--totp-code] [-i]: Retrieve a secret
  • rename OLD NEW: Rename a secret
  • delete NAME: Delete a secret
  • info: Show lockbox info and verify note signature
  • note: Edit notes document with $EDITOR (signed)
  • validate: Validate lockbox integrity and signature
  • rekey NEW_KEY_ID: Change encryption key
  • dump [--format {list,json,sh}]: Dump all secrets in various formats

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.1.2.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpmaster-1.1.2-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file gpmaster-1.1.2.tar.gz.

File metadata

  • Download URL: gpmaster-1.1.2.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for gpmaster-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d345f7c4fd7c6513976f86192e7ea5ac170b60934f1dd0f771c31547cc7eee36
MD5 efb87f3882a94ead6be1aa7bf80c7a46
BLAKE2b-256 b71440862509b8f382ad72d6769b42caa55901ccc33d2f97f83b1bb45305c9e3

See more details on using hashes here.

File details

Details for the file gpmaster-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: gpmaster-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for gpmaster-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6903057c75d54bf493a43b0d7f65836d9f7c85c03f6b56b393e999a0f2dfd898
MD5 081d23ae39b44e77d6493705087dd1f2
BLAKE2b-256 e63e881f5d48b38a80f2caec1abfd34af606ce95c90f1662401a29812d23f716

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page