I'm trying to do a simple login system with python that will check the hash (sha256) of a password a then let the user in, but is not working. I've tried many different forms of doing so, but this is the best one I could come up.
import hashlib
username = input("Enter username: ")
password = input("Enter password: ")
#hashing password
password = hashlib.sha256(password.encode())
t_hash = password.hexdigest()
print(t_hash)
if username == "kent" and password == "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3":
print("Clark Kent logged!")
else:
print("Wrong credentials")
As expected it is not working and I don't know what I'm missing. Can anybody help me?
