You either know, XOR you don't - Cryptohack writeup
Challenge
I've encrypted the flag with my secret key, you'll never be able to guess it.
Hint : Remember the flag format and how it might help you in this challenge!
0e0b213f26041e480b26217f27342e175d0e070a3c5b103e2526217f27342e175d0e077e263451150104
This challenge is same as previous fevourite byte challenge, the only difference would be the key size/type. Although we have the XORed value in hex and some portions of flag, and we know if we xor flag portions(crypto{_____}) with right place of unhexed value, then definitely we get the key.
after that now we have key and the string, now just XOR the key with the unhexed value and Booom !! you got the flag ....
Following python code can help you to find the value of key, which reavels the flag.
from pwn import xor
hx = bytes.fromhex('0e0b213f26041e480b26217f27342e175d0e070a3c5b103e2526217f27342e175d0e077e263451150104')
key = xor(hx[:7],"crypto{".encode()) + xor(hx[-1],"}".encode())
print(f'Key is : {key.decode()} ++++ Flag is : {xor(hx,key).decode()}') # Output: Key is : myXORkey ++++ Flag is : crypto{1f_y0u_Kn0w_En0uGH_y0u_Kn0w_1t_4ll}
Final Flag : crypto{1f_y0u_Kn0w_En0uGH_y0u_Kn0w_1t_4ll}
While solving XOR related challenge, keep in mind that A ^ B = C and B ^ C = A and so on.