A command-line password manager that securely stores credentials. It generates a strong encryption key, encrypts your passwords using Fernet (symmetric encryption), and saves them locally. You must provide the correct master key to retrieve and decrypt your passwords.
57-password-manager/
manager.py # Main CLI application
requirements.txt # Python dependencies
README.md # This file
pip install -r requirements.txtpython manager.py generate-keySave the generated key file (secret.key) in a safe place. If you lose it, you lose access to all your passwords.
python manager.py add --service GitHub --username octocat --password supersecret123python manager.py get --service GitHub- Symmetric Encryption using the
cryptography.fernetmodule - Key generation and secure file storage
- Command-line parsing with Python's built-in
argparse - Secure data serialization via JSON files
- Handling
InvalidTokenexceptions for incorrect keys
You will learn how to apply real-world cryptography to protect sensitive user data. You'll understand the importance of encryption keys, how symmetric encryption works, and how to build a robust CLI tool for managing local secrets.
$ python manager.py generate-key
Key generated and saved to secret.key. Keep it safe!
$ python manager.py add --service Gmail --username myemail@gmail.com --password "P@ssw0rd!"
Successfully added credentials for Gmail.
$ python manager.py get --service Gmail
Service: Gmail
Username: myemail@gmail.com
Password: P@ssw0rd!