PyMenuSite/hash.py
2023-02-11 14:37:10 +01:00

27 lines
743 B
Python

import bcrypt
# Declaring our password
password = b'GeekPassword'
# Adding the salt to password
salt = bcrypt.gensalt()
# Hashing the password
hashed = bcrypt.hashpw(password, salt)
print(salt)
print(type(hashed))
salt = hashed[:29]
print(salt)
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))
print(password == bcrypt.hashpw(password, salt))