Password generator & vault #23
CLI Vault Tool Implementation
Overview
I've implemented a CLI tool for generating and securely storing (by encrypting) service credentials. The tool provides only the most basic functional, but I have some further to expand the project.
Features
- Add new entries with customizable parameters
- Delete existing entries
- List entries with:
- Exact service name matching
- Regex pattern matching
- Secure password/pin generation with cryptography module
- All the credentials are decrypted before storing in JSON file
Implementation Structure
File | Responsibility |
---|---|
main.py |
CLI interface and command processing |
vault.py |
Core vault logic and storage |
password.py |
Secure password/pin generation |
Usage Examples
Adding Entries
python3 vault.py add --service GitHub --username rastr --length 16 --type password
python3 vault.py add --service GitLab --username rastr --length 16 --type password
Listing Entries by specific name
python3 main.py list-entries --search GitLab
------------------------------------------
GitLab: username: rastr | secret: [N'}SS}.mvQK;C\"
Pattern matching
python3 main.py list-entries --search git*
------------------------------------------
GitLab: username: rastr | secret: [N'}SS}.mvQK;C\"
GitHub: username: rastr | secret: =;BU1o$v,Se*'"cE