A lightweight command-line password manager written in Python.
This project was developed and tested on Python 3.12.10 on Windows 11.
While it has not been thoroughly tested on Linux or macOS, it should function on all platforms due to the use of cross-platform libraries.
Warning: This application has no backup or recovery features. Use at your own risk.
- Installation
- Usage
- Features
- Menu Navigation
- Data Storage
- Security Features
- Important Security Notes
- Pre-Run Logging
- Log Files
- Troubleshooting
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activatepip install -r requirements.txtRequired packages
argon2-cffi— Secure master password hashingcryptography— Fernet encryption (AES-128)pyclip— Clipboard supportregex— Unicode-aware matching
Run the application:
python main.pyYou will be asked to create a master password that:
- Has ≥ 8 characters
- Contains uppercase, lowercase, digits, and special characters
Upon creation, the following files are generated in:
<USER_HOME>/PasswordManager
| File | Description |
|---|---|
master.key |
Argon2 hash of the master password (hidden) |
salt.bin |
Cryptographic salt (hidden) |
user_db.enc |
Encrypted password database |
pm_log.txt |
Application activity log |
You will be required to enter your master password. You have three attempts before the application exits.
- AES-128 Encryption using Fernet
- PBKDF2-HMAC-SHA256 key derivation (480k iterations)
- Argon2id master password hashing
- Password generator with strong entropy
- Clipboard auto-clear (10 seconds)
- Session-based logging
- Unicode support
- Best-effort secure memory wiping
- Hidden and read-only security files
=== Password Manager ===
1. Add Record
2. View Records
3. Edit Record
4. Exit
Fields:
-
Record name (required)
-
Username (optional)
-
Email (optional, validated)
-
Password
- Enter manually (must meet complexity requirements)
- OR auto-generate
-
URL (optional)
-
Notes (optional)
Password requirements
- ≥ 8 characters
- 1+ uppercase
- 1+ lowercase
- 1+ digit
- 1+ special character (
!@#$%^&*()_+{}[]:;"'<,>.?/~-)
-
Filter records (optional keyword)
-
Select record to view
-
Passwords are masked as
******** -
Option to copy password to clipboard
- Requires re-authentication
- Auto-clears after 10 seconds
Options:
- Update username
- Update email
- Update password (requires re-authentication)
- Update URL
- Update notes
- Rename record
- Delete record (requires re-authentication)
- Secure key wipe
- Graceful program shutdown
All data is stored in a hidden folder:
C:\Users\<USERNAME>\PasswordManager
~/PasswordManager
| File | Purpose | Security |
|---|---|---|
master.key |
Argon2 password hash | Hidden, Read-only |
salt.bin |
Cryptographic salt | Hidden, Read-only |
user_db.enc |
Encrypted DB | Encrypted |
pm_log.txt |
Logs (non-sensitive) | Standard file |
- Hashing using Argon2id
- Fernet (AES-128-CBC + HMAC)
- Key derived from PBKDF2-HMAC-SHA256 (480,000 iterations)
- Windows: Hidden + read-only
- Linux/macOS:
600permissions
- Max length limits
- Control-character filtering
- Email validation
- Unicode normalization
- Best-effort memory clearing
- Sensitive data zeroed before exiting
- Auto-clear after 10 seconds
- Background clearing thread
- Copying passwords
- Updating passwords
- Deleting records
If salt.bin is deleted or modified, your database becomes unrecoverable, even with the correct master password.
Key = PBKDF2(MasterPassword + Salt)
If the salt changes, the derived key changes → decryption becomes impossible.
Always back up:
salt.binuser_db.enc- Entire
PasswordManagerdirectory (recommended)
If forgotten:
- There is no recovery
- All stored credentials are lost
If user_db.enc becomes corrupted:
- The application will refuse to load it
- Data may be permanently lost
- Keep backups to avoid catastrophic loss
A pre-run log is generated only the first time the script is launched:
Location:
<script_directory>/pm_prerun.log.txt
Contains startup diagnostics helpful for debugging.
Location:
<USER_HOME>/PasswordManager/pm_log.txt
Format
YYYY-MM-DD HH:MM:SS | LEVEL | [SESSION_ID] LABEL | details
- Does not contain passwords, emails, or other sensitive values
- Uses generic labels (e.g., "record 1")
You're launching for the first time or deleted essential files. Create a new master password.
Likely:
- Modified salt
- Corrupted DB
→ Restore from backup (if no backup exists, data is unrecoverable).
Check:
pm_prerun.log.txt(startup issues)pm_log.txt(runtime issues)- Dependencies
- Disk space
Each run generates a random 8-character session ID used for log grouping.