Skip to main content

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

Metadata

Release files for HIBP-checker 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for HIBP-checker 1.0
File Size Uploaded Provenance
hibp_checker-1.0.tar.gz 17.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for HIBP-checker 1.0
File Interpreter ABI Platform
hibp_checker-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / hibp_checker-1.0.tar.gz

Download URL hibp_checker-1.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
359c3184024d8f99e4936426d9608b7589908ed6350b8731404c83af1f2a2773
BLAKE2b-256 checksum
How to use checksums
abce0d3a09739353483241993e3cb733e256a1ea0ffde368b620bce3c40192b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / hibp_checker-1.0-py3-none-any.whl

Download URL hibp_checker-1.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
452e343bf148426d5cb4f1386c53b3b2b00717cde0b0838615b0362771c534c8
BLAKE2b-256 checksum
How to use checksums
7816b676199b178870732afa49701a6e0d3c4c93955432eb24ccaee586ae7f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for HIBP-checker 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page