Last active
August 29, 2015 14:05
-
-
Save stephnr/9103424adf8566b63c39 to your computer and use it in GitHub Desktop.
Python Password Encryption using Passlib -- https://pythonhosted.org/passlib/index.html
This file contains 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
from passlib.hash import sha256_crypt | |
# Create Encrypted Password | |
hash = sha256_crypt.encrypt("super_secret_password") | |
# Verify Encrypted Password | |
sha256_crypt.verify("super_secret_password", hash) |
This file contains 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
# Create Encrypted Password | |
hash = md5_crypt.encrypt("super_secret_password") | |
# Verify Encrypted Password | |
md5_crypt.verify("super_secret_password", hash) |
This file contains 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
// Generate random password | |
Math.random().toString(36).substr(2,7); // return some of "kj8c7t0" |
This file contains 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
# Create Encrypted Password | |
hash = sha512_crypt.encrypt("super_secret_password") | |
# Verify Encrypted Password | |
sha512_crypt.verify("super_secret_password", hash) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment