OPEN THE EYEEEE!! zero-width characters between decorative emoji

crypto
flag L3m0n{B854D44E8A094FDC52910FB312045672}

A single line of flavor text, followed by a wall of emoji:

"Three steps forward, one letter at a time; let the cycle repeat. The other one cooks with citric acid."

output
๐Ÿ˜€โ€‹โ€Œโ€Œโ€Œโ€Œ๐ŸŒŸโ€‹โ€Œโ€‹โ€Œโ€Œ๐ŸŽˆโ€‹โ€‹โ€Œโ€Œโ€Œ๐Ÿ€โ€‹โ€Œโ€Œโ€‹โ€Œ๐Ÿฆ‹โ€‹โ€Œโ€Œโ€Œโ€Œ๐ŸŒˆโ€‹โ€Œโ€Œโ€‹โ€Œ๐ŸŽต ...
Hint

"Cooks with citric acid" is a lemon-juice joke - the classic invisible ink. What in this text is invisible?

Extracting the hidden payload

157 emoji cycle through a fixed list of 10 (๐Ÿ˜€๐ŸŒŸ๐ŸŽˆ๐Ÿ€๐Ÿฆ‹๐ŸŒˆ๐ŸŽต๐Ÿ‰๐Ÿผโœจ), and emoji i is always list[i % 10] - purely a separator, carrying zero information. Between consecutive emoji sit exactly 5 zero-width characters each, drawn from only two code points: U+200B (ZWSP) and U+200C (ZWNJ).

Insight

Reading ZWSP as 0 and ZWNJ as 1, MSB-first, across all 156 gaps gives 156 five-bit values, every one in the range 1-18. That narrow range - never 0, never above 18 - is the first real clue that this isn't raw ASCII or a direct letter mapping.

Finding the structure

A Kasiski-style repeat search on the 156 values finds repeated 3-5 grams at distances 24, 36, and 108 - gcd 12 - and the index of coincidence peaks at period 12, with period 4 also strong. Splitting into groups of 4 shows the 3rd value in each group depends entirely on the 1st, and the 4th on the 2nd: each group of 4 carries only 2 independent values, looking like a hex byte stored twice. Fitting u2 = ((u0 - a) XOR m) + b finds small offsets and XOR masks 0xA (high nibble) and 0x5 (low nibble) - the second byte is the first byte XOR 0xA5.

1/3Layer 1: the "1, 2, 3" cycling shift

"Three steps forward, one letter at a time; let the cycle repeat" is the cipher's own instructions. Subtracting (i % 3) + 1 from every value turns all 156 values into clean hex nibbles (0-15) - which also explains the 1..18 range (15 + 3 is exactly the observed maximum), and why Kasiski found period 12 (a period-3 shift layered onto groups of 4 values).

2/3Layer 2: redundant byte pairs

The 156 nibbles form 78 bytes, pairing into 39 (x, x XOR 0xA5) pairs. The relationship holds for all 39 pairs without exception - the second byte of each pair is pure redundancy, there to confirm the first.

3/3Layer 3: chained XOR

Taking c = x XOR 0xA5 for the first byte of each pair gives c[0] = 'L' immediately. Checking against the known L3m0n{ prefix shows c[1] XOR c[0] = '3' and c[2] XOR c[1] = 'm' - CBC-style chaining:

output
p[0] = c[0]
p[i] = c[i] XOR c[i-1]

This decodes cleanly all the way to the closing brace.

python
1import json
2d = json.load(open('challenge.json'))['description']
3bits = ''.join('0' if ch == 'โ€‹' else '1' for ch in d if ch in 'โ€‹โ€Œ')
4v = [int(bits[i:i+5], 2) for i in range(0, len(bits), 5)]        # 156 values
5n = [x - (i % 3 + 1) for i, x in enumerate(v)]                   # undo 1,2,3 shift cycle
6b = bytes(n[i]*16 + n[i+1] for i in range(0, len(n), 2))         # 39 pairs (x, x^0xA5)
7assert all(b[i] ^ b[i+1] == 0xA5 for i in range(0, len(b), 2))
8c = [x ^ 0xA5 for x in b[0::2]]
9print(bytes([c[0]] + [c[i] ^ c[i-1] for i in range(1, len(c))]).decode())
output
L3m0n{B854D44E8A094FDC52910FB312045672}

Pitfall

Treating each value as a direct letter mapping (A1Z26, Bacon cipher, Caesar or Vigenere mod 26, generic substitution solvers) all fail completely - the values are shifted hex nibbles, not letters, and their English-looking frequency skew is a side effect of hex-encoding ASCII text, not an actual substitution cipher over the alphabet. Reading the bitstream directly as 5/6/7/8-bit ASCII also fails, since the cycling shift has to be removed before the bytes mean anything at all - a strong early signal to look for a scoring function that discriminates real structure from noise before trusting any one interpretation.