Please recommend some Python hashing algorithms [closed]
I'm doing a password hashing program in python. I need to make my hashing dynamic, i.e. each time I need to get different hashed code. I am using md5 library.
The information that you want can be found in Python's hashlib module. From the documentation:
This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321). The terms secure hash and message digest are interchangeable. Older algorithms were called message digests. The modern term is secure hash.
You can use salt
for that.
import hashlib
string = "password"
strsalt = "anyrandomvalue" #this can be generated.. etc.
hashlib.md5(string + strsalt).hexdigest()
精彩评论