Advertisement
7a_

Iterated salted hash function example in Python

7a_
Jun 26th, 2012
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. def GetHash(Password, SystemSalt, UserSalt):
  2.     """
  3.    Created By Abraham Aranguren <name.surname@gmail.com> Twitter: @7a_ http://7-a.org
  4.    Iterates a salted hash function for secure password storage
  5.    Please see this link for more info: http://owasp.com/index.php/Password_Storage_Cheat_Sheet
  6.    """
  7.     Hash = Password
  8.     for i in range(1000000):
  9.         Hash = sha512(Hash + SystemSalt + UserSalt + str(i))
  10.     return Hash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement