shy327o

Untitled

Sep 25th, 2015
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. import os
  2. import hashlib
  3.  
  4. def Main():
  5.  
  6. foods = ["username:", " \nPassword:", " \nConfpassword:"]
  7.  
  8. newU=str(raw_input("Username: "))
  9.  
  10. Password=str(raw_input("Password: "))
  11. hash_object = hashlib.md5(Password.encode())
  12. Password=hash_object.hexdigest()
  13.  
  14.  
  15. Confpassword=str(raw_input("Password Again: "))
  16. hash_object2 = hashlib.md5(Confpassword.encode())
  17. Confpassword=hash_object2.hexdigest()
  18.  
  19. if Password!=Confpassword:
  20. while Password!=Confpassword:
  21. print("not match try again")
  22. newp=str(raw_input("again: "))
  23. newp=hashlib.md5(newp.encode())
  24.  
  25. if newp.hexdigest()==hash_object.hexdigest():
  26. print("match")
  27. pass
  28. foods.insert(1,newU)
  29. foods.insert(3,hash_object.hexdigest())
  30. foods.insert(5,newp.hexdigest())
  31. with open("text.t" ,"w") as f:
  32. for word in foods:
  33. f.write(word)
  34.  
  35.  
  36. else:
  37.  
  38. #foods[0]=newf
  39. foods.insert(1,newU)
  40. foods.insert(3,hash_object.hexdigest())
  41. foods.insert(5,hash_object2.hexdigest())
  42. with open("text.t" ,"w") as f:
  43. for word in foods:
  44. f.write(word)
  45.  
  46.  
  47.  
  48. if __name__ == '__main__':
  49. Main()
Advertisement
Add Comment
Please, Sign In to add comment