bacon bits: bacon's cipher over hex digits

huntress ctf 2026, day 17 · warmups · all three modes

tools used: decoding engine and timed-attempt pipeline.

the prompt: "sixteen guests. five little a's and b's apiece." the single and the time trial were one blob of space-separated five-letter groups of a and b; the mastery was a zip of 83 blobs with seventeen numbered lines, the seventeenth in the same form.

the key insight: five binary symbols give 32 values, but the groups never go past fifteen. "sixteen guests" are the hex digits: each group is one nibble, two groups make a byte. bacon's cipher maps the groups to letters; here they map to hex.

challenge shape

single        1 field    one bacon-hex blob, the whole message
time trial    1 field    one bacon-hex blob
mastery      83 fields   83 blobs of 17 numbered lines, line k in day k's form

the field is message (setK.message in mastery): the slug the final decoded line names, in the question's syntax "three lowercase words separated by hyphens, followed by a hyphen and a two-digit number; submit the slug only" (word-word-word-NN).

artifact anatomy

aabbb ababa aabbb ababa            "zz" in the same form

a is 0 and b is 1, most significant first: aabbb = 00111 = 7, ababa = 01010 = 10. our blobs were lowercase; the reader maps A/a and B/b alike. pairs of nibbles are bytes (7a = z), and the bytes are the message text with its newlines. the mastery's numbered lines are the message cut into seventeen chunks, one per day so far; line 17 is a chunk in this form.

extraction method

the engine already read bacon's cipher (groups to letters a-z, day 9). a new transform reads the same groups as nibbles:

def bacon_hex(text):
    s = text.strip().translate(str.maketrans("ABab", "0101"))
    groups = s.split() if re.search(r"\s", s) else re.findall(r".{1,5}", s)
    if not groups or any(len(g) != 5 or set(g) - {"0", "1"} for g in groups):
        raise ValueError("not bacon hex")
    vals = [int(g, 2) for g in groups]
    if len(vals) % 2 or max(vals) > 15:
        raise ValueError("bacon groups are not hex nibbles")
    return as_text(bytes(vals[i] << 4 | vals[i + 1]
                         for i in range(0, len(vals), 2)))

it is the seventeenth row of the line schedule (line k in day k's codec), so the mastery reads every line by its row, and the one-blob modes find it on the first step of the whole-text search. "a's and b's" is a hint word for it.

validation and answer formatting

a group above fifteen or an odd number of groups rejects the reading, so ordinary bacon text never reads as hex. the result must decode to text that ends in a dictionary slug. the answer is the slug as written.

failed approaches and pivots

without the transform the single's whole-blob search reached its time cap: the letter reading gives a string of a-p letters, which no further transform turns into english, and the search kept widening. reading the group values by hand showed none above fifteen, which named the codec.

automation across modes

the single and the time trial go through the whole-text search; the mastery reads all 83 blobs by the seventeen-row schedule.

lessons

solve times

public scoreboard · day 17 finish: below top 10

  • 0:42.6single#10 of 186 solvers
  • 1:22.5time trial#17 of 176 solvers
  • 1:24.9mastery#10 of 174 solvers
  • #15team day finishof 162 teams that cleared it, in 1h45m
  • #4single 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 42.0s 1 0
time trial 0.6s 1 0
mastery 1.1s 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 30.0s 0.6s 29.4s
mastery 100.0s 1.1s 98.9s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}