Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import hashlib
- def Main():
- foods = ["username:", " \nPassword:", " \nConfpassword:"]
- newU=str(raw_input("Username: "))
- Password=str(raw_input("Password: "))
- hash_object = hashlib.md5(Password.encode())
- Password=hash_object.hexdigest()
- Confpassword=str(raw_input("Password Again: "))
- hash_object2 = hashlib.md5(Confpassword.encode())
- Confpassword=hash_object2.hexdigest()
- if Password!=Confpassword:
- while Password!=Confpassword:
- print("not match try again")
- newp=str(raw_input("again: "))
- newp=hashlib.md5(newp.encode())
- if newp.hexdigest()==hash_object.hexdigest():
- print("match")
- pass
- foods.insert(1,newU)
- foods.insert(3,hash_object.hexdigest())
- foods.insert(5,newp.hexdigest())
- with open("text.t" ,"w") as f:
- for word in foods:
- f.write(word)
- else:
- #foods[0]=newf
- foods.insert(1,newU)
- foods.insert(3,hash_object.hexdigest())
- foods.insert(5,hash_object2.hexdigest())
- with open("text.t" ,"w") as f:
- for word in foods:
- f.write(word)
- if __name__ == '__main__':
- Main()
Advertisement
Add Comment
Please, Sign In to add comment