TVX CTF 2026Cryptography
What a waste of tokens... (3)
The “last” token-wasting challenge: a 115 KB file wrapped in six encodings, ending in YubiKey modhex.
- Competition
TVX CTF 2026
- Category
- CryptographyMedium · estimated
- Source status
- Flag recovered locally · platform unverified
- Document
- PDF edition5 min read
Brief
The challenge
- Competition
- TVX CTF 2026
- Category
- Cryptography (platform category: Crypto)
- Difficulty
- Medium — estimated, not an official rating
- Points
- 160
- Solves
- 18 on the challenge card when captured
- Challenge author
- gl1tt3rpuff0
- Verification
- Flag recovered locally; platform acceptance not documented
Difficulty: Medium (estimated). TVX CTF 2026 did not publish difficulty ratings; the challenge cards show only points and solve counts. Six stacked encodings, each routine on its own, but two need recognition rather than tooling: bytes reinterpreted as float32 and YubiKey modhex. The card showed 160 points and 18 solves when captured.
01
Overview
It's the last one, I promise

The “last” token-wasting challenge: a 115 KB file wrapped in six encodings, ending in YubiKey modhex.
Solution path in brief
last.txt is a stack of six encodings meant to burn through time (and LLM tokens). The first five are routine. The last one is YubiKey modhex, which looks like hex shifted into letters but breaks a plain shift on the digits a–f:
hex → binary written with ` / a / @ → float32 values → decimal ASCII → hex → modhex → flag02
Initial investigation
The first observation was that the hex decodes to only three distinct characters.
Hex
The 115 KB file holds hex bytes separated by spaces:
60 60 61 61 60 61 61 60 40 60 60 61 ...Only three byte values appear: 0x60, 0x61 and 0x40. They decode to the characters `, a and @:
``aa`aa`@``a`aaa`@``aa`aaa@...03
Tools used
Python 3 (
structfor float32 packing;solve.py)
04
Step-by-step process
Step 1: Binary in disguise
Each character is a binary digit or separator with 0x30 added ('0' → `, '1' → a) and the space shifted to @. Mapping ` → 0 and a → 1, then splitting on @, gives 8-bit groups that decode to text:
6.710209277116519e-7 5.96791437601496e-7 1.5348543061074567e-19 ...Step 2: Float32
Tiny floats like 1.53e-19 are what ASCII bytes look like when they are read as an IEEE-754 float32. Each of the 193 values round-trips exactly through float32. Packing them back as big-endian float32 gives readable text:
54 55 32 54 54 32 50 48 32 54 55 32 54 56 ...Step 3: Decimal ASCII
These are decimal character codes:
67 66 20 67 68 20 67 6a 20 69 6e 20 ...Step 4: Hex again
Decoding as hex gives 29 lowercase letter pairs:
gf gh gj in gi hj ef ei gv ef gv df ef ij ih ee hg hh ie ie gv hf ee ek hl ek ei hn itStep 5: Modhex
Each pair is one byte written as two hex digits, with each digit replaced by a letter. A first guess of "digit + 1" (0→b … 9→k) decodes the start correctly: gf gh gj → 54 56 58 → TVX, and gi hj ef ei → Wh47.
The guess fails on the hex letters, though. { (7b) comes out as in instead of im, and _ (5f) comes out as gv instead of gq. The letters used for a–f are l, n, r, t, u, v.
That's the YubiKey modhex alphabet. Modhex keeps every digit at the same keyboard position on any layout:
| hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| modhex | c | b | d | e | f | g | h | i | j | k | l | n | r | t | u | v |
Decoding every pair with this table gives the flag:
TVX{Wh47_4_$4xv3efss_d39j97k}05
Commands and code
Solve script
solve.py:
import structMODHEX = "cbdefghijklnrtuv"raw = open("last.txt").read()l1 = bytes.fromhex(raw).decode()l2 = "".join(chr(int(t.replace("`", "0").replace("a", "1"), 2)) for t in l1.split("@"))l3 = b"".join(struct.pack(">f", float(x)) for x in l2.split()).decode()l4 = "".join(chr(int(x)) for x in l3.split())l5 = bytes.fromhex(l4.replace(" ", "")).decode()l6 = bytes(int("".join("%x" % MODHEX.index(c) for c in p), 16) for p in l5.split()).decode()print("FLAG:", l6)Full source: solve.py
import structMODHEX = "cbdefghijklnrtuv"raw = open("last.txt").read()# layer 1: hex -> text of '`', 'a', '@'l1 = bytes.fromhex(raw).decode()# layer 2: '`'=0, 'a'=1, '@'=separator -> binary bytesl2 = "".join(chr(int(t.replace("`", "0").replace("a", "1"), 2)) for t in l1.split("@"))# layer 3: decimal floats -> big-endian float32 bytesl3 = b"".join(struct.pack(">f", float(x)) for x in l2.split()).decode()# layer 4: decimal ASCII codesl4 = "".join(chr(int(x)) for x in l3.split())# layer 5: hexl5 = bytes.fromhex(l4.replace(" ", "")).decode()# layer 6: modhexl6 = bytes(int("".join("%x" % MODHEX.index(c) for c in p), 16) for p in l5.split()).decode()for name, val in [("hex", l1), ("binary", l2), ("float32", l3), ("decimal", l4), ("hex", l5), ("modhex", l6)]: print(f"{name:8} {val[:90]!r}")print("\nFLAG:", l6)06
Technical explanation
Tiny values such as 1.53e-19 are what printable ASCII bytes look like when read as an IEEE-754 float32, so packing them back (big-endian) recovers text. In the last layer a “digit + 1” substitution works for 0–9 but fails on a–f. That pattern identifies modhex (cbdefghijklnrtuv), an alphabet chosen so that the characters sit in the same place on every keyboard layout.
Key lessons
Tiny floats such as
1e-19or6e-7usually mean raw bytes were reinterpreted as float32. Pack them back and try both byte orders.If a "digit to letter" substitution works for
0–9but breaks ona–f, try modhex (cbdefghijklnrtuv).Anchor on the known flag prefix (
TVX{). It shows which part of a guessed mapping is right and which part needs fixing.
07
Flag
Flag
TVX{Wh47_4_$4xv3efss_d39j97k}
Flag recovered locally · platform unverified
08
Verification status
Status: Flag recovered locally; platform acceptance not documented.
The decoding chain is deterministic, and the result begins with the known TVX{ prefix and decodes every pair cleanly with the modhex alphabet. Platform acceptance is not documented.
Source evidence in the archive: WRITEUP.md, solve.py, last.txt, images/00_challenge.png.
09
Conclusion
Each layer is simple; the skill is in recognising which encoding a strange-looking intermediate result belongs to.
Prepared by Adam Omar Saleh from the archived solve notes in what_a_waste_of_tokens_3/. Commands, code, output and screenshots are reproduced from the source; no results were added. Difficulty is an estimate.