i = "73626960647f6b206821204f21254f7d694f7624662065622127234f726927756d" to_bytes = bytearray.fromhex(i) for i in range(256): final = "" for e in to_bytes: final = final + chr(i ^ e) if ord(final[6]) + 2 == ord(final[-1]): print(final)