import os import sys import struct def enc(path, key): path_ret = "" for i in range(0, len(path)/4): path_ret += struct.pack("<L", struct.unpack("<L", path[i*4 : (i*4)+4])[0] ^ key) return path_ret print enc("daniel King ", 0x0) print enc("daniel King ", 0xFFFFFFFF) print enc(enc("daniel King ", 0xFFFFFFFF), 0xFFFFFFFF)
>>> ================================ RESTART ================================ >>> daniel King 洖憱殦叽枒樳 daniel King >>>
Python异或加密字符串
时间: 2024-11-05 20:36:22