Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- # the Pre-hashed password is 'dave'
- userPassword = input("Enter user password > ").encode("utf-8")
- PreSalt = "fishes".encode("utf-8")
- print("Hashing Password")
- newHash = hashlib.sha1()
- newHash.update(userPassword + PreSalt)
- hashedPassword = str(newHash.hexdigest())
- print ("This is the hashed Password = '" + str(newHash.hexdigest()) + "'")
- preHashedPassword = "3b0acbcffbcaf692b83d218077e279bb41c921b8"
- print ("This is the Pre hashed Password = '" + str(preHashedPassword) + "'\nChecking the password with the one stored.")
- if (preHashedPassword == hashedPassword):
- print ("These Match!")
- print ("Authenticated!")
- else:
- print ("These don't match!")
- print ("Authentication Failed")
- #print (len(hashedPassword))
- # Made by Aidan Crane, No credit needed for non-commercial use, otherwise credit plz :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement