python3中base64加解密

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Areigninhell/article/details/82461661
import base64
payload = "select * from workbasic"
b =base64.b64encode(payload.encode('utf-8')).decode("utf-8")
print(b)
# 'c2VsZWN0ICogZnJvbSB3b3JrYmFzaWM='
c = base64.b64decode(b.encode("utf-8")).decode("utf-8")
print(c)
# 'select * from workbasic'

注意事项:

       python3 base64加解密过程中是字节,上面代码是为了转换为正常字符串,以便后续进行处理

猜你喜欢

转载自blog.csdn.net/Areigninhell/article/details/82461661