A secure, local CLI-based password manager built in Go. Store and manage your passwords with military-grade encryption, all stored locally on your machine.
- π Strong Encryption: AES-256-GCM encryption with Argon2id key derivation
- π Master Password: Single master password protects all your credentials
- πΎ Local Storage: All data stored locally in
~/.vault.json - π Clipboard Integration: Automatic password copying to clipboard
- π― Interactive Mode: User-friendly command-line interface
- π Memory Safety: Sensitive data zeroed out after use to prevent memory leaks
- π Unique IDs: Cryptographically secure random IDs using nanoid
- Key Derivation: Argon2id with configurable parameters
- Time cost: 2 iterations
- Memory cost: 128 MiB
- Parallelism: 4 threads
- Output: 32-byte key
- Encryption Algorithm: AES-256-GCM (Galois/Counter Mode)
- Key Wrapping: Master password derives KEK (Key Encryption Key), which encrypts DEK (Data Encryption Key)
- Nonce: Unique 12-byte nonce for each encryption operation
- Salt: 16-byte random salt for key derivation
- Initialization: Master password β Argon2id β KEK β Encrypts DEK β Stores wrapped DEK
- Unlock: Master password β Argon2id β KEK β Decrypts DEK β Unlocks vault
- Entry Storage: Password β AES-GCM (using DEK) β Base64-encoded ciphertext
- Go 1.25.1 or higher
- Linux/macOS (clipboard support)
git clone <repository-url>
cd vault
go build -o vault ./cmd/main.go# Move to a directory in your PATH
sudo mv vault /usr/local/bin/Create a new vault with a master password:
vault initYou'll be prompted to create and confirm a master password.
Unlock the vault and enter interactive mode:
vault unlockOnce unlocked, you can use the following commands:
vault> add <site> <username>Example:
vault> add github.com john.doe
Enter entry password: ********
β
Entry added successfullyRetrieve an entry by ID or site name (password copied to clipboard):
vault> get <id/site>Example:
vault> get github.com
============================================================
Site: github.com
Username: john.doe
------------------------------------------------------------
π Password copied to clipboard.
============================================================Display all stored entries:
vault> list
============================================================
No. | ID | Site | Username
------------------------------------------------------------
1 | abc123 | github.com | john.doe
2 | def456 | gitlab.com | jane.smith
------------------------------------------------------------
Total entries: 2Delete an entry by ID:
vault> remove <id>Example:
vault> remove abc123
β
Entry removed successfully.Lock the vault and exit:
vault> lock
π Vault locked successfully.vault/
βββ cmd/
β βββ main.go # Main application entry point and CLI logic
βββ internal/
β βββ vault.go # Cryptographic operations (Argon2, AES-GCM)
β βββ io.go # File I/O and password input handling
β βββ type.go # Data structures (Vault, Entry)
βββ go.mod # Go module dependencies
βββ go.sum # Dependency checksums
βββ LICENSE # License file
βββ README.md # This file
- golang.org/x/crypto: Argon2 key derivation
- golang.org/x/term: Secure password input
- golang.design/x/clipboard: Clipboard operations
- github.com/sixafter/nanoid: Cryptographically secure ID generation
Vault data is stored in ~/.vault.json with the following structure:
{
"salt": "base64-encoded-salt",
"wrapped_dek": "base64-encoded-encrypted-dek",
"nonce_dek": "base64-encoded-nonce",
"version": "1.0.0",
"created_at": 1234567890,
"entries": [
{
"id": "abc123",
"site": "example.com",
"username": "user@example.com",
"password": "base64-encoded-encrypted-password"
}
]
}File Permissions: The vault file is created with 0600 permissions (read/write for owner only).
- Choose a Strong Master Password: Use a long, unique passphrase
- Keep Backups: Regularly backup
~/.vault.jsonto a secure location - Protect Your Master Password: Never share or write down your master password
- Secure Your System: Ensure your operating system is secure and up-to-date
- Lock When Done: Always lock the vault when finished
- No Cloud Sync: All data is stored locally
- Single User: Designed for single-user use
- No Password Recovery: If you forget your master password, data cannot be recovered
- Platform Support: Currently supports Linux/macOS (clipboard functionality)
go test ./...go build -o vault ./cmd/main.go- VaultService: Handles all cryptographic operations
- IOService: Manages file I/O and user input
- Interactive Mode: REPL-style interface for vault operations
See LICENSE file for details.
Contributions are welcome! Please ensure all security-related changes are thoroughly reviewed.
This is a personal password manager. While it uses industry-standard encryption, use at your own risk. Always maintain backups of your vault file.
