bcrypt library
- Install
bcrypt
library from the command line:
pip install bcrypt
- Verify that password matches bcrypt hash:
import bcrypt
cost = 14
password = 'Hello'
passwordHash = '$2b$14$4Xq60qoHFfSNmcio3N2DzOOuqO0etK7t3qXyKvbPG.4xh24Zlh6Hq'
isValid = bcrypt.checkpw(password.encode('utf-8'), passwordHash.encode('utf-8'))
print(isValid)
Leave a Comment
Cancel reply