XOR 3
XOR — Data Encrypted with a Single Byte
Now you will put what you know about XOR into practice. In the following task, the data is hidden using XOR with a single byte (1 byte). However, this byte is a secret key.
You are only given the encrypted data, and it is written in hexadecimal format. By first converting it to bytes and then XORing each byte with a single unknown number, you can find the original text (the flag).
Given data (hex):
73626960647f6b206821204f21254f7d694f7624662065622127234f726927756d
The goal is to decrypt the text and find the original flag.
Helpful hints:
- First, convert the hex data into bytes (using the
bytes.fromhex()function). - Then try XORing with every byte from 0 to 255.
- When the result is readable English text, you have found the flag.
This method is called “brute-force XOR”, meaning that since the key length is one byte, all possibilities are tried.
Result format:
crypto{...}
This exercise is one of the simplest yet very useful applications of the XOR operation. In the next stages, you will solve similar, slightly more complex types of XOR encryption.