<reponame>Infintesky/Cryptohack<gh_stars>0
from pwn import xor


KEY1 = bytes.fromhex('<KEY>')
KEY2_KEY1 = bytes.fromhex(
    '<KEY>')
KEY2_KEY3 = bytes.fromhex(
    'c1545756687e7573db23aa1c3452a098b71a7fbf0fddddde5fc1')
FLAG_KEY1_KEY3_KEY2 = bytes.fromhex(
    '04ee9855208a2cd59091d04767ae47963170d1660df7f56f5faf')


# FLAG = (FLAG_KEY1_KEY3_KEY2 ^ KEY2_KEY3) ^ KEY1
print(xor(xor(FLAG_KEY1_KEY3_KEY2, KEY2_KEY3), KEY1))

from pwn import xor


KEY1 = bytes.fromhex('<KEY>')
KEY2_KEY1 = bytes.fromhex(
    '<KEY>')
KEY2_KEY3 = bytes.fromhex(
    'c1545756687e7573db23aa1c3452a098b71a7fbf0fddddde5fc1')
FLAG_KEY1_KEY3_KEY2 = bytes.fromhex(
    '04ee9855208a2cd59091d04767ae47963170d1660df7f56f5faf')


# FLAG = (FLAG_KEY1_KEY3_KEY2 ^ KEY2_KEY3) ^ KEY1
print(xor(xor(FLAG_KEY1_KEY3_KEY2, KEY2_KEY3), KEY1))
# FLAG = (FLAG_KEY1_KEY3_KEY2 ^ KEY2_KEY3) ^ KEY1