Skip to main content

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

Metadata

Release files for password-hashing-python 0.3.0

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

Built distribution (wheel)

Table of built distributions (wheels) for password-hashing-python 0.3.0
File Interpreter ABI Platform Actions
password_hashing_python-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for password_hashing_python-0.3.0-py2.py3-none-any.whl

Release files / password_hashing_python-0.3.0-py2.py3-none-any.whl

Download URL password_hashing_python-0.3.0-py2.py3-none-any.whl
Size 3.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
540498a62c49b55c140535ffa0fbce6293777af01dbd7cec6c45bc1afd7e3379
BLAKE2b-256 checksum
How to use checksums
05468248d0684afc7139be570fdcddca19ef8cbc77acd1f1cc9da0458f188a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for password-hashing-python 0.3.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.

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