crypto-hack/xor/3.py
2020-04-24 16:04:28 +10:00

29 lines
605 B
Python

q = "0e0b213f26041e480b26217f27342e175d0e070a3c5b103e2526217f27342e175d0e077e263451150104"
to_bytes = bytearray.fromhex(q)
final = ""
i = 1
#while i <= 10000000:
# final = ""
# for e in to_bytes:
# final = final + chr(i ^ e)
# if "crypto" == final[0:5]:
# print(final)
# print(i)
# i = i + 1
# #print(final[7])
#print(i)
#key = ""
#for e, i in zip(to_bytes, "crypto{"):
# key = key + chr(ord(i) ^ e)
#print(key)
key = "myXORkeymyXORkeymyXORkeymyXORkeymyXORkeymyXORkey"
final = ""
for e, i in zip(to_bytes, key):
final = final + chr(e ^ ord(i))
print(final)