This script allows you to securely store, retrieve, list, and delete passwords using encryption.
- Python 3
pip3
for installing Python packagescryptography
library
-
Download the Script: Save the
password_manager.py
script to your local machine. -
Install Python and Pip: Ensure Python 3 and
pip3
are installed on your system. -
Install
cryptography
Library: Usepip
to install thecryptography
library:pip install cryptography
To make it easier to use the password manager script, you can set up aliases and update your PATH. Follow these steps:
-
Open your shell configuration file:
- For
zsh
(default on macOS), open~/.zshrc
:nano ~/.zshrc
- For
bash
, open~/.bashrc
:nano ~/.bashrc
- For
-
Add the following configurations: Copy and paste the following lines into your shell configuration file:
# Pip config export PATH=$PATH:/usr/local/bin alias pip='pip3' alias py='python3' # Password manager alias password_manager='python3 /Users/CHANGEME/password_manager.py'
-
Save and close the file:
- In 'nano, press 'CTRL + X', then 'Y', and 'Enter'.
-
Reload the shell configuration:
- For 'zsh':
source ~/.zshrc
- For 'bash':
source ~/.bashrc
- Generate and Store a Password
py password_manager generate "Password Title" "YourPassword"
- Retrieve a Stored Passoword
py password_manager retrieve "Password Title"
- List All Stored Passwords
py password_manager list
- Delete a Stored Password
py password_manager delete "Password Title"
- To generate and store a password:
py password_manager generate "Email Password" "mypassword123"
- To list all stored passwords:
py password_manager retrieve "Email Password"
- To list all stored passwords:
py password_manager list
-
The script uses a master password to encrypt and decrypt the stored passwords.
-
Ensure you remember your master password, as you will need it to retrieve or delete stored passwords.
-
The passwords are stored in a JSON file named passwords.json in the same directory as the gitscript.