XOR加密
import hashlib h_md5 = hashlib.md5() x= input("请输入要加密的文字") print( "Text:",x) data = x.encode('utf-8',errors='ignore') h_md5.update(data) md5_str = h_md5.hexdigest() print("MD5:",md5_str) from random import* n="".join([choice("0123456789ABCDEF")for i in range(32)]) print("Key:",n) txt1 = [] k = '' u = '' for a in range(32): i = '0x' + md5_str[a] j = '0x' + n[a] x=bin(eval(i)).replace('0b','') y=bin(eval(j)).replace('0b','') for c in range(min(len(x),len(y))): if(x[-c] == y[-c]) : e = '0' elif(x[-c] != y[-c]): e = '1' k = e + k k = '0b' + k d = k k = '' s =hex(eval(d)).replace('0x','') u = u + s print("CipherText:",u)