This console application is a simple password manager that allows users to securely store, retrieve, and manage their credentials. It uses AES encryption to protect the stored data and provides a console interface for interacting with the credentials.
- Features
- Main Execution
- Dependencies
- Usage
- File Structure
- Encryption Details
- Code Analysis
- Acknowledgments
- Store and manage credentials securely using AES encryption.
- Retrieve and display stored credentials.
- Modify and delete existing credentials.
- User-friendly console interface with colored text for better readability.
- Secure login with a main password to access the credential database.
- Displays a title screen.
- If the credentials file doesn't exist, it runs the
signin()
function. - Prompts the user to log in with the main password.
- Provides a main menu to search, add, modify, or delete credentials, or to quit the program.
The script requires the following Python packages:
json
: For handling JSON data.tabulate
: For displaying data in a tabular format.hashlib
: For SHA-256 hashing.pycryptodome
: For AES encryption and decryption.
If any of these packages is missing, the program will automatically install them for you the frst time you run it
-
Initial Setup:
- The first time you run the script, it will prompt you to set a main password. This password is used to protect all your other credentials.
-
Login:
- Each time you run the script after the initial setup, you will need to enter the main password to access the credential database.
-
Main Menu:
- After logging in, you will be presented with the following options:
- Search existing credentials.
- Add new credentials.
- Modify existing credentials.
- Delete existing credentials.
- Quit the program.
- After logging in, you will be presented with the following options:
-
Managing Credentials:
- Follow the on-screen prompts to add, search, modify, or delete credentials. Credentials are stored in a JSON file with encryption.
- credentials_file: The JSON file used to store encrypted credentials. By default, the file name is
credentials.i_just_discovered_i_can_give_whatever_file_extension_i_want
.
- AES Encryption: The script uses AES encryption (CBC mode) to protect the credentials.
- SHA-256 Hashing: The main password is hashed using SHA-256 to verify user identity.
A class containing ANSI escape sequences for colored console output.
Hashes a given text using SHA-256 and returns the hexadecimal digest.
Saves new credentials to the database, encrypting the name of the service, username, and password.
Encrypts plaintext using AES encryption with the given key bytes.
Prompts the user to set a main password during the initial setup and saves it to the credentials file.
Loads and returns existing still encrypted credentials from the credentials file.
Displays stored credentials and prompts the user to select one for further actions.
Modifies existing credentials in the database with new values.
Decrypts an encrypted string using AES decryption with the given key bytes.
Prompts the user to enter the main password to access the credential database.
Utility function to delete a specified number of lines from the console output for a better experience.
- Special thanks to AKX on StackOverflow for assistance with the
encrypt_data()
anddecrypt_data()
functions. - Color codes for console text are based on a solution from StackOverflow.
If there's something wrong with this readme file blame chatGPT