base64加密_python 数据加密测试 -base64

#!/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 是对称加密"""
c8eddb36d1e337585ad551493aab4509.png
b'aGVsbG8sIHdvcmxk'b'hello, world'hello, worldProcess finished with exit code 0
b'aGVsbG8sIHdvcmxk'b'hello, world'hello, worldProcess finished with exit code 0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值