Have I Been Pwned Checker
Check whether a password (hash) is present in the Have I Been Pwned database.
This uses HIBP's k-anonymity scheme to protect the anonymity of the passwords over the wire. More info on this k-anonymity scheme can be found in Troy Hunt's blog post
Usage
Clone the repository and go to the application directory
$ git clone https://github.com/TheGroundZero/HIBP-checker.git
$ cd HIBP-checker/src/hibp_checker
Pass -h as a parameter to get the help info.
$ python hibp_checker.py -h
usage: HIBP checker [-h] -f FILEPATH [-s] [-i]
Check if a password (hash) is present in the HIBP database
optional arguments:
-h, --help show this help message and exit
-f FILEPATH, --file FILEPATH
File path to password list
-s, --sha1 Provided password are already (SHA1) hashed? (default:
False)
-i, --inplace Modify [FILE] to append results to each line?
(default: False)
Provide password list with passwords in plain-text.
$ python hibp_checker.py -f passwords.lst
+ Found matching entry on HIBP for 'P@ssw0rd'. It has occurred 51259 times.
+ Found matching entry on HIBP for 'password'. It has occurred 3645804 times.
+ Found matching entry on HIBP for 'abcdef'. It has occurred 178998 times.
+ Found matching entry on HIBP for '123456789'. It has occurred 7671364 times.
+ Found matching entry on HIBP for 'monkey'. It has occurred 980209 times.
+ Found matching entry on HIBP for 'hunter2'. It has occurred 17043 times.
- Found no matching entry on HIBP for 'Tr0ub4dor&3'. It has occurred 0 times.
+ Found matching entry on HIBP for 'correcthorsebatterystaple'. It has occurred 114 times.
You can run this project as a module as well.
$ python -m hibp_checker -f passwords.lst
Provide password list with passwords hashed using SHA1.
$ python -m hibp_checker -f passwords-hashes.lst -s
+ Found matching entry on HIBP for '21BD12DC183F740EE76F27B78EB39C8AD972A757'. It has occurred 51259 times.
+ Found matching entry on HIBP for '5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8'. It has occurred 3645804 times.
+ Found matching entry on HIBP for '1F8AC10F23C5B5BC1167BDA84B833E5C057A77D2'. It has occurred 178998 times.
+ Found matching entry on HIBP for 'F7C3BC1D808E04732ADF679965CCC34CA7AE3441'. It has occurred 7671364 times.
+ Found matching entry on HIBP for 'AB87D24BDC7452E55738DEB5F868E1F16DEA5ACE'. It has occurred 980209 times.
+ Found matching entry on HIBP for 'F3BBBD66A63D4BF1747940578EC3D0103530E21D'. It has occurred 17043 times.
- Found no matching entry on HIBP for '874572E7A5AE6A49466A6AC578B98ADBA78C6AA6'. It has occurred 0 times.
+ Found matching entry on HIBP for 'BFD3617727EAB0E800E62A776C76381DEFBC4145'. It has occurred 114 times.
Update password file with results.
$ python hibp_checker.py -f examples/passwords-inplace.lst -i
$ cat examples/passwords-inplace.lst
+:P@ssw0rd:51259
+:password:3645804
+:abcdef:178998
+:123456789:7671364
+:monkey:980209
+:hunter2:17043
-:Tr0ub4dor&3:0
+:correcthorsebatterystaple:114
Installation
This package is available as a PyPi package. You can install it via pip.
$ pip install HIBP-checker
Then you can run it as an installed application.
$ hibp -f passwords.lst
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hibp_checker-1.0.tar.gz.
File metadata
- Download URL: hibp_checker-1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
359c3184024d8f99e4936426d9608b7589908ed6350b8731404c83af1f2a2773
|
|
| MD5 |
577b7ee195caa54b463f93722f418f7a
|
|
| BLAKE2b-256 |
abce0d3a09739353483241993e3cb733e256a1ea0ffde368b620bce3c40192b1
|
File details
Details for the file hibp_checker-1.0-py3-none-any.whl.
File metadata
- Download URL: hibp_checker-1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452e343bf148426d5cb4f1386c53b3b2b00717cde0b0838615b0362771c534c8
|
|
| MD5 |
ff3916831fdc6bf8761bf52e020242c5
|
|
| BLAKE2b-256 |
7816b676199b178870732afa49701a6e0d3c4c93955432eb24ccaee586ae7f05
|