XOR Reuse
The guys from @hackerDNA bring to us, an easy challenge based on XOR key reuse, you can try it here https://hackerdna.com/labs/xor-reuse
So, what is XOR? So basically XOR (Exclusive OR) is a bitwise logical operation that takes two bits and returns 1 if they are different, and 0 if they are the same
0 xor 0 = 0
0 xor 1 = 1
1 xor 0 = 1
1 xor 1 = 0
One of the most important properties of XOR is the fact that
Plaintext XOR key = ciphertext, but if we ciphertext XOR key we can get plaintext
And if plaintext and key does not have the same length we can just simply XOR key[i % keylen]
Plaintext: H e l l o W o r l d
0x48 0x65 0x6c 0x6c 0x6f 0x57 0x6f 0x72 0x6c 0x64
Key: K E Y K E Y K E Y K
0x4b 0x45 0x59 0x4b 0x45 0x59 0x4b 0x45 0x59 0x4b
Ciphertext: 0x03 0x20 0x35 0x27 0x2a 0x0e 0x24 0x37 0x35 0x2eSo, if we back to our challenge, we have this hex string
Get Malekith’s stories in your inbox
Join Medium for free to get updates from this writer.
0f4d27d40d1d70da171e24815c5121d1584838da584824ce5c4b2485594974d7034d7481
How we can get the flag? Well we know flag format from HackerDNA it’s a UUID, well the hint says the plaintext is “a value in a well-known standard format” and the ciphertext is exactly 36 bytes long — which perfectly matches a UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
UUIDs have dashes (- = 0x2d) at fixed positions: 8, 13, 18, 23. That's our lever.
So if we XOR 0x2d with the hex value of that positions
Now.. we can tested, we can just simply go to Cyberchef and create the following receipe
Source: From Hex
Action XOR
Key (HEX) 3a7c15e3
and grab the flag







