Python之base64加密解密

import base64

msg = 'good night 李明'
msg = msg.encode('utf-8')
# 加密
bs64 = base64.b64encode(msg)
print(bs64)
# 结果是  b'Z29vZCBuaWdodA=='

# 解密
debs64 = base64.b64decode(bs64)
debs64 = debs64.decode('utf-8')
print(debs64)
# 结果是 b'good night'
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 点我我会动 设计师:白松林 返回首页