龙空技术网

python 数据加密测试 -base64

艺赛旗RPA 51

前言:

而今你们对“python对称加密”大概比较着重,我们都想要分析一些“python对称加密”的相关内容。那么小编同时在网摘上网罗了一些有关“python对称加密””的相关文章,希望咱们能喜欢,小伙伴们快快来学习一下吧!

#!/usr/bin/env Python3# -*- coding: utf-8 -*-# @Software: PyCharm# @virtualenv:workon# @contact: 1040691703@qq.com# @Desc:Code descripton__author__ = '未昔/AngelFate'__date__ = '2020/4/28 12:58'import base64test = 'hello, world'# 加密bs = base64.b64encode(test.encode("utf8"))print(bs)# 解密decode = base64.b64decode(bs)print(decode)print(decode.decode("utf8"))"""python3 输入的都是 二进制 byte类型注意:用于base64编码的,要么是ASCII包含的字符,要么是二进制数据base64 是对称加密"""b'aGVsbG8sIHdvcmxk'b'hello, world'hello, worldProcess finished with exit code 0#!/usr/bin/env Python3# -*- coding: utf-8 -*-# @Software: PyCharm# @virtualenv:workon# @contact: 1040691703@qq.com# @Desc:Code descripton__author__ = '未昔/AngelFate'__date__ = '2020/4/28 12:58'import base64test = 'hello, world'# 加密bs = base64.b64encode(test.encode("utf8"))print(bs)# 解密decode = base64.b64decode(bs)print(decode)print(decode.decode("utf8"))"""python3 输入的都是 二进制 byte类型注意:用于base64编码的,要么是ASCII包含的字符,要么是二进制数据base64 是对称加密"""
b'aGVsbG8sIHdvcmxk'b'hello, world'hello, worldProcess finished with exit code 0
b'aGVsbG8sIHdvcmxk'b'hello, world'hello, worldProcess finished with exit code 0

标签: #python对称加密