encrypted strings: a keyed xor, nothing new under the puzzle
huntress ctf 2026, day 18 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
the prompt: "recover only the strings that reach security-sensitive android and backend apis." as on every mobile day, the apk carries assets/huntress_puzzle.json, and the answer is its data decoded per its codec.
the key insight: the codec is xor with an integer key, the same step as days 4 and 11: base64 data, every byte xored with the key. the story about security-sensitive apis is flavor; the puzzle file is the whole challenge.
challenge shape
single 1 field answer, from one apk
time trial 1 field a fresh apk
mastery 5 fields five apks, one answer each
artifact anatomy
{"schema": "huntress.mobile.puzzle.v1", "day": 18, "codec": "xor",
"data": "<28 characters>", "key": <a small integer>}
data is base64 (28 characters, 20 bytes once decoded); key is the xor key. the mastery's five apks carried earlier days' codecs, one per set: plain, hex, split, native, and today's xor.
extraction method
the codec reader has had a keyed xor step since day 4: the data's text form is decoded (hex, base64 or the raw characters, whichever reads), each byte is xored with the key, and the key may be given as text, as hex, as base64 or as a number. the result must have the answer's shape, a prefix and sixteen hex digits, or the reading is not returned:
def xor_step(data: bytes, key: bytes) -> bytes:
return bytes(b ^ key[i % len(key)] for i, b in enumerate(data))
an integer key is one byte; a longer key would repeat. by hand, with the standard library:
import base64, json, zipfile
puzzle = json.loads(zipfile.ZipFile("encrypted_strings.apk")
.read("assets/huntress_puzzle.json"))
raw = base64.b64decode(puzzle["data"])
print(bytes(b ^ puzzle["key"] for b in raw).decode()) # ANS-...
validation and answer formatting
the answer shape is the check: of the text readings of data, exactly one xors to a string of the answer's form. the answer is that string as is.
automation across modes
every apk carries its own puzzle; the same step applies.
lessons
- when a lane cycles its codecs, the day's prompt rarely names the step: keep every earlier codec live and let the answer shape pick the reading.
solve times
public scoreboard · day 18 finish: 1st
- 0:02.8singlefirst blood, +0.56 s
- 0:04.3time trialfirst blood, +0.44 s
- 0:06.0masteryfirst blood, +0.81 s
- #1team day finishof 155 teams that cleared it, in 0:45.5
- #1single orderof the day's 5, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from when we started working on the mode to its flag.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 0.7s | 1 | 0 |
| time trial | 0.7s | 1 | 0 |
| mastery | 0.5s | 1 | 0 |
the clock
server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 50.0s | 0.7s | 49.3s |
| mastery | 170.0s | 0.5s | 169.5s |
where we got stuck
- nowhere: the day 4 step read the puzzle, and the first attempt of each mode was correct.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}