标签:常用 pass 加密 password nbsp new hex lib 字符串
1. imort hashlib
password = "11234"
2. salt2 = "aada".encode() #加盐编码字符串
3. result = hashlib.md5(password + salt2) #用md5加密
( result = hashlib.new("md5",password) 另一种new,不常用 )
4. print( result.hexdigest() ) 打印数据
print( result.digest() ) 打印二进制数据
5. result = hashlib.pdkdf2_hmac("md5",password,salt2,1000) #加密密码常用 1000为加密次数
标签:常用 pass 加密 password nbsp new hex lib 字符串
原文地址:https://www.cnblogs.com/cxhzy/p/9940959.html