A security-focused, fully offline command-line password manager written in modern C++.
PWMGR is designed around one principle:
Keep your secrets local, encrypted, and under your control.
No cloud services. No telemetry. No background daemons.
Beta version now available with more security options, stable is recommended but beta has more security options (just need to test and audit it)
- ๐ AES-256-GCM authenticated encryption
- ๐ง Argon2id memory-hard key derivation
- ๐ Optional external keyfile authentication
- ๐พ Unlock your vault using a USB drive, SD card or other removable media
- ๐ก Process hardening (anti-ptrace & core dump protection)
- ๐งผ Secure memory locking and automatic zeroisation
- ๐ Fuzzy search (Levenshtein distance)
- ๐ Clipboard support with automatic clearing
- ๐ Cryptographically secure password generation
- ๐ฅ Interactive shell with automatic locking
- ๐ฆ Binary encrypted vault format
- ๐ฅ Atomic vault writes with crash recovery
- ๐ Master password changing
- ๐ค Plaintext export
Interactive shell mode:
- Linux
- C++17 compatible compiler
- OpenSSL
- Argon2
Debian / Ubuntu:
sudo apt install libssl-dev libargon2-devCompile:
makeInstall system-wide:
sudo make installRun locally:
./pwmgror
pwmgrpwmgr <command>init Create a new encrypted vault
add Add a password entry
list List stored entries
get <name> Retrieve an entry
delete <name> Delete an entry
update <name> Update an existing entry
search <term> Fuzzy search entries
generate [len] [-n] Generate a secure password
genkeyfile Generate an external authentication keyfile
passwd Change the master password
export Export the vault as plaintext
shell Launch the interactive shell
PWMGR supports an optional second authentication factor using an external keyfile.
Generate a keyfile:
pwmgr genkeyfileStore the generated keyfile somewhere off the computer, for example:
- USB Flash Drive
- SD Card
- External SSD
When unlocking the vault, provide the keyfile using the PWMGR_KEYFILE environment variable:
PWMGR_KEYFILE=/path/to/pwmgr.keyfile ./pwmgr shellExample:
PWMGR_KEYFILE=/media/xyt564/128GB-USB/pwmgr.keyfile ./pwmgr shellThe contents of the keyfile are mixed directly into the Argon2id key derivation process.
This means an attacker must possess both your master password and your keyfile in order to decrypt the vault.
The keyfile is never stored inside the vault and should remain on removable media except when required for unlocking.
| Layer | Implementation |
|---|---|
| Encryption | AES-256-GCM |
| Key Derivation | Argon2id |
| Authentication | 16-byte GCM Tag |
| Header Protection | Authenticated Additional Data (AAD) |
| Optional Second Factor | External Keyfile |
| Memory Protection | SecureString / SecureVector + mlock |
| Process Hardening | Anti-ptrace & Core Dump Protection |
| Vault Storage | Binary encrypted format |
| Write Strategy | Atomic writes + fsync() |
| Brute-force Protection | Exponential retry delay |
This release focuses on significantly improving PWMGR's security, reliability and maintainability.
- Added the
genkeyfilecommand. - Added optional external keyfile authentication.
- Keyfile data is mixed directly into the Argon2id key derivation process.
- Added automated smoke testing for the core vault workflow.
- Hardened the running process to prevent debugger attachment and disable core dumps.
- Replaced the old locked buffer with dedicated SecureString and SecureVector containers.
- Removed the remaining use of
std::stringfor passwords and cryptographic secrets. - Fixed a password input issue that could leave plaintext copies in heap memory.
- Clipboard operations no longer create unnecessary plaintext password copies.
- Improved secure cleanup throughout the application so secrets are reliably erased during shutdown and error handling.
- Fixed password cleanup during regenerated password updates.
- Added a controlled
reveal()interface to minimise accidental exposure of protected secrets.
- Vault files are now written atomically using temporary files,
fsync()andrename(), preventing corruption after crashes or power failures. - Secure
0600permissions are applied immediately when vault files are created. - Improved filesystem durability by synchronising updates before replacing vault data.
- Added validation of vault ownership and protection against symlink-based attacks.
- Improved command-line input validation.
- Improved case-insensitive string handling.
- Reduced unnecessary cryptographic key material generation.
- Refactored secure memory handling to simplify maintenance.
- Cleaned up compiler warnings.
- Improved overall code quality and maintainability.
Vault:
~/.pwmgr_vault
Failed attempt counter:
~/.pwmgr_attempts
PWMGR helps protect against:
- Offline brute-force attacks
- GPU/ASIC password cracking
- Vault tampering
- Password remnants remaining in memory
- Process inspection through ptrace
- Core dump leakage
- Accidental corruption caused by crashes or power failures
PWMGR does not protect against:
- Malware running on the host system
- Keyloggers
- Root/system compromise
- Clipboard interception during the exposure window
- Physical theft of both the computer and optional keyfile
Planned features include:
- ๐ FIDO2 / Security Key support
- ๐ TPM 2.0 integration
- ๐ Hardware-backed second-factor providers
- ๐งช Expanded automated testing
PWMGR is built to be:
- Secure
- Minimal
- Fully Offline
- Transparent
- Auditable
- Hardened
- Lightweight
- Easy to Build
Please see SECURITY.md for responsible vulnerability disclosure guidelines.
See LICENSE for the full license text.
The ASCII banners displayed by PWMGR were generated using AI. All application logic, cryptography, security features and implementation were written manually. AI was only used to generate the decorative terminal banners.
