Challenge

Part of the LAMPREY thread in the CIPHER-Wiki series (ctf313.com/cipher-wiki). After the line “The reaSOn wE HAVe not aCTted iS tHAt” comes a block of 856 letters, all between A and P.

Approach

Sixteen distinct letters means nibbles:

  1. Map A through P to 0 through f, giving 428 bytes.
  2. Every pair of bytes is (x, x ^ 0xA5), so keep the even-indexed ones.
  3. XOR each remaining byte with the one before it.
1
2
3
b = bytes.fromhex(''.join('0123456789abcdef'[ord(x) - 65] for x in c))
f = b[0::2]
print(bytes(f[i] ^ f[i - 1] for i in range(1, len(f))))

The plaintext ends “…Your dissention serves our purpose. (FLAG = TALENT_POOL)”. The File Index and Case ID on the page join into a 32-hex-character string that I never explained.

Flag

TALENT_POOL