argon2_cffi¶
Release v16.0.0 (What’s new?).
Argon2 won the Password Hashing Competition and argon2_cffi
is the simplest way to use it in Python and PyPy:
>>> from argon2 import PasswordHasher
>>> ph = PasswordHasher()
>>> hash = ph.hash("secret")
>>> hash
'$argon2i$m=512,t=2,p=2$c29tZXNhbHQ$2IdoNVglVTxb9w4YVJqW8w'
>>> ph.verify(hash, "secret")
True
>>> ph.verify(hash, "wrong")
Traceback (most recent call last):
...
argon2.exceptions.VerificationError: Decoding failed
argon2_cffi
’s documentation lives at Read the Docs, the code on GitHub.
It’s rigorously tested on Python 2.6, 2.7, 3.3+, and PyPy.