A small Python 3 script to securely check passwords against https://haveibeenpwned.com/'s list of previously comprised passwords.
- Install the files
requirements.txt
in a Python 3 virtual environment withpip install requirements.txt
. - Start the script with
python main.py
.
The script hashes passwords locally and the API uses a k-anonimity model to check passwords against the compromised list, neither the password nor the full password hash ever leaves the machine where the script is running. The script itself is small(41 lines) to make it simple and fast to review.
Read more in I've Just Launched "Pwned Passwords" V2 With Half a Billion Passwords for Download by Troy Hunt or in the API docs.