A simple, secure command-line password manager written in C++ using OpenSSL AES-256-CBC encryption. Passwords are stored encrypted in ~/.ssh/password.enc.
- AES-256-CBC encryption via OpenSSL — all data encrypted at rest
- Two authentication modes: SSH private key (automatic) or master password
- Simple JSON storage — no external dependencies beyond OpenSSL
- Cross-platform: Linux native & Windows via MinGW cross-compilation
- Single binary — no runtime dependencies
- OpenSSL (libssl-dev / libcrypto)
- g++ with C++17 support
- For Windows cross-compile: mingw-w64 + OpenSSL compiled for MinGW
# Install dependencies
sudo apt-get install -y libssl-dev g++
# Compile
g++ -std=c++17 -O2 password.cpp -o password -lssl -lcrypto -static-libgcc -static-libstdc++# Install mingw-w64
sudo apt-get install -y mingw-w64
# Build OpenSSL for MinGW (one-time)
export OPENSSL_DIR=/usr/local/openssl-mingw64
./Configure mingw64 --prefix=${OPENSSL_DIR} --cross-compile-prefix=x86_64-w64-mingw32- no-shared
make -j$(nproc) && sudo make install
# Compile
x86_64-w64-mingw32-g++ -std=c++17 -O2 password.cpp -o password.exe \
-I${OPENSSL_DIR}/include -L${OPENSSL_DIR}/lib64 \
-lssl -lcrypto -static -static-libgcc -static-libstdc++ \
-lws2_32 -lcrypt32Go to the Releases page to download prebuilt binaries for:
password-linux-x86_64— Linux x86_64password-windows-x86_64.exe— Windows x86_64
# Add a password
./password add <keyword> <account> <password>
# Query password
./password get <keyword>
./password <keyword> # shortcut
# Update password
./password update <keyword> <account> <new_password>
# Delete a specific account
./password delete <keyword> <account>
# Delete an entire keyword
./password delete <keyword>
# List all keywords
./password list# Add GitHub credentials
./password add github myemail@example.com MyP@ssw0rd
# Add with special characters (use single quotes)
./password add server root 'p@ss/!special'
# Retrieve GitHub credentials
./password github
# or
./password get githubThis tool supports two authentication methods:
If ~/.ssh/id_ed25519 or ~/.ssh/id_rsa exists, the tool automatically uses it as the encryption key. No password prompt needed.
# Generate an SSH key if you don't have one
ssh-keygen -t ed25519If no SSH key is found, you'll be prompted to enter a master password each time.
- Key Derivation: The master key is derived from your SSH key (or entered password) using SHA-256.
- Encryption: Data is encrypted with AES-256-CBC. A random 16-byte IV is generated for each save.
- Storage:
IV + ciphertextis written to~/.ssh/password.enc.
- The password file is stored alongside your SSH keys in
~/.ssh/(permissions 0700 recommended). - Never share your SSH private key — anyone with it can decrypt the password vault.
- Consider backing up
~/.ssh/password.encif you store important credentials. - The tool does NOT have a password generator — use a strong, unique password for each account.
MIT