Advertisement
Peaser

Password Hash Salt Example

Aug 20th, 2014
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import hashlib, os, getpass
  2.  
  3. password = getpass.getpass("Please enter a password.")
  4. salt = os.urandom(32) #Salt appended to hash
  5. crypted_data = password+salt
  6. crypted_hash = hashlib.sha1(crypted_data).hexdigest()
  7. print crypted_hash
  8.  
  9. raw_input("Press any key to continue...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement