🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

password-hashing-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

password-hashing-python

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

0.3.0
PyPI
Maintainers
1

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

Keywords

password hashing pbkdf2

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts