argon2-cffi: Argon2 for Python#

Release 23.1.0 (What’s new?)

Argon2 won the Password Hashing Competition and argon2-cffi is the simplest way to use it in Python:

>>> from argon2 import PasswordHasher
>>> ph = PasswordHasher()
>>> hash = ph.hash("correct horse battery staple")
>>> hash  
>>> ph.verify(hash, "correct horse battery staple")
>>> ph.check_needs_rehash(hash)
>>> ph.verify(hash, "Tr0ub4dor&3")
Traceback (most recent call last):
argon2.exceptions.VerifyMismatchError: The password does not match the supplied hash

If you don’t know where to start, learn What is Argon2? and take it from there!

Indices and Tables#