Created
September 18, 2013 05:15
-
-
Save kirang89/6604833 to your computer and use it in GitHub Desktop.
Simple salting of a password using CSPRNG(Cryptographically Secure Pseudo-Random Number Generator)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import hashlib | |
def secure_password(password): | |
#This ensures that no two passwords have the same hash | |
salt = os.urandom(10) | |
return hashlib.sha256(salt + password).hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment