python前后端加密方式

后端加密方法:

python后端加密方式:
# 双重工加密
#bytes((7788).encode('utf-8')):为后端加密二把手,多加的锁,该参数可为空,必须加bytes才能实现
md5password=hashlib.md5(bytes((7788).encode('utf-8')))
#data[ 'user_password']).encode('utf-8'):才是真正要加密的密码
md5password.update(bytes(data['user_password']).encode('utf-8'))
data['user_password']=md5password.hexdigest()
 
前端加密方法:
导入md5.js然后直接引用
data = {username:username,password:hex_md5(password)}

猜你喜欢

转载自www.cnblogs.com/Dark-fire-liehuo/p/9900719.html