实例代码,
import base64
str1='you_know_how_to_remove_junk_code'
flag=''
for i in str1:
flag += chr(ord(i)^0x25)
print(base64.b64encode(flag)) #将flag字符串加密
base64.bxxencode() 加密语句
base64.bxxdecode() 解密语句
实例:
# base64编码
t = base64.b64encode(s.encode('UTF-8'))
print(t)
# base64解码
t = base64.b64decode(t)
print(t)
# base32编码
t = base64.b32encode(s.encode('UTF-8'))
print(t)
# base32解码
t = base64.b32decode(t)
print(t)