Skip to main content

Pwned Passwords

Project description


Have my passwords been compromised?

Latest Version




PwnedPwd is a tiny CLI tool which uses the online service Pwned Passwords to check whether a given password have been compromised in known data breaches. Credits to Troy Hunt for hosting such service.

How it works?

Given the input password, this tool will

  • hash it using SHA-1 algorithm, resulting in a 40-characters hexadecimal string
  • Use the first 5 characters from the generated string to query the online service
  • The online service returns a list of all matching hashes for the given prefix
  • Verify if your SHA-1 hash is present in the response

For instance, given an input password P@ssword

  • SHA-1 hash is 9E7C97801CB4CCE87B6C02F98291A6420E6400AD
  • The first 5 characters are 9E7C9
  • We query the online service using GET
  • The online service returns a list of all matching hashes (777 hashes for this example):
  • We verify that 7801CB4CCE87B6C02F98291A6420E6400AD is present and have 10848 occurrences in data breaches

About Pwned Passwords

Extracted from their website:

Pwned Passwords are more than half a billion passwords which have previously been exposed in data breaches. The service is detailed in the launch blog post then further expanded on with the release of version 2. The entire data set is both downloadable and searchable online via the Pwned Passwords page. In order to protect the value of the source password being searched for, Pwned Passwords also implements a k-Anonymity model that allows a password to be searched for by partial hash.

Detailed information can be found


$ [sudo] pip install pwnedpwd


$ pwnedpwd
Password: ******
[GOOD] Password is not present in any known data breach. (source
$ pwnedpwd
Password: 12345
[BAD] Password appeared 2570791 times in data breaches. (source

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pwnedpwd-0.1.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

pwnedpwd-0.1.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page