加密

import hashlib
# import md5 #python2里面
#md5

# password='abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123'
# # print(password.encode()) #bytes
# m = hashlib.md5(password.encode())
# print(m.hexdigest())

#md5加密是不可逆的


#撞库

#123456 e99a18c428cb38d5f260853678922e03
#abc123 e99a18c428cb38d5f260853678922e03
#123321 e99a18c428cb3815f260853678922e03
#123456789 e99a18c428cb3815f220853678922e03


# f = open('PyMySQL-0.9.3.tar.gz','rb')
# content = f.read()
# sha = hashlib.sha256(content)

#加盐

def my_md5(content,salt='SFG@#!@#$!'):
s = str(content) + salt
m = hashlib.md5(s.encode())
return m.hexdigest()

posted on 2019-06-27 18:05  静思的技术博客  阅读(196)  评论(0编辑  收藏  举报

导航