A modular, command-line interface (CLI) password utility built to bridge the gap between basic scripting and secure software architecture. This project moves away from standard "tutorial" habits by implementing cryptographically secure character selection, multi-file modularity, and memory-safe data decryption.
- Multi-File Modularity: Split cleanly into
generator.py(core logic engine) andmain.py(user interface) to enforce separation of concerns. - Cryptographically Secure: Replaced the standard pseudo-random
randommodule with Python's built-insecretsmodule to generate truly unpredictable tokens. - Shoulder-Surfing Protection: Passwords are fully obfuscated using Base64 encoding before hitting the local file system (
passwords.txt). - RAM-Only Decryption: To eliminate permanent storage footprints, saved credentials are read, decoded, and held strictly in volatile system memory (RAM) during viewing, disappearing safely upon program termination.
- Defensive Error Handling: Built custom input sanitization routines and comprehensive
try/exceptloops to capture type errors and handle user input gracefully.
├── generator.py # Backend engine (generation, encoding, RAM-decoding, File I/O)
├── main.py # Frontend CLI controller (menus, loops, validation, user prompts)
└── passwords.txt # Persistent storage (auto-generated, contains encoded credentials)
- File I/O Optimization: Utilizing context managers (
with open()) to guarantee safe file closures and using append mode ("a") to prevent data overwrites. - List Comprehensions: Streamlining random selection routines with highly optimized, single-line Python loops.
- Input Sanitization: Applying string manipulation methods (
.strip().lower()) natively across input streams to maintain state integrity despite user typos. - Decoupled Module Imports: Using
if __name__ == "__main__":boilerplate boundaries to ensure clean execution workflows when scripts act as standalone utilities or imported libraries.
- Open your terminal in the project directory.
- Execute the controller script:
python main.py- Follow the interactive prompts to generate secure keys or view your temporary, memory-loaded password cache.