Reverse Engineering
Bitwise Shuffle

Bitwise Shuffle

πŸ” Details

AttributeDetails
Challenge NameBitwise Shuffle
CategoryReverse Engineering
Difficulty🟠 Medium
FlagF4H{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

  1. Each character was shifted forward by 2. Maybe shifting it back by 2 will help?
  2. 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.

πŸ€” Comments