Encoding Onion 100 keyless encodings, one OSINT lead

crypto
flag L3m0n{48a9a1aba8987b4b62fb026b85f73ec1}

The challenge gives you output.txt: one line, 3.26 MB of punctuation soup. The description is really an OSINT pointer dressed up as a crypto challenge - "junior security engineer Devon Vance... bragged about a novel 'unbreakable' multi-stage layered encoding concept" before going offline. No decoding key is on the platform at all.

Hint

"Unbreakable" encoding with no key usually means there's no key - just a very long, but completely public, list of steps.

Finding the pipeline

Devon's handle, devon-vance-sec, is a real GitHub account with one repo: encoding-onion-pipeline. Its README describes "a deterministic multi-stage encoding pipeline" built entirely from keyless, reversible text transforms - RFC 4648 Base family codecs (Base16/32/32hex/64/64url), Ascii85/Base85, and the rotational alphabets ROT13/ROT47 - and points at pipeline_spec.txt: the exact ordered list of all 100 stages, numbered 01 (applied first) to 100 (applied last, producing output.txt).

output
01. ROT13
02. ROT47
03. ROT13
04. Base85
...
99. Base32
100. ROT47

Insight

100 stages sounds intimidating but every single one of them is a well-known, keyless, invertible transform. "Unbreakable" here just means "long," not "cryptographically hard." Decoding is mechanical: walk the spec list backwards, from stage 100 down to stage 01, applying each transform's inverse.

Decoding

python
1import base64
2
3def rot13(s):
4    return s.translate(str.maketrans(
5        'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
6        'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'))
7
8def rot47(s):
9    return ''.join(chr(33 + (ord(c) - 33 + 47) % 94) if 33 <= ord(c) <= 126
10                   else c for c in s)
11
12def decode_stage(data, name):
13    if name == 'ROT13':      return rot13(data.decode()).encode()
14    if name == 'ROT47':      return rot47(data.decode()).encode()
15    if name == 'Base16':     return base64.b16decode(data, casefold=True)
16    if name == 'Base32':     return base64.b32decode(data)
17    if name == 'Base32hex':  return b32hex_decode(data)   # custom alphabet remap
18    if name == 'Base64':     return base64.b64decode(data)
19    if name == 'Base64url':  return base64.urlsafe_b64decode(data)
20    if name == 'Base85':     return base64.b85decode(data)
21    if name == 'Ascii85':    return base64.a85decode(data)
22
23stages = [... ]  # the 100 names from pipeline_spec.txt, in file order
24data = open('output.txt', 'rb').read().strip()
25for name in reversed(stages):
26    data = decode_stage(data, name)
27print(data)

Pitfall

Python's base64 module has no b32hexdecode built in - Base32hex needs a small manual remap from the extended-hex alphabet (0123456789ABCDEFGHIJKLMNOPQRSTUV) to the standard Base32 alphabet before base64.b32decode will touch it. Easy to forget and get a confusing padding error 60 stages deep instead of an obvious failure.

Running all 100 stages in reverse, strictly in order, with no shortcuts and no guessing, lands cleanly on:

output
L3m0n{48a9a1aba8987b4b62fb026b85f73ec1}

Every single one of the 100 inverse transforms applies without error on the first try, which is itself a decent sanity check that the spec file and the stage order are both exactly right - a wrong stage or wrong direction anywhere in the chain would have thrown a decode error long before reaching the end, not quietly produced the wrong answer.

Note

Lesson of the challenge: a long chain of simple, keyless, public transforms is not encryption, no matter how "layered" it sounds. The only hard part here is OSINT - finding the one public file that documents the order.