So I have to hash a user entered password and then write the hashed password to a file. The code I have puts the clear text password into the file not the hash.
This is my code for my function
This is my code for my function
import hashlib def writeHashedPswd(password): # try: myhash = hashlib.md5(password) myfile = open("password.txt", "w") myfile.write(password + '/n') password = myhash.hexdigest() myfile.close() myfile = open("password.txt", "a") myfile.write("an error occured.") myfile.close()Code for program file
import a8 password = raw_input('Enter your password: ') a8.writeHashedPswd(password)What am I missing? Thanks!