argon2-cffi library
- Install
argon2-cffi
library from the command line:
pip install argon2-cffi
- Verify that password matches Argon2i hash:
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
ph = PasswordHasher()
password = 'Hello'
passwordHash = '$argon2i$v=19$m=65536,t=4,p=2$bXVoQnQzaG44SmNBdGozVg$EZnL39Yuww+IEs03LX1M48K9lz8XvXgD9uWsIbmh27E'
try:
isValid = ph.verify(passwordHash, password)
except VerifyMismatchError:
isValid = False
print(isValid)
Leave a Comment
Cancel reply