Skip to main content

Python implementation of https://github.com/defuse/password-hashing (v1.0)

Project description

password-hashing-python

Build Status Coverage Status PyPI version

Python implementation of https://github.com/defuse/password-hashing (v1.0)

Supports both Python >=v2.7.9 and >=3.4.

Please note, this code has not been scrutinized or peer-reviewed at all - though I'm interested, if anyone wants to look it over.

It is a naive attempt to re-implement PasswordHash.php.

Installation

pip install password-hashing-python

Usage

Creating a hash-string

>>> import password_hashing
>>> _hash = password_hashing.create_hash('your_password')
>>> print _hash
b'sha1:64000:18:B6oWbvtHvu8qCgoE75wxmvpidRnGzGFt:R1gkPOuVjqIoTulWP1TABS0H'
>>> # snip: save `_hash` to a DB

Validating the password

>>> # snip: retrieve `_hash` from DB
>>> import password_hashing
>>> password_hashing.validate_password('your_password', _hash)
True
>>> password_hashing.validate_password('wrong_password', _hash)
False

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

password_hashing_python-0.3.0-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file password_hashing_python-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for password_hashing_python-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 540498a62c49b55c140535ffa0fbce6293777af01dbd7cec6c45bc1afd7e3379
MD5 ba5d7a9dca0ba8cfce34543a39f6053b
BLAKE2b-256 05468248d0684afc7139be570fdcddca19ef8cbc77acd1f1cc9da0458f188a72

See more details on using hashes here.

Supported by

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