print("XOR") for i in range(0, 8): print("Rotated", i) print("Key | Dec | Enc") for j in range(min_length - 1): #print(binary_from_char(encrypted_binaries[j])) decrypted_rotated = decrypted_binaries[j] for k in range(i): decrypted_rotated = chr(rotr(ord(decrypted_rotated), 8)) #print(binary_from_char(encrypted_rotated)) xor = chr(ord(decrypted_rotated) ^ ord(encrypted_binaries[j])) print("{0!r} = {1!r} XOR {2!r} Index {3!r}".format(xor, decrypted_binaries[j], encrypted_rotated, j)) #print("{0!r}".format(decrypted_binaries[j])) #print(chr(rotated ^ ord(decrypted_binaries[j])))