# -*- coding: cp936 -*-import base64src = "明文数据"tgt = base64.b64encode(src.encode('UTF-8'))print(tgt)src = base64.b64decode(tgt).decode('utf-8')print(src)