Bitwise Shuffle
π Details
| Attribute | Details |
|---|---|
| Challenge Name | Bitwise Shuffle |
| Category | Reverse Engineering |
| Difficulty | π Medium |
| Flag | F4H{rr83idozcJ**********} |
π Description
The message was altered using the following encoding:
- Each character was XORed with 11.
- Then, it was shifted forward by 2 in ASCII.
Can you recover the original message? For your convenience, the file code.py contains the encoding algorithm. It may help you reverse-engineer the decoding process.
π₯ Download code.py
π₯ Download encoded_message.txt
π§© Hints
- Each character was shifted forward by 2. Maybe shifting it back by 2 will help?
- Applying XOR twice with the same number cancels it out. Try XORing with 11 again!
π‘ Solution
To reverse it, just apply the inverse steps in reverse order:
- First, subtract 2 from each character
- Then XOR the result with 11
You can use any Python interpreter, e.g. Programiz Online (opens in a new tab) or VS Code.
Example code:
flag = "OAEr{{5:dqfsjC>NtEhuP[[Ix"
decoded_chars = [chr((ord(c) - 2) ^ 11) for c in flag]
decoded_text = ''.join(decoded_chars)
print(decoded_text)π Insights
This challenge demonstrates a basic custom encoding scheme involving character-level manipulation β a common concept in reverse engineering.
- XOR is reversible: applying the same XOR key twice restores the original.
- ASCII shifts (e.g., +2, -2) are often used in obfuscation.
- When decoding, reverse the operations in reverse order of encoding.