for i in str1_AScII: for j in str2_AScII: if i ^ j in result_ASCII: dict_key.append((i, j, chr(i), chr(j))) dict_value.append(chr(i ^ j))
dicts = dict(zip(dict_key, dict_value)) print("[+] OK,The dicts is create")
YourStr = input("[-] Enter the string to be XORed: ") print("\n[-] YourStr is : %s\n" % (YourStr))
for i in YourStr: count = 5 print("============ " + "[" + i + "]" + " Can following composition ========") for k, v in dicts.items(): if count != 0: # 只遍历输出前五个异或结果 if v == "%s" % i: if (k[0] in result_ASCII) and (k[1] in result_ASCII): print('"%s" ^ "%s"' % (k[2], k[3])) count -= 1 else: continue