A simple password manager that allows users to store and retrieve passwords for various websites. The passwords are stored in a JSON file and can be accessed through a command-line interface.
- Store passwords securely in a JSON file.
- Retrieve stored passwords.
- Simple command-line interface.
- Clone the repository:
git clone https://github.com/Fedi6431/PasswordManager.git
- Navigate to the project directory:
cd PasswordManager
- Run the script:
python password_manager.py
- Follow the on-screen instructions to add or retrieve passwords.
load_passwords(filename): Loads existing passwords from a JSON file.save_passwords(passwords, filename): Saves passwords to a JSON file.add_password(passwords, website, username, password): Adds a new password to the dictionary.get_password(passwords, website): Retrieves a password from the dictionary.
The main loop provides a command-line interface for users to interact with the password manager. Users can choose to add a new password, retrieve a stored password, or quit the application.
# Example usage
password_file = "passwords.json"
passwords = load_passwords(password_file)
# Add a new password
add_password(passwords, "example.com", "user123", "password123")
save_passwords(passwords, password_file)
# Retrieve a password
stored_password = get_password(passwords, "example.com")
print(stored_password)Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
For any questions or suggestions, please contact Fedi6431.