I hashed a password through PHP and posted it to a DB. I want to check it in Python but I get TypeError: expected string or bytes-like object
To my understanding I'm supposed to specify that it's a 2b hash, but can't seem to figure out how to do that with a variable.
import mysql.connector
import bcrypt
mydb = mysql.connector.connect(
host = "localhost",
user = "root",
password = "",
port = "3307",
database = "registration"
)
cursor = mydb.cursor()
#username = input("Enter your username: ")
#password = input("Enter your password: ")
cursor.execute("select password from users where username = 'test'")
result = cursor.fetchall()
print (result)
password = "test"
bcrypt.checkpw(password.encode('utf8'),result)