Skip to main content

Check passwords against HaveIBeenPwnd

Project description

# python bindings for V2 [![Build Status](]( [![PyPi Version](](![Python versions](

Troy Hunt released a new version of the Have I Been pwnd Database. This time with more anonymity in mind.

## Features:

  • does not sent passwords to
  • does not sent complete password hashes to
  • zero dependencies except requests (will be removed later)
  • python2 & python3 support
  • tests

## Usage:

You can use HaveIBeenPwnd als command line script or use it as module in other python code.

### As command line script

Install HaveIBeenPwnd gobally or in a virtual environment:

$ pip install haveibeenpwnd

This add shortcuts to haveibeenpwnd, so that you call haveibeenpwnd from everywhere. To check a password, simply do this:

$ haveibeenpwnd –password hunter2 The password was found 16092 times in the database.

Remember, haveibeenpwnd does not send the given password into the internet, it sends the first 5 chars of the SHA1 Hash.

To check if a mail has been part of a breach, do this:

$ haveibeenpwnd -m The email <> was found in following breaches: The <000webhost> breach (2015-03-01) exposed Email addresses, IP addresses, Names and Passwords The <8tracks> breach (2017-06-27) exposed Email addresses and Passwords …

### As module

Check emails:

>>> from haveibeenpwnd import check_email
>>> check_email(""))
>>> check_email("")
{'breaches': [{'Title': '000webhost', ...}]}

and check passwords:

>>> from haveibeenpwnd import check_password
>>> check_password('hunter2')
>>> check_password('lksdflksdpsökfdsödg')

## Installation

You can install haveibeenpwnd with pip:

$ pip install haveibeenpwnd

## Testing:

You can run tests with:

$ tox

Project details

Download files

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

Files for haveibeenpwnd, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size haveibeenpwnd-0.2.0.macosx-10.9-x86_64.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View
Filename, size haveibeenpwnd-0.2.0-py2.py3-none-any.whl (6.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page