A simple command-line tool that checks if your passwords have been compromised using the Have I Been Pwned API. This tool helps users ensure their passwords are secure and encourages them to change compromised passwords.
- Check multiple passwords at once.
- Clear console output for better readability.
- Color-coded output indicating password security status.
- Python 3.x installed on your machine. You can download it from Python
requests
librarycolorama
library
You can install the required libraries using pip:
pip3 install requests colorama
pip3 install colorama
- Clone this repository:
git clone https://github.com/cainepavl/password_checker.git
cd password_checker
- Run the program with your passwords as command-line arguments:
python3 password_checker.py password1 password2 password3
... replace password1
, password2
, and password3
with the passwords you want to check.
For a SAFE password the output will be GREEN:
password123 was found 5 times...</span>
You should change it!</span>
For a COMPROMISED password the output will be RED:
mySecurePassword is good to go!
-
Password Hashing: The program takes each password, hashes it using SHA-1, and sends the first 5 characters of the hash to the Have I Been Pwned API.
-
API Response: The API returns a list of hashes that start with those 5 characters, allowing the program to check how many times the full password hash appears in the database.
-
Output: The program displays whether each password is compromised or secure, with color-coded messages for better visibility.
Contributions are welcome! If you have suggestions for improvements or features, feel free to create a pull request or open an issue.
This project is licensed under the MIT License - LICENSE see the file for details.
HAVE I BEEN PWNED for providing the API.
COLORAMA for terminal color formatting.
ZTM Academy for the course and walkthrough creating this site!
If you have any questions, feel free to contact me at [email protected]