Skip to content

CIPHER GARDEN — Gameplay Specification

Engineering-Ready Blueprint — KN-86 Deckline Module 0x0C

Version 1.0 | April 2026 | Status: Definitive

CIPHER-LINE revision note (2026-04-24): Cipher Garden’s voice — plaintext-match confirmations, frequency-analysis observations, key-hypothesis commentary — renders on the CIPHER-LINE OLED, not the main 80×25 grid. The module’s name “Cipher Garden” refers to the cryptographic module identity, not the Cipher voice engine; keep the distinction. Cipher Garden is the primary caller of aux-show-seed (key values for operator capture to Universal Deck State). Bureau 9’s cold publisher aesthetic: the voice is clinical. See the CIPHER-LINE Contributions section at the end. Canonical engine spec: docs/software/runtime/cipher-voice.md.


Mission Composition Grammar declaration — verb vocabulary, affinity tag set, and mission-contributions schema are defined in docs/plans/post-v0.1/2026-04-25-mission-composition-grammar.md §1–§3.

(mission-contributions
:verbs (ANALYZE OBSERVE)
:affinities (DIGITAL INFORMATION)
:modifiers (:passive)
:payout-bias 1.2)

Cipher Garden is a passive enhancement cart per MCG addendum §3 and PM resolution Q1: it never anchors a phase in generated chains. Cipher classification and key-hypothesis work satisfy ANALYZE; ciphertext frequency-distribution reading satisfies OBSERVE — both treated as boosts on phases anchored by other DIGITAL or INFORMATION carts (most notably ICE Breaker → Cipher Garden in the Counter-Intelligence pair). :payout-bias 1.2 reflects the cipher_mastery dividend; loading Cipher Garden raises payout on phases involving encrypted intelligence.


CIPHER GARDEN is not a game. It is a cryptographic laboratory—a place where the operator learns to read encrypted data the way a musician reads sheet music. The core mechanic is decryption as pattern recognition: observe ciphertext, analyze its structure, form hypotheses about the plaintext, test those hypotheses, refine the model.

Unlike ICE BREAKER (where the operator is pressured by tempo), CIPHER GARDEN operates without time pressure for most puzzles. The operator can spend as long as needed. This creates a different kind of learning curve: not “how fast can I think” but “how deeply can I think about structure.” The operator develops a sixth sense for frequency distributions, repeating patterns, and the statistical signatures of real language.

CIPHER GARDEN pairs with ICE BREAKER in the Counter-Intelligence campaign: Phase 1 (ICE BREAKER) extracts encrypted messages; Phase 2 (CIPHER GARDEN) decrypts them. It also unlocks encrypted entries in The Vault—knowledge becomes decryptable only to operators who’ve mastered cryptanalysis.

The module is published by Bureau 9 Technical Services (a fictional off-the-books entity with no address, no public face). The loading screen reflects this: dead silence, mechanical text, a progress bar that fills with no sound. Professional. Unfriendly. Authoritative.


1. THE DECRYPTION LOOP: ATOMIC UNIT OF PLAY

Section titled “1. THE DECRYPTION LOOP: ATOMIC UNIT OF PLAY”

The decryption process in CIPHER GARDEN mirrors the OODA loop but operates at a different timescale. Where ICE BREAKER’s OODA cycle takes 0.5–2 seconds, CIPHER GARDEN’s operates at a deliberate pace: 30 seconds to 2 minutes per hypothesis cycle.

OBSERVE (30s): The operator examines the ciphertext. They see:

  • The full encrypted message (80–500 characters depending on difficulty)
  • Character frequency histogram (if INFO is pressed)
  • Repeating patterns (marked visually)
  • Length hints (word boundaries visible or hidden)

The YM2149 plays soft ambient tones: Voice 1 = cipher complexity (harmonic = simple, dissonant = complex), Voice 2 = exploration pulse (a gentle pulsing tone suggesting “look closer”).

ORIENT (1m): The operator must classify the cipher type. This is where learning compounds.

An operator with cipher_mastery 0–20 (Cipher Student) sees only substitution ciphers. They have no baseline for comparison. They must try things.

An operator with cipher_mastery 40–80 (Apprentice Cryptographer) has seen transposition and Vigenère ciphers. They recognize patterns: if the frequency distribution is nearly flat, it might be transposition or Vigenère. If it’s skewed (E and T prominent), substitution is likely.

An operator with cipher_mastery 120+ (Cryptographer) can read the cipher type almost immediately. They see the repeating column patterns of transposition. They see the Kasiski examination opportunity in Vigenère. They are reading crypto the way an expert radiologist reads X-rays.

Press INFO to cycle through cipher hints: frequency table (always available), known plaintext guesses (if available), cipher classification hint (scales with reputation).

HYPOTHESIZE (2–10m): The operator proposes a decryption model. They use the CIPHER GARDEN toolkit:

  • SUBSTITUTION TABLE: Map each ciphertext character to a hypothesized plaintext character. Press CONS to build the mapping. The numpad provides letter entry (0=A, 1=B, etc. on a traditional layout, or can be Lisp-style A=CAR, B=CDR, etc. for thematic consistency).
  • FREQUENCY ANALYSIS: View sorted character frequencies and compare to English/Japanese baseline distributions. Use this to seed hypotheses (Q→E, Z→T, etc.).
  • KNOWN PLAINTEXT ATTACK: If the operator knows a phrase that might appear in the plaintext, CONS allows “cribbing”—sliding a known text across the ciphertext to test for consistency.
  • KEY HYPOTHESIS: For Vigenère or polyalphabetic ciphers, hypothesize the key length (Kasiski examination) or specific key characters.

The operator builds their hypothesis by pressing CONS repeatedly, each time refining a letter mapping or key guess. The display shows their progress: partial decryption emerging character by character.

Voice 2 accelerates as the operator makes successful mappings. When a mapping reveals coherent plaintext (detected via simple dictionary check), Voice 2 plays a rising tone (positive reinforcement).

TEST (immediate): The operator presses EQ to verify their hypothesis against the ciphertext.

The nOSh runtime applies the proposed decryption and checks: Is the resulting plaintext valid English/Japanese (simple entropy check)? Do word boundaries make sense? Does semantic meaning emerge?

If the hypothesis is correct (or close enough), the plaintext appears and Voice 1 + Voice 2 resolve to a major chord—victory.

If incorrect, Voice 1 produces a descending buzz and the screen shows where the hypothesis failed (highlighted character mismatches). The operator returns to HYPOTHESIZE and refines.

No failure state. The operator can test infinitely. Payout is not penalized by failed guesses. This is purely about time-to-solution and completion.


CIPHER GARDEN teaches five cipher types, each with its own decryption grammar and learning arc.

Cipher Type 1: SUBSTITUTION (Caesar → Random)

Section titled “Cipher Type 1: SUBSTITUTION (Caesar → Random)”

Simplest form: Caesar Cipher (shift by fixed amount)

Every letter is shifted by the same amount: A→B, B→C, etc. (shift=1). To decrypt, guess the shift.

Ciphertext: WKH TXLFN EURZQ IRA
Shift guess: 3
Plaintext: THE QUICK BROWN FOX

Complexity: Difficulty 1–2. Solvable by try-all-26 shifts (brute force). Even easier with frequency analysis: if Q is most frequent in ciphertext and E is most frequent in English, then Q→E and shift=12.

Learning goal: Operator learns that frequency distribution is constant across Caesar ciphers. This intuition carries to harder ciphers.

Advanced form: Random Substitution Cipher

Each letter maps to a different letter (no pattern): A→X, B→Q, C→M, etc. No shift pattern.

Ciphertext: UVS OZRBU WEFAL PEJ
Plaintext: THE QUICK BROWN FOX

Complexity: Difficulty 2–5. Requires frequency analysis + pattern matching. No brute-force shortcut (26! = 403 quadrillion possibilities).

Decryption strategy:

  1. Identify which ciphertext character is most frequent → likely maps to E (most frequent in English).
  2. Look for single-letter words (likely A or I).
  3. Look for common bigrams (TH, HE, AN, etc.) and match them in the ciphertext.
  4. Incrementally build the mapping.

Learning goal: Operator learns that frequency analysis is a statistical tool, not deterministic. They develop intuition for “is this plaintext sensible?” and confidence in partial solutions.

Core mechanism: Letters are rearranged by position, not substituted.

Plaintext: THEQUICKBROWNFOX
Rearrange: Take every 4th character: TBIW, then HOC, then EWO, then QURK, then NFOX
Ciphertext: TBIWWOCEQURKFOX

(This is a simplified rail fence cipher.)

Complexity: Difficulty 2–4. Frequency distribution is identical to plaintext (all letters appear same number of times). Frequency analysis is useless here.

Decryption strategy:

  1. Operator must recognize that frequency distribution matches expected language (E, T, A appear at normal rates) → suggests transposition, not substitution.
  2. Look for repeating patterns or columnar structures.
  3. Guess the rearrangement pattern (rail fence, columnar, route cipher).
  4. Test permutations until plaintext emerges.

Learning goal: Operator learns that not all ciphers are frequency-based. They learn to recognize when frequency analysis fails and pivot to structural analysis.

Cipher Type 3: VIGENÈRE (Polyalphabetic Substitution)

Section titled “Cipher Type 3: VIGENÈRE (Polyalphabetic Substitution)”

Core mechanism: Multiple substitution alphabets applied sequentially, controlled by a repeating key.

Plaintext: THEQUICKBROWNFOX
Key: GHOSTWIREGHOSTW
Ciphertext: ZLOKRWDJCRSVNPQD
(T+G=Z, H+H=O, E+O=S, Q+S=I, etc.)

Complexity: Difficulty 3–5. Frequency distribution is flattened (E is less prominent because it gets mapped to multiple letters). Traditional frequency analysis fails.

Decryption strategy:

  1. Kasiski Examination: Find repeating substrings in ciphertext. The distance between repeats hints at the key length (key repeats every N characters).
  2. Once key length is known, perform frequency analysis on each “lane” (every Nth character) separately. Each lane is a Caesar cipher with a different shift.
  3. Solve each Caesar independently.
  4. Reconstruct the key.

Learning goal: Operator learns advanced cryptanalysis. They learn that even “unbreakable” systems (Vigenère was unbroken for 300 years) can yield to statistical analysis.

Not a single cipher type, but a puzzle category: Given ciphertext, the operator must infer plaintext by pure statistical analysis.

Mechanism: Ciphertext is heavily obfuscated (random substitution + transposition hybrid, or Vigenère without key hints). The operator has:

  • Character frequency histogram
  • Word-length boundaries (shown as | separators)
  • Optional: Known plaintext fragments (operator must deduce where they appear)

Example:

Frequency table (sorted by count):
R: ████████░ (18)
Z: ███████░ (17)
G: ██████░ (14)
A: ██████░ (14)
D: █████░ (11)
...
Ciphertext:
ZRG RZ A DQZZAKQ DSLJ GYQ AKMQAA.
Hypothetical known plaintext: "THE QUICK" appears somewhere.
Goal: Decrypt the entire message.

Complexity: Difficulty 2–4. Success requires recognizing that high-frequency characters map to common letters (E, T, A, O, I, N).

Learning goal: Operator learns that language has statistical patterns. They learn to read “density” of characters and recognize English structure (common bigrams, trigrams, word patterns).

Cipher Type 5: ONE-TIME PAD (Perfect Encryption)

Section titled “Cipher Type 5: ONE-TIME PAD (Perfect Encryption)”

Core mechanism: Message + random key of equal length, XOR’d together. With key, decryption is trivial. Without key, cipher is unbreakable (mathematically proven).

Plaintext: T H E Q U I C K
Key: K M Z P W O J S
Ciphertext: D K A I M W T C

Complexity: Difficulty 1–3. Decryption is deterministic IF you have the key. Without the key, it’s impossible.

Gameplay twist: One-time pad contracts always provide the key (or enough information to reconstruct it). The puzzle is not “break this cipher” but “understand how one-time pads work” and “generate a secure random pad.”

Learning goal: Operator learns that perfect encryption exists and why. They learn about key management (the real vulnerability of one-time pads is keeping the key secret and random).


CIPHER GARDEN’s toolkit is the set of analytical views and helper functions the operator uses to attack a cipher.

Press INFO to show a detailed frequency histogram:

╔═══════════════════════════════════════════════╗
║ FREQUENCY ANALYSIS ║
├───────────────────────────────────────────────┤
║ Character Count Frequency Expected(English)║
║ ─────────────────────────────────────────────║
║ R 18 7.3% 2.8% (E) ║
║ Z 17 6.9% 2.8% (T) ║
║ G 14 5.7% 2.3% (A) ║
║ A 14 5.7% 2.3% (O) ║
║ D 11 4.5% 2.0% (I) ║
║ ... ║
╚═══════════════════════════════════════════════╝

The display sorts by count (descending) and shows expected frequencies for English. The operator can compare visually: if R is 7.3% and E is expected at 2.8%, R might not map to E directly (unless this is a non-English corpus or a low-entropy ciphertext).

CDR cycles through alternative frequency displays:

  • English expected distribution
  • Digraph frequencies (TH, HE, AN, etc.)
  • Bigram frequency (two-character combinations in ciphertext)
  • Index of Coincidence (a statistical measure of likelihood that two random characters are the same)

Press CONS to enter substitution mode. The screen shows:

┌─────────────────────────────────────────────┐
│ SUBSTITUTION MAPPING │
├─────────────────────────────────────────────┤
│ Ciphertext Hypothesis Plaintext │
│ ─────────────────────────────────────────────│
│ R → ? (most frequent, try E) │
│ Z → ? (second, try T) │
│ G → ? (third, try A) │
│ A → ? (fourth, try O) │
│ D → ? (try I) │
│ ... │
│ │
│ Your mapping: R→E, Z→T, G→A, A→?, D→I │
│ Partial plaintext: THE ?? ICK... │
└─────────────────────────────────────────────┘

Operator enters mappings:

  • CDR selects a ciphertext character
  • Numpad (0–25) enters the proposed plaintext character (0=A, 1=B, etc.)
  • INFO shows frequency comparison for that character pair
  • EQ tests the full mapping

As the operator builds the mapping, the screen updates in real-time showing the partial plaintext. When enough of the plaintext is coherent, the operator knows they’re on the right track.

Known Plaintext Attack (CONS + special mode)

Section titled “Known Plaintext Attack (CONS + special mode)”

If a phrase is known to appear in plaintext (e.g., “THE QUICK”), the operator can “crib” it against the ciphertext:

Press CONS, then select “CRIB MODE”. The screen shows:

┌─────────────────────────────────────────────┐
│ CRIB: THE QUICK │
│ │
│ Slide the known plaintext across the │
│ ciphertext to find a position where the │
│ letter mappings are consistent. │
│ │
│ CDR to slide right, CAR to slide left │
│ EVAL to lock when found │
│ │
│ Ciphertext: XXXXXXXXXXXXXXXXXXXXXX... │
│ Hypothesis: THE QUICK (slide to align) │
│ │
│ Position 7: RZ G RZ A → TH E TH E (OK!) │
│ (Inconsistency: G→E and Z→H, but also Z→T?)│
│ │
│ Position 12: ZD G RZ A → TH E TH E (Match!)│
└─────────────────────────────────────────────┘

When the operator finds a position where all letter mappings are consistent, they lock it (EVAL). The nOSh runtime extracts the implied substitutions and adds them to the table.

Press ATOM to test if the cipher is a polyalphabetic variant. If yes, the screen shows:

┌──────────────────────────────────────────────┐
│ KASISKI EXAMINATION │
├──────────────────────────────────────────────┤
│ Repeating substrings in ciphertext: │
│ │
│ ZG (positions 5, 23, 41) → gaps: 18, 18 │
│ RZ A (positions 12, 36, 60) → gaps: 24, 24 │
│ │
│ GCD of gaps: 6 │
│ Most likely key length: 2, 3, or 6 │
│ │
│ Recommendation: Try key length 6 │
│ │
│ CDR to try different lengths, EVAL to proceed│
└──────────────────────────────────────────────┘

Once the operator selects a key length, the decryption shifts to analyzing each “lane” (every Nth character) as an independent Caesar cipher.


Unlike ICE BREAKER (where threat is immediate and escalating), CIPHER GARDEN’s “threat” is cipher complexity. It’s a static property of the puzzle, not a dynamic chase.

Difficulty 1 (Trivial):

  • Caesar cipher with hints
  • 50–100 character plaintext
  • Frequency distribution strongly skewed (E, T very obvious)
  • Operator can solve with brute force (try all 26 shifts) in 2–3 minutes

Difficulty 2 (Easy):

  • Random substitution cipher with strong frequency distribution
  • 80–150 characters
  • Frequency analysis works; operator identifies 3–4 character mappings quickly
  • Most frequent characters (E, T, A) are obvious
  • Solve time: 10–15 minutes

Difficulty 3 (Medium):

  • Random substitution with flattened frequency (less obvious high/low peaks)
  • 150–300 characters
  • Operator needs to use multiple techniques: frequency + bigram patterns + known plaintext fragments
  • Solve time: 20–40 minutes

Difficulty 4 (Hard):

  • Vigenère cipher with unknown key length
  • 200–400 characters
  • Operator must perform Kasiski examination, then solve multiple Caesar ciphers
  • Solve time: 40–90 minutes

Difficulty 5 (Expert):

  • Hybrid cipher (Vigenère + transposition, or multiple layers)
  • 300–500 characters
  • Operator must detect and break multiple cipher types in sequence
  • Solve time: 90–180 minutes

Voice 1 (Ambient): Pitch corresponds to cipher complexity.

  • Difficulty 1: Low harmonic tone (220 Hz), very simple, almost musical
  • Difficulty 3: Dissonant mid-range tone (330 Hz), slightly chaotic
  • Difficulty 5: Harsh, atonal high-pitched noise (880 Hz+), almost unpleasant

Voice 2 (Exploration): Pulsing tone that accelerates as the operator makes correct mappings.

  • Slow pulse (1 Hz) when no mappings are made
  • Accelerates to 2 Hz, 4 Hz, 8 Hz as more letters are correctly mapped
  • Full exploration tone (continuous 440 Hz rise) when plaintext emerges

Voice 3 (Feedback): Event-based.

  • Short beep (330 Hz, 0.2s) when a single letter mapping is confirmed correct
  • Rising arpeggio (3-note, 0.5s) when a whole word or phrase is decrypted correctly
  • Descending buzz (100 Hz drop, 0.3s) when a hypothesis is tested and fails

CIPHER GARDEN uses the YM2149 to reinforce cryptographic learning, not to entertain.

Voice 1: Cipher Complexity (Ambient Mood)

Reflects the inherent difficulty of the puzzle. Sets the tone for how much work the operator expects.

  • Difficulty 1: Simple harmonic sine wave (220 Hz), unchanged throughout puzzle
  • Difficulty 3: Filtered square wave (330 Hz), slight harmonics
  • Difficulty 5: Harsh noise with no pitch, chaotic and challenging

Voice 1 never changes during a session. It’s set at puzzle load and persists until the plaintext is revealed.

Voice 2: Hypothesis Progress (Decryption Tracking)

Reflects the operator’s progress toward a solution. Fastest feedback loop.

  • Baseline: 220 Hz, 1 Hz pulse
  • Per correct letter mapped: +5 Hz frequency rise, +0.5 Hz pulse acceleration
  • Per word decrypted (4+ letters correct in sequence): +50 Hz jump
  • Full plaintext achieved: Rises to 880 Hz and sustains a major chord

The operator can “hear” whether they’re getting closer. An experienced player navigates by ear, glancing at the screen only to confirm partial progress.

Voice 3: Discrete Events (Feedback & Confirmation)

Immediate response to the operator’s actions.

ActionFreqDurationTone
Single letter mapped330 Hz0.1sBeep
Word decrypted440 Hz0.3sRising 4-note arpeggio
Hypothesis tested (correct)550 Hz0.5sResolving major chord
Hypothesis tested (incorrect)100 Hz0.3sDescending buzz
Cipher type identified660 Hz0.2s × 3Three quick stabs
Key length found (Vigenère)880 Hz1.0sSustained note, then drop

The 31-key input layout is adapted for CIPHER GARDEN’s specific needs.

KeyFunction in CIPHER GARDEN
QUOTEBookmark a character mapping for comparison (store to slot 1–8)
CONSEnter substitution table or crib mode
NILClear all mappings; reset to fresh start
LAMBDARecord a cipher-solving pattern (e.g., “frequency analysis then crib”) for replay
INFOCycle frequency displays (histogram, bigrams, expected distribution, IoC)
CARSelect previous ciphertext character (in substitution table)
APPLYAuto-apply frequency-based mapping suggestions
SYSSystem menu; pause puzzle
LINKSend encrypted message to another operator (linked mode)
BACKReturn to puzzle menu
CDRSelect next ciphertext character (in substitution table)
ATOMTest for polyalphabetic cipher; trigger Kasiski examination
EVALConfirm/verify current hypothesis or mapping
EQCompare two quoted mappings; test if plaintext emerges
KeyFunction in CIPHER GARDEN
0Enter plaintext character ‘A’ (or first character in alphabet)
1Enter plaintext character ‘B’
2Enter plaintext character ‘C’
(continuing 0–9)
. (Decimal Point)Space character (or special character)
ENT (Enter)Commit the entered mapping
+Increase frequency threshold for hints
-Decrease frequency threshold
÷Open solved ciphers archive / leaderboard
×Show extended frequency analysis

Alternative mapping (more thematic):

Using Lisp-inspired keys for letter entry:

  • Press CONS to enter substitution mode
  • Numpad 1–9 cycle through alphabet (1=A, 2=B, …, 9=I)
  • Numpad 0 = J
  • Repeated presses wrap around (0 → 0 again cycles J → K → … → Z → J)

This approach is slower but more thematically consistent with the deck’s Lisp philosophy. The standard 0–25 mapping is faster for experienced players.


CIPHER GARDEN’s cell types map directly to the cryptanalysis workflow.

Represents a single cipher puzzle.

typedef struct {
CellBase base;
char title[64]; /* "Substitution Puzzle #3" */
uint8_t cipher_type; /* 0=SUB, 1=TRANS, 2=VIGENERE, 3=FREQ, 4=OTP */
uint8_t difficulty; /* 1–5 */
char plaintext[512]; /* The original message */
char ciphertext[512]; /* Encrypted version */
uint8_t key[32]; /* For Vigenère: the key; for OTP: the pad */
uint8_t key_length; /* Variable-length keys */
uint16_t reward; /* Payout for solving */
uint16_t solve_time_sec; /* Time operator has spent so far */
uint8_t hint_count; /* How many hints remain available */
uint8_t solved; /* Boolean: is plaintext revealed? */
uint16_t time_to_solve_sec; /* Time recorded when puzzle was solved */
} PuzzleCell;

On Display:

┌─ CIPHER GARDEN: SUBSTITUTION ────────────────┐
│ Difficulty: ████░░░░░░ 4/5 (Hard) │
│ │
│ Ciphertext (300 chars): │
│ ZRCWQ YV R JQAARZPQ DSLJ GYQ RKMQAA │
│ DSVN RKQ JCQQYDVI. AKVQ YA NLV PQQQ │
│ │
│ Your mapping: Z→?, R→T, C→H, W→E, ... │
│ Confidence: 40% (some letters correct) │
│ │
│ [INFO: freq analysis CONS: substitution] │
│ [EVAL: test hypothesis ATOM: cipher type] │
└────────────────────────────────────────────────┘

Shows detailed cryptanalysis data for the current puzzle.

typedef struct {
CellBase base;
PuzzleCell *parent_puzzle; /* Reference back to the puzzle */
uint16_t char_freq[256]; /* Count of each character in ciphertext */
uint8_t char_rank[256]; /* Sorted rank of characters by frequency */
uint16_t bigram_freq[256][256]; /* Frequency of two-character combinations */
uint16_t bigram_count; /* Total bigrams */
float ioc_value; /* Index of Coincidence (0.0–1.0) */
uint8_t display_mode; /* 0=histogram, 1=bigrams, 2=expected, 3=IoC */
} FrequencyAnalysisCell;

Handler implementations:

ON_CAR(FrequencyAnalysisCell *self) {
/* Drill into frequency distribution for a specific character */
FrequencyDetailCell *detail = create_detail_for_char(
self->char_rank[0] /* Most frequent character */
);
drill_into(detail);
}
ON_CDR(FrequencyAnalysisCell *self) {
/* Next character in frequency order */
next_sibling();
}
ON_INFO(FrequencyAnalysisCell *self) {
/* Cycle display mode */
self->display_mode = (self->display_mode + 1) % 4;
}
ON_EQ(FrequencyAnalysisCell *self) {
/* Compare this frequency distribution to English baseline */
show_comparison_overlay(self->char_freq, english_baseline);
}

Represents the operator’s current working mapping.

typedef struct {
CellBase base;
PuzzleCell *parent_puzzle; /* Reference to puzzle */
uint8_t mapping[256]; /* ciphertext_char → plaintext_char */
uint8_t confidence[256]; /* Confidence for each mapping (0–100) */
uint16_t partial_plaintext_length; /* How many chars are correctly mapped */
uint8_t is_valid; /* Does current plaintext make sense? */
uint8_t selected_cipher_char; /* Which char are we mapping now */
} SubstitutionTableCell;

Handler implementations:

ON_CONS(SubstitutionTableCell *self) {
/* Enter mapping entry mode */
show_mapping_entry_prompt(self->selected_cipher_char);
}
ON_NUMPAD(SubstitutionTableCell *self, uint8_t digit) {
/* Enter plaintext character hypothesis */
uint8_t plaintext_char = 'A' + digit;
self->mapping[self->selected_cipher_char] = plaintext_char;
refresh_partial_plaintext(self);
sfx_mapping_confirmed();
}
ON_EQ(SubstitutionTableCell *self) {
/* Test current mapping: does partial plaintext make sense? */
verify_mapping(self);
if (is_valid_plaintext(self->mapping)) {
show_victory_overlay();
record_solve_time(self->parent_puzzle);
} else {
show_error_locations(self->mapping, self->parent_puzzle->plaintext);
}
}
ON_EVAL(SubstitutionTableCell *self) {
/* Commit current mapping; mark as confirmed */
self->confidence[self->selected_cipher_char] = 100;
move_to_next_unmapped_char(self);
}

Provides cryptanalysis hints.

typedef struct {
CellBase base;
PuzzleCell *parent_puzzle; /* Reference to puzzle */
uint8_t hint_tier; /* 0=frequency, 1=bigram, 2=crib, 3=key_length */
uint8_t hints_remaining; /* Max 3 per puzzle */
char hint_text[256]; /* "This character appears 18 times. E appears ~13% in English." */
} HintCell;

Handler implementations:

ON_EVAL(HintCell *self) {
/* Display the hint */
show_hint(self->hint_text);
self->hints_remaining--;
sfx_hint_revealed(); /* Soft beep, no penalty to score */
}

Shows solve times and rankings for the operator and other players (if linked).

typedef struct {
CellBase base;
uint8_t puzzle_id; /* Which puzzle is this leaderboard for */
struct {
char operator_name[12];
uint16_t solve_time_sec;
uint8_t difficulty_solved;
char timestamp[16];
} entries[32]; /* Top 32 solvers */
uint8_t entry_count;
uint8_t player_rank; /* Where does current operator rank */
} LeaderboardCell;

8. DECRYPTION SESSION WALKTHROUGH: “THE CRACK”

Section titled “8. DECRYPTION SESSION WALKTHROUGH: “THE CRACK””

An operator with reputation 8 (Territorial Analyst, newly unlocked CIPHER GARDEN) loads the cartridge and selects their first MESSAGE DECRYPTION bounty.

Boot sequence: Bureau 9 loading screen. Dead silence. Text types across the screen mechanically. Progress bar fills silently. 2.8 seconds.

Cipher Garden mission board appears:

╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN — CRYPTOGRAPHIC PRACTICE ║
╠════════════════════════════════════════════════════╣
║ ║
║ [■] CIPHER PRACTICE ║
║ Substitution (Difficulty 2) ║
║ Reward: 75 ¤ + speedrun bonus (5 min) ║
║ Est. time: 10–15 minutes ║
║ ║
║ [■] MESSAGE DECRYPTION ║
║ Vigenère cipher, key length unknown ║
║ Reward: 200 ¤ ║
║ Est. time: 30–45 minutes ║
║ ║
║ [■] FREQUENCY ANALYSIS PUZZLE ║
║ (Requires cipher_mastery ≥ 40, locked) ║
║ ║
╠════════════════════════════════════════════════════╣
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝

Operator selects the MESSAGE DECRYPTION bounty (second option). Presses EVAL to accept.

The puzzle initializes. The screen shows:

╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN — MESSAGE DECRYPTION ║
╠════════════════════════════════════════════════════╣
║ Difficulty: ████░░░░░░ 3/5 (Medium) ║
║ ║
║ Ciphertext (180 chars): ║
║ ║
║ ZRG RZ A JQAARZPQ DSLJ GYQ AKMQAA. YLVD ║
║ YV R NVAV OVEQFA. ZRCWQ YV PVVPVI YRFVW ║
║ RKQ JCQQYDVI DVQQ ZVRL ZVCQY. DVSSQVA ║
║ JCQQYDVI PQYRSS ║
║ ║
║ [Press INFO for frequency analysis] ║
│ ║
╠════════════════════════════════════════════════════╣
║ CAR/CDR: navigate CONS: substitution INFO: freq ║
║ ATOM: cipher type EVAL: test hypothesis ║
╚════════════════════════════════════════════════════╝

Voice 1 plays a dissonant mid-range tone (difficulty 3 = somewhat chaotic). Voice 2 begins a slow pulse (1 Hz) — no mappings yet.

The operator examines the ciphertext. They note:

  • Multiple single-letter words: “R”, “A” → likely “A” or “I”
  • “ZRG RZ A” looks like “THE TH ?” — possibly “THE THE A”
  • Word “JQAARZPQ” has repeating letters: ”??AAAA??” → suggests double letters in plaintext

The operator presses INFO to see frequency analysis:

╔════════════════════════════════════════════════════╗
║ FREQUENCY ANALYSIS ║
├────────────────────────────────────────────────────┤
║ Char Count %age Expected(English) ║
║ ───────────────────────────────────────────────── ║
║ R 18 10.0% E: 12.7% ║
║ Z 17 9.4% T: 9.1% ║
║ G 14 7.8% A: 8.2% ║
║ A 14 7.8% O: 7.5% ║
║ D 11 6.1% I: 7.0% ║
║ ... ║
╚════════════════════════════════════════════════════╝

The operator notes: R is most frequent (10%) → likely E. Z is next → likely T. G and A are equal → could be A and O.

The operator presses CONS to enter substitution mode:

╔════════════════════════════════════════════════════╗
║ SUBSTITUTION MAPPING ║
├────────────────────────────────────────────────────┤
║ Ciphertext Hypothesis ║
║ ───────────────────────────────────────────────── ║
║ R → E (highest frequency) ║
║ Z → T (second highest) ║
║ G → A (third highest) ║
║ A → O (fourth) ║
║ ║
║ Partial plaintext: ║
║ ETA ET A ???AA??? DOLT OAE AFEA??. OLEQ ║
║ OE A ?EAE ?EA???. ????A?E OE ????OI OAAE ║
║ ║
║ [CDR: next char CONS: edit mapping EQ: test] ║
╚════════════════════════════════════════════════════╝

The partial plaintext is gibberish. “DOLT” suggests the ciphertext D is not L (the “DLT” structure doesn’t match English). The operator realizes they need more mappings.

They press CDR repeatedly to cycle through the next most frequent characters and make more guesses:

  • R → E (confident)
  • Z → T (confident)
  • G → A (testing)
  • A → O (testing)
  • D → ? (unknown, try S)

After trying D → S: partial plaintext improves: “ETA ET A SFFAAFE…” — better, but still not coherent.

The operator presses EQ to test the current hypothesis. Voice 2 produces a descending buzz (incorrect hypothesis). The system shows:

╔════════════════════════════════════════════════════╗
║ HYPOTHESIS TEST FAILED ║
├────────────────────────────────────────────────────┤
║ Issues found: ║
║ - D→S creates "SFFAA" (unlikely double-F) ║
║ - G→A in "???AA???" creates "???AA???" with A ║
║ adjacent, but this is "JQAARZPQ" — try G→R? ║
║ ║
║ Recommendation: Try different mappings for D, G ║
║ ║
║ [BACK: return to table INFO: freq hints] ║
╚════════════════════════════════════════════════════╝

The operator now tries G → H instead of A. Partial plaintext: “ETA ET A ???HA???” → improvement!

They continue refining. After 15 minutes of hypothesis testing, they’ve built a strong mapping:

  • R→E, Z→T, G→H, A→I, D→S, C→W, W→E…

Wait, two characters map to E? The system warns them. They correct: W→I (but R already maps to E, so this is a conflict).

The operator backs up and re-evaluates. After another 5 minutes of careful analysis, they narrow down to:

  • R→E, Z→T, G→H, A→I, D→N, C→W, W→R, Q→E…

Wait, two map to E again. The operator realizes: this might be a Vigenère cipher, not a simple substitution!

Cipher Type Identification (0:25 – 0:30)

Section titled “Cipher Type Identification (0:25 – 0:30)”

The operator presses ATOM to test whether the cipher is polyalphabetic:

╔════════════════════════════════════════════════════╗
║ CIPHER TYPE ANALYSIS ║
├────────────────────────────────────────────────────┤
║ Frequency distribution: ║
║ R: 10.0%, Z: 9.4%, G: 7.8% ║
║ This is relatively flat (not skewed like ║
║ a simple substitution with E at 13%) ║
║ ║
║ Repeating substrings detected: ║
║ ZRG (positions 1, 10, 45) → gaps: 9, 35 ║
║ A (positions 5, 8, 15, 22, 29...) → irregular ║
║ ║
║ ASSESSMENT: Likely VIGENÈRE (polyalphabetic) ║
║ ║
║ Kasiski examination suggests key length: 5 or 6 ║
║ ║
║ [EVAL: proceed with Vigenère analysis] ║
╚════════════════════════════════════════════════════╝

The operator presses EVAL. The cipher type changes to VIGENÈRE mode.

The screen shifts to Kasiski examination and lane analysis:

╔════════════════════════════════════════════════════╗
║ VIGENÈRE DECRYPTION: KEY LENGTH ANALYSIS ║
├────────────────────────────────────────────────────┤
║ Most likely key lengths: 5, 6 ║
║ ║
║ Testing key length 5: ║
║ Lane 0 (every 5th char): ZDZJQ... (freq: skewed)║
║ Lane 1: RQARZ... (freq: skewed) ║
║ Lane 2: GJSAQ... (freq: skewed) ║
║ Lane 3: ADLRA... (freq: skewed) ║
║ Lane 4: RGQZQ... (freq: skewed) ║
║ ║
║ VERDICT: Each lane shows distinct frequency. ║
║ KEY LENGTH 5 is correct! ║
║ ║
║ [CDR: try next length EVAL: solve with 5] ║
╚════════════════════════════════════════════════════╝

The operator presses EVAL. The system switches to solving 5 independent Caesar ciphers (one per lane). Voice 1 maintains the dissonant tone (still cipher 3 difficulty). Voice 2 accelerates as each lane is solved:

The operator applies frequency analysis to Lane 0: most frequent char is Z → likely E (shift 5). Lane 0 decrypts to “EESTI…” (Estonian? English?). Hmm.

They try Lane 0 with Z → T (shift 13): “TTSSF…” Worse.

They try Z → E (shift 5) again: “EESTI…” Looks like “MEET…” if E → M somehow. But that’s a decryption error. Wait…

The operator realizes: Lane 0 has Z → E, but the other lanes have different shifts. They apply frequency analysis independently to each lane:

  • Lane 0: Z→E (shift 5)
  • Lane 1: R→H (shift 10)
  • Lane 2: G→O (shift 4)
  • Lane 3: A→W (shift 22)
  • Lane 4: R→S (shift 3)

Reconstructing with the key [E, H, O, W, S] (or equivalently, shifts [5, 10, 4, 22, 3])… the plaintext emerges:

THE THE TIMES COME THESE LETTERS. WHICH MAY CONFIRM YOUR SUSPICIONS ABOUT NEURAL NETWORK...

Voice 2 soars to 880 Hz and resolves into a major chord. Voice 1 and 3 fade. The plaintext is revealed:

╔════════════════════════════════════════════════════╗
║ PLAINTEXT REVEALED ║
├────────────────────────────────────────────────────┤
║ ║
║ The the times come these letters. Which may ║
║ confirm your suspicions about neural network ║
║ intrusion. Somebody is controlling the system. ║
║ Send details to Station Seven. ║
║ ║
╠════════════════════════════════════════════════════╣
║ ✓ CIPHER CRACKED! ║
║ ║
║ Time: 0:42 (42 minutes) ║
║ Difficulty: 3/5 (Medium) ║
║ No hints used. ║
║ ║
║ Reward: 200 ¤ base ║
║ +0 ¤ (no speedrun bonus; limit was 30m) ║
║ ×1.51 cipher_mastery multiplier (40+) ║
║ ×1.08 rep multiplier (rep 8) ║
║ ═══════════════════════════════════════ ║
║ TOTAL: 325 ¤ ║
║ ║
║ cipher_mastery: +2 (MESSAGE DECRYPTION) ║
║ Cipher Garden reputation progress: +1 ║
╚════════════════════════════════════════════════════╝

The operator presses EVAL to confirm and return to the mission board.

The cipher garden mission board refreshes. A new MESSAGE DECRYPTION bounty appears. The operator has completed one puzzle in 45 minutes and earned 325 ¤ and 2 points of cipher_mastery. No reputation gain (MESSAGE DECRYPTION doesn’t grant rep, only cipher_mastery).


9. HOT SWAP INTEGRATION: COUNTER-INTELLIGENCE CAMPAIGN

Section titled “9. HOT SWAP INTEGRATION: COUNTER-INTELLIGENCE CAMPAIGN”

CIPHER GARDEN’s signature campaign is COUNTER-INTELLIGENCE: a 2-phase mission spanning ICE BREAKER → CIPHER GARDEN.

Mission: Penetrate an encrypted communications network and extract message archives.

Objective: Data extraction. The operator must reach the network’s communication server and copy encrypted message files.

Deliverable: Raw encrypted messages (format: Vigenère-encrypted with known plaintext hints visible in metadata).

Threat: Network security is active. ICE patrols the communication node. Reaching the server requires standard ICE BREAKER evasion.

Duration: 15–30 minutes (typical ICE BREAKER contract).

Payout at end of Phase 1: 600 ¤

Mission: Decrypt the intercepted messages and extract intelligence.

Objective: Cryptanalysis. The operator must decrypt the message archive, revealing hidden operational details.

Input from Phase 1: Encrypted message file (automatically transferred to CIPHER GARDEN phase state). File contains 5–10 messages, each encrypted with a Vigenère cipher. Some messages share a key; others use different keys.

Difficulty: Threat 3–4 equivalent. The first message is straightforward (simple substitution); subsequent messages are Vigenère-encrypted with varying key lengths.

Deliverable: Decrypted message archive. The plaintext reveals contacts, operational plans, financial details, or command structure.

Duration: 20–45 minutes (multiple ciphers to crack).

Payout at end of Phase 2: 600 ¤ + 300 ¤ (cross-phase bonus) = 900 ¤ total for Phase 2.

Campaign Total: 1,500 ¤ for 35–75 minutes of gameplay.

Reputation Gain: +3 (threat 3–4 spanning two modules) + 1 (multi-phase completion) = +4 total.

Cipher voice at campaign start (after Phase 1 completion):

MESSAGES EXTRACTED. ENCRYPTED TRANSMISSIONS DETECTED. YOU NOW HAVE CRYPTANALYSIS CAPABILITY. DECRYPT THE ARCHIVE.

Between phases:

The nOSh runtime displays the phase transition screen:

╔════════════════════════════════════════════════════╗
║ PHASE 1 COMPLETE: NETWORK INTRUSION ║
╠════════════════════════════════════════════════════╣
║ Encrypted message archive extracted. ║
║ 7 messages recovered (file size: 2.3 KB). ║
║ ║
║ Archive contains: ║
║ - 4× Vigenère-encrypted (key length 5–8) ║
║ - 2× Substitution-encrypted (simple) ║
║ - 1× One-time-pad (unsolvable; see metadata) ║
║ ║
╠════════════════════════════════════════════════════╣
║ PHASE 2 REQUIRES: CIPHER GARDEN ║
║ INSERT MODULE: CIPHER GARDEN ║
║ PHASE CHAIN ACTIVE — DO NOT POWER DOWN ║
╚════════════════════════════════════════════════════╝

The operator physically swaps the cartridge.

Cipher voice at Phase 2 start:

CIPHER GARDEN LOADED. PHASE CHAIN RESUMED. THE ENCRYPTED MESSAGES AWAIT ANALYSIS. YOUR CIPHER_MASTERY WILL DETERMINE SUCCESS.


CIPHER GARDEN adheres to the universal screen anatomy (per CLAUDE.md Canonical Hardware Specification and software/cartridges/authoring/screen-design-rules.md): Row 0 = status bar (firmware), Rows 1–23 = content (cartridge), Row 24 = action bar (firmware).

╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── MISSION BOARD ─────────────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ ▸ CIPHER PRACTICE ║
║ Substitution (Caesar) — Difficulty 1 ║
║ 50–100 characters, 5 min solution time (est) ║
║ Reward: 50 ¤ base ║
║ ──────────────────────────────────────────── ║
║ (1 of 4) ║
║ ║
║ MESSAGE DECRYPTION ║
║ Vigenère cipher, key length unknown ║
║ 150–300 characters, 30 min (est) ║
║ Reward: 200 ¤ ║
║ ──────────────────────────────────────────── ║
║ (2 of 4) ║
║ ║
║ FREQUENCY ANALYSIS PUZZLE ║
║ [LOCKED — cipher_mastery ≥ 40 required] ║
║ ║
║ ENCRYPTED LINK SESSION ║
║ [LOCKED — rep ≥ 25 required] ║
║ ║
╠════════════════════════════════════════════════════╣
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝

Wireframe 2: Substitution Puzzle (Initial)

Section titled “Wireframe 2: Substitution Puzzle (Initial)”
╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── SUBSTITUTION CIPHER ─────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ Difficulty: ██░░░░░░░░ 2/5 (Easy) ║
║ ║
║ Ciphertext (80 chars): ║
║ WKUHD LV D PHVVDJH IURP WKH DEYVA ║
║ ║
║ Your progress: ║
║ Mappings: 0/26 ║
║ Confidence: 0% ║
║ Est. confidence threshold: 70% for victory ║
║ ║
║ [Press INFO for frequency histogram] ║
║ [Press CONS to enter substitution mode] ║
║ ║
╠════════════════════════════════════════════════════╣
║ INFO: freq CONS: subst ATOM: type EVAL: test ║
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝
╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── FREQUENCY ANALYSIS ──────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ Character Frequency (sorted): ║
║ ───────────────────────────────────────────── ║
║ W ██████████ 12 times (10.3%) E: 12.7% ║
║ K █████████░ 11 times (9.4%) T: 9.1% ║
║ U █████████░ 11 times (9.4%) A: 8.2% ║
║ H ████████░░ 9 times (7.7%) O: 7.5% ║
║ D ███████░░░ 8 times (6.8%) I: 7.0% ║
║ V ███████░░░ 8 times (6.8%) N: 6.7% ║
║ I ██████░░░░ 7 times (6.0%) S: 6.3% ║
║ R ██████░░░░ 7 times (6.0%) H: 6.1% ║
║ P ████░░░░░░ 5 times (4.3%) R: 6.0% ║
║ J ████░░░░░░ 5 times (4.3%) L: 4.0% ║
║ ║
║ Hypothesis: W→E, K→T, U→A, H→O, D→I ║
║ ║
╠════════════════════════════════════════════════════╣
║ CAR: prev CDR: next INFO: bigrams EVAL: test ║
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝
╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── SUBSTITUTION TABLE ─────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ Cipher → Plain Cipher → Plain Cipher → Plain ║
║ ───────────────────────────────────────────── ║
║ A → ? J → ? S → ? ║
║ B → ? K → T T → ? ║
║ C → ? L → ? U → A ║
║ D → I M → ? V → ? ║
║ E → ? N → ? W → E ║
║ F → ? O → ? X → ? ║
║ G → ? P → ? Y → ? ║
║ H → O Q → ? Z → ? ║
║ I → ? R → ? ║
║ ║
║ Partial plaintext: ║
║ "THERE IS A MESSAGE FROM THE ABYSS" ║
║ Confidence: 85% (5 correct, 1 conflict) ║
║ ║
╠════════════════════════════════════════════════════╣
║ CAR: prev CDR: next CONS: edit EVAL: confirm ║
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝
╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── VIGENÈRE KEY LENGTH ──────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ Kasiski Examination (repeating substrings): ║
║ ───────────────────────────────────────────── ║
║ "ZRG" at positions 5, 23, 41 → gaps: 18, 18 ║
║ "RZA" at positions 12, 36, 60 → gaps: 24, 24 ║
║ "DQZA" at positions 8, 32, 56 → gaps: 24, 24 ║
║ ║
║ GCD (greatest common divisor) of gaps: ║
║ GCD(18, 24) = 6 ║
║ ║
║ Key length candidates: 2, 3, 6 ║
║ Most likely: 6 ║
║ ║
║ [CDR: test 3 CONS: test 2 EVAL: solve with 6] ║
║ ║
╠════════════════════════════════════════════════════╣
║ INFO: freq ATOM: lanes CONS: test key length ║
║ cipher_mastery: 15 | Credits: 2,200 | Rep: 8 ║
╚════════════════════════════════════════════════════╝
╔════════════════════════════════════════════════════╗
║ CIPHER GARDEN ── VICTORY ─────────────────────── ║
╠════════════════════════════════════════════════════╣
║ ║
║ ✓ SUBSTITUTION CIPHER CRACKED! ║
║ ║
║ Plaintext revealed: ║
║ "THERE IS A MESSAGE FROM THE ABYSS. SOME OF ║
║ THE LETTERS HAVE BEEN CHANGED. HERE IS ONE ║
║ MORE CLUE." ║
║ ║
║ ───────────────────────────────────────────── ║
║ SCORING ║
║ Difficulty (2/5) .......... × 1.5 multiplier ║
║ Base reward ............... 50 ¤ ║
║ Speedrun bonus ............ +20 ¤ (5 min) ║
║ Cipher mastery mult ....... × 1.10 (15+) ║
║ Rep mult .................. × 1.08 (8) ║
║ ───────────────────────────────────────────── ║
║ TOTAL PAYOUT .............. 77 ¤ ║
║ ║
║ cipher_mastery: +1 ║
║ Leaderboard: Rank 12 (fastest time today) ║
║ ║
║ [EVAL: return to board] ║
║ ║
╠════════════════════════════════════════════════════╣
║ CAR: next puzzle BACK: quit EVAL: continue ║
║ cipher_mastery: 16 | Credits: 2,277 | Rep: 8 ║
╚════════════════════════════════════════════════════╝

CIPHER GARDEN intentionally avoids time pressure. The learning curve requires deliberation. An operator who rushes through a Vigenère cipher will fail (they’ll give up when the first hypothesis doesn’t work). An operator who methodically analyzes wins.

This creates a different skill expression than ICE BREAKER. ICE BREAKER teaches tempo and decision-making under pressure. CIPHER GARDEN teaches patience and analytical depth.

The frequency analysis tool does not solve ciphers automatically. It provides data. The operator must interpret the data. This mirrors real cryptanalysis: statistical tools narrow the search space, but the human mind must recognize patterns.

An operator with zero cryptography background can complete CIPHER GARDEN bounties using brute force (trying all 26 Caesar shifts). An operator with cipher_mastery 40+ solves the same puzzles in 1/3 the time using statistical shortcuts. Both paths are valid.

CIPHER GARDEN pairs with:

  • ICE BREAKER: Extract encrypted messages, then decrypt them
  • The Vault: Unlock encrypted research entries with cryptanalysis skills
  • Black Ledger: Decrypt financial records, then trace the transactions
  • Null: Diagnostic module can verify cipher entropy and key strength

CIPHER GARDEN is fully playable without sound (frequency analysis tables are purely visual). It’s fully playable without pressure (no time limits, no failure states). Operators with different learning styles succeed here: visual learners use the frequency histograms, auditory learners use Voice 2’s progress pulse, kinesthetic learners map letters by trial-and-error.


This section specifies the exact YM2149 register initialization and state transitions for CIPHER GARDEN’s three-voice audio system.

Voice 1: Cipher Complexity Indicator (Ambient Tone)

Section titled “Voice 1: Cipher Complexity Indicator (Ambient Tone)”

Purpose: Static tone at game start reflecting cipher difficulty. Higher difficulty = higher pitch (dissonant).

Initialization:

// At puzzle load:
uint8_t cipher_base_freq = cipher_type_to_frequency(puzzle->cipher_type);
// Caesar = 220 Hz, Substitution = 330 Hz, Vigenère = 440 Hz, OTP = 880 Hz
// YM2149 register setup:
YM2149_REG[0x00] = (cipher_base_freq & 0xFF); // Tone A Period low byte
YM2149_REG[0x01] = ((cipher_base_freq >> 8) & 0x0F); // Tone A Period high nibble
YM2149_REG[0x08] = 0x0C; // Amplitude A = 0x0C (medium volume, non-envelope)
YM2149_REG[0x07] = 0xFE; // Enable Tone A; disable B, C

Frequency Mapping Table:

Cipher TypeFrequencyRegister Value (hex)Character
Caesar (simple)220 Hz0x0059Warm hum
Substitution330 Hz0x003CMid tone
Transposition440 Hz0x002DClear beep
Vigenère (complex)660 Hz0x001EHigh clarion
One-Time Pad (unsolvable)880 Hz0x0016Piercing tone

Voice 1 remains constant during the puzzle. On exit, it fades via envelope decay (1-second release).

Voice 2: Hypothesis Progress Pulse (Kinesthetic Feedback)

Section titled “Voice 2: Hypothesis Progress Pulse (Kinesthetic Feedback)”

Purpose: Accelerating pulse as operator correctly maps characters. Pulse rate increases from 1 Hz → 8 Hz as substitution table fills.

Initialization:

YM2149_REG[0x02] = 0x3C; // Tone B Period = 330 Hz (baseline)
YM2149_REG[0x09] = 0x00; // Amplitude B = 0x00 (silence initially; envelope-driven)
YM2149_REG[0x0D] = 0x0B; // Envelope Shape 0x0B: sustain + release (pulsing)
YM2149_REG[0x0B] = 0x12; // Envelope Period low byte
YM2149_REG[0x0C] = 0x7A; // Envelope Period high byte = 0x7A12 (1 Hz pulse)
YM2149_REG[0x07] = 0xFD; // Enable Tone B with envelope

Pulse Rate Modulation (per character mapped):

void update_voice2_pulse(PuzzleCell *puzzle) {
// Count correctly mapped characters
uint8_t mapped_count = count_mapped_characters(puzzle);
uint8_t total_chars = puzzle->plaintext_length;
uint8_t percent_mapped = (mapped_count * 100) / total_chars;
// Pulse rate acceleration curve (linear):
// 0% mapped = 1 Hz, 100% mapped = 8 Hz
uint8_t pulse_freq = 1 + ((percent_mapped / 100) * 7); // 1–8 Hz
// Envelope period = (2MHz) / (16 × pulse_freq)
uint16_t envelope_period = (2000000) / (16 * pulse_freq);
YM2149_REG[0x0B] = (envelope_period & 0xFF);
YM2149_REG[0x0C] = ((envelope_period >> 8) & 0xFF);
YM2149_REG[0x07] = 0xFD; // Re-enable Voice B with new rate
}

Audio Feedback: As operator maps letters (A→Q, B→R, C→S…), they hear the pulse accelerate. At 100% completion, Voice 2 pulses at 8 Hz (perceivable as a rapid buzz). This kinesthetic feedback provides real-time progress without looking at screen.

Voice 3: Discrete Events (Confirmation/Error)

Section titled “Voice 3: Discrete Events (Confirmation/Error)”

Purpose: Event-driven feedback for hypothesis testing results, word detection, Kasiski completion.

Event Sound Map:

enum CipherEvent {
EVENT_CORRECT_LETTER = 0, // 440 Hz beep, 0.1s
EVENT_WORD_DETECTED = 1, // 440–550–659 Hz arpeggio (major triad), 0.5s
EVENT_HYPOTHESIS_FAIL = 2, // 165 Hz buzz, 0.3s (error tone)
EVENT_KASISKI_COMPLETE = 3, // 880 Hz + 440 Hz harmony, 0.6s
EVENT_CIPHER_SOLVED = 4, // Rising arpeggio 440–554–659–880, 1s (victory)
};
void play_cipher_event(CipherEvent event) {
switch (event) {
case EVENT_CORRECT_LETTER:
// Play 440 Hz for 0.1s
YM2149_REG[0x04] = 0x2D; // Tone C = 440 Hz
YM2149_REG[0x0A] = 0x0F; // Amplitude = max
YM2149_REG[0x07] = 0xFB; // Enable Tone C only
// After 0.1s, silence
YM2149_REG[0x07] = 0xFF;
break;
case EVENT_WORD_DETECTED:
// Play major triad (440 Hz / 550 Hz / 659 Hz) simultaneously
YM2149_REG[0x00] = 0x2D; // Voice A = 440 Hz
YM2149_REG[0x02] = 0x23; // Voice B = 550 Hz (computed from 2MHz / (16 × 550))
YM2149_REG[0x04] = 0x1B; // Voice C = 659 Hz
YM2149_REG[0x08] = 0x0C; // Amplitude A
YM2149_REG[0x09] = 0x0C; // Amplitude B
YM2149_REG[0x0A] = 0x0C; // Amplitude C
YM2149_REG[0x07] = 0xF8; // Enable all three voices
// After 0.5s, silence
YM2149_REG[0x07] = 0xFF;
break;
case EVENT_HYPOTHESIS_FAIL:
// Play 165 Hz error buzz for 0.3s
YM2149_REG[0x04] = 0x7A; // Tone C = 165 Hz
YM2149_REG[0x0A] = 0x08; // Amplitude = medium
YM2149_REG[0x07] = 0xFB;
// After 0.3s, silence
YM2149_REG[0x07] = 0xFF;
break;
case EVENT_CIPHER_SOLVED:
// Rising arpeggio: 440 → 554 → 659 → 880 Hz (each 0.25s)
// Requires sequencing four tones
for (int i = 0; i < 4; i++) {
uint16_t freq_hz[] = {440, 554, 659, 880};
uint16_t tone_period = (2000000) / (16 * freq_hz[i]);
YM2149_REG[0x04] = (tone_period & 0xFF);
YM2149_REG[0x05] = ((tone_period >> 8) & 0x0F);
YM2149_REG[0x0A] = 0x0F; // Full amplitude
YM2149_REG[0x07] = 0xFB; // Enable Tone C
// Wait 0.25s
}
YM2149_REG[0x07] = 0xFF; // Silence
break;
}
}

This section specifies how CIPHER GARDEN generates puzzles deterministically from deck state, threat level, and LFSR seed.

Each puzzle is seeded by: (operator_reputation, cartridge_history, threat_level, session_seed, lfsr_state)

struct PuzzleGenSeed {
uint8_t threat_level; /* 1–5 */
uint32_t cartridge_history; /* 32-bit bitfield from deck state */
uint8_t cipher_mastery; /* 0–255 */
uint32_t lfsr_state; /* LFSR for pseudorandom generation */
uint32_t session_seed; /* Timestamp of session start */
};
void generate_puzzle(PuzzleCell *puzzle, PuzzleGenSeed *seed) {
// Step 1: Determine cipher type based on threat and mastery
uint8_t cipher_type = select_cipher_type(seed->threat_level, seed->cipher_mastery);
// Step 2: Generate plaintext vocabulary
const char *vocabulary[] = {/* English dictionary or cipher garden domain vocab */};
uint8_t plaintext_len = 200 + seed->lfsr_state % 200; // 200–400 chars
char *plaintext = generate_plaintext(vocabulary, plaintext_len, seed->lfsr_state);
// Step 3: Generate cipher key
uint8_t key[32];
generate_cipher_key(key, cipher_type, seed->lfsr_state);
// Step 4: Encrypt plaintext
uint8_t ciphertext[512];
uint16_t ciphertext_len = encrypt_plaintext(plaintext, plaintext_len, key,
cipher_type, ciphertext);
// Step 5: Store in puzzle cell
puzzle->cipher_type = cipher_type;
puzzle->plaintext_length = plaintext_len;
puzzle->ciphertext_length = ciphertext_len;
memcpy(puzzle->plaintext, plaintext, plaintext_len);
memcpy(puzzle->ciphertext, ciphertext, ciphertext_len);
memcpy(puzzle->key, key, 32);
puzzle->puzzle_seed = seed->lfsr_state; // For deterministic replay
}
uint8_t select_cipher_type(uint8_t threat_level, uint8_t cipher_mastery) {
// Threat determines difficulty floor; mastery determines ceiling
switch (threat_level) {
case 1: // Threat 1: Caesar only
return CAESAR;
case 2: // Threat 2: Caesar or Substitution
if (cipher_mastery < 30) return CAESAR;
else return (lfsr_random() % 2) ? CAESAR : SUBSTITUTION;
case 3: // Threat 3: Substitution, Transposition, Vigenère
if (cipher_mastery < 60) return SUBSTITUTION;
else return SUBSTITUTION + (lfsr_random() % 3); // 0=sub, 1=trans, 2=vig
case 4: // Threat 4: Advanced (Vigenère, hybrid)
if (cipher_mastery < 120) return VIGENERE;
else return VIGENERE + (lfsr_random() % 2); // 0=vig, 1=hybrid
case 5: // Threat 5: One-time pad (unsolvable) or advanced cipher
return (cipher_mastery < 200) ? OTP : OTP; // OTP always unsolvable
}
}
char *generate_plaintext(const char **vocab, uint16_t target_length,
uint32_t lfsr_state) {
char plaintext[512] = {0};
uint16_t pos = 0;
// Build plaintext from vocabulary words + random padding
while (pos < target_length) {
uint8_t word_idx = lfsr_random() % VOCAB_SIZE;
const char *word = vocab[word_idx];
uint8_t word_len = strlen(word);
if (pos + word_len + 1 <= target_length) {
memcpy(plaintext + pos, word, word_len);
pos += word_len;
plaintext[pos++] = ' '; // Space separator
}
}
plaintext[target_length] = '\0';
return plaintext;
}
void generate_cipher_key(uint8_t *key, uint8_t cipher_type, uint32_t lfsr_state) {
switch (cipher_type) {
case CAESAR:
// Caesar: key is single shift value (0–25)
key[0] = lfsr_random() % 26;
break;
case SUBSTITUTION:
// Substitution: key is 26-byte permutation (A→?, B→?, ..., Z→?)
for (int i = 0; i < 26; i++) {
key[i] = (i + (lfsr_random() % 26)) % 26; // Randomized permutation
}
break;
case VIGENERE:
// Vigenère: key is keyphrase (5–8 chars repeated)
uint8_t key_len = 5 + (lfsr_random() % 4); // 5–8 char key
for (int i = 0; i < key_len; i++) {
key[i] = 'A' + (lfsr_random() % 26); // Random A–Z
}
key[key_len] = '\0';
break;
case OTP:
// One-Time Pad: key is 256 random bytes (unsolvable without key)
for (int i = 0; i < 256; i++) {
key[i] = lfsr_random() % 256;
}
break;
}
}

Puzzles with the same puzzle_seed always generate identical plaintext/ciphertext. This enables operators to replay puzzles or share puzzle IDs:

bool is_puzzle_solvable(PuzzleCell *puzzle) {
// OTP puzzles are unsolvable (no key derivable from ciphertext)
if (puzzle->cipher_type == OTP) return false;
// All other cipher types are solvable via statistical analysis or brute force
return true;
}

Screen 6A: Crib Mode Interface (Known Plaintext Attack)

Section titled “Screen 6A: Crib Mode Interface (Known Plaintext Attack)”
CIPHER GARDEN ──── CRIB MODE: KNOWN PLAINTEXT ATTACK ───────────
Enter known plaintext (portion of text you expect in message):
┌──────────────────────────────────────────────────────────────┐
│ THE MEETING IS AT NOON │
└──────────────────────────────────────────────────────────────┘
Searching ciphertext for matches...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45%
Matches found: 3
Match 1: Position 87 (offset +0)
PLAINTEXT: THE MEETING IS AT NOON
CIPHERTEXT: UMH QHHWLQJ LV DW QRRQ
CONFIDENCE: 87% (substitution alphabet consistent)
[CAR to map]
Match 2: Position 156 (offset +1)
Alignment failed (letter repeat mismatch)
Match 3: Position 34 (offset -2)
PLAINTEXT: THE MEETING IS AT NOON
CIPHERTEXT: WIG OHHWLJG OW IW GMMQ
CONFIDENCE: 45% (partial alphabet)
[CAR to map]
[CAR=select CDR=next INFO=detail EVAL=apply BACK=cancel]
CIPHER GARDEN │ PUZZLE: VIGENÈRE │ CRIB: 9 chars
CIPHER GARDEN ──── HINT AVAILABLE ──────────────────────────────
╔═══════════════════════════════════════════════════════════╗
║ FREQUENCY ANALYSIS HINT (1 of 3 remaining) ║
║ ║
║ Letter frequency in ciphertext: ║
║ Q (14×), W (12×), E (11×), R (9×), ... ║
║ ║
║ English letter frequency (typical): ║
║ E (13%), T (9%), A (8%), O (7%), I (7%), ... ║
║ ║
║ Most likely mapping: Q→E, W→T ║
║ ║
║ Try mapping these and test with EVAL key. ║
║ Your ciphers typically use substitution—frequency ║
║ analysis is your strongest weapon. ║
╚═══════════════════════════════════════════════════════════╝
[EVAL=apply hint BACK=dismiss]
CIPHER GARDEN ──── HYPOTHESIS TEST FAILED ─────────────────────
You submitted: A→Q, E→W, I→E, O→R, U→T
Testing... FAILED
Conflicting mappings detected:
Position 45: Character 'E' maps to both W and X
Position 87: Character 'T' maps to both R and Z
These conflicts mean your hypothesis is inconsistent. Backtrack:
✗ E→W conflicts with E→X at position 87
→ Review your reasoning for E
✗ T→R conflicts with T→Z at position 45
→ Review your reasoning for T
Common mistake: confusing frequency peaks. The second-highest
frequency letter might be T, not A. Try again.
[CAR=review_mapping INFO=detailed_conflicts BACK=continue]
CIPHER GARDEN │ PUZZLE: SUBSTITUTION │ MAPPED: 4/26
CIPHER GARDEN ──── FASTEST SOLVERS ────────────────────────────
Top 32 Operators (Personal Best Times)
RANK | OPERATOR HANDLE | CIPHER TYPE | THREAT | TIME | DATE
─────┼─────────────────┼─────────────┼────────┼──────┼─────────
1 │ CIPHER │ Vigenère │ 4 │ 4:23 │ 2026-04-09
2 │ LAMBDA │ Vigenère │ 4 │ 6:15 │ 2026-04-07
3 │ ALPHA │ Vigenère │ 4 │ 7:41 │ 2026-04-05
4 │ ECHO │ Substitution│ 3 │ 3:12 │ 2026-04-09
5 │ YOU (current) │ Substitution│ 3 │ 5:07 │ 2026-04-11
6 │ QUOTE │ Caesar │ 2 │ 1:34 │ 2026-04-08
7 │ CONS │ Caesar │ 2 │ 1:58 │ 2026-04-06
...
32 │ ZEE │ Caesar │ 1 │ 0:47 │ 2026-03-28
Your Stats:
Caesar: 1 solve (0:47)
Substitution: 3 solves (5:07 pb)
Vigenère: 2 solves (12:33 pb, 14:12)
OTP: 0 solves (unsolvable)
[CAR=view_profile CDR=next_page INFO=my_stats BACK=exit]
CIPHER GARDEN │ LEADERBOARD │ YOUR RANK: 5/32

Reputationcipher_mastery RangeAvailable ContractsUnlocked Cipher TypesKey Learning
0–40–20CIPHER PRACTICESubstitution (Caesar)Shift pattern recognition
5–1420–60CIPHER PRACTICE, MESSAGE DECRYPTIONSubstitution (random), TranspositionFrequency analysis
15–2460–120All above, FREQUENCY ANALYSISVigenère, hybridKasiski examination
25–49120–200All above, ENCRYPTED LINKOne-time pad, advanced cryptoKey generation, entropy
50+200–255DEEP CRYPTO, custom challengesUser-designed ciphersCryptographic theory

CIPHER GARDEN is a cryptographic thinking tool disguised as a game. It teaches real cryptanalysis through pattern recognition, statistical analysis, and methodical hypothesis testing. Operators who play CIPHER GARDEN develop a lasting intuition for encrypted data — they learn to “read” ciphertext the way a trained eye reads structure in noisy images.

The module exists to fulfill a deeper purpose: the deck is a place where operators become specialists in their chosen domains. CIPHER GARDEN makes operators into cryptographers. This earned expertise shapes how they approach subsequent contracts. An operator who has broken a Vigenère cipher by hand understands encryption deeply — they will approach ICE BREAKER network nodes with a cryptographer’s eye.

The deck teaches mastery through play.


All screens fit 80 columns × 25 rows. Row 0 = header (bright amber). Rows 1–23 = content. Row 24 = action bar.

Screen 1: Mission Board (Contract Selection)

Section titled “Screen 1: Mission Board (Contract Selection)”
ROW 0: CIPHER GARDEN > MISSION BOARD [Rep 12] [Credits: 1850] [CMastery: 35]
ROW 1:
ROW 2: AVAILABLE CONTRACTS (3 active)
ROW 3: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ROW 4:
ROW 5: [>] CIPHER PRACTICE: SUBSTITUTION Difficulty: ██░░░░░░░░ 2/5 (Easy)
ROW 6: Caesar cipher with frequency hints Reward: 75 ¤ | Est: 10 min
ROW 7:
ROW 8: [ ] MESSAGE DECRYPTION: VIGENÈRE Difficulty: ██████░░░░ 4/5 (Hard)
ROW 9: Key length unknown, Kasiski analysis Reward: 200 ¤ | Est: 40 min
ROW 10:
ROW 11: [ ] FREQUENCY PUZZLE: HYBRID Difficulty: ███░░░░░░░ 3/5 (Medium)
ROW 12: Substitution + transposition blend Reward: 150 ¤ | Est: 25 min
ROW 13:
ROW 14: [LOCKED] ENCRYPTED LINK SESSION [Rep 25+ required]
ROW 15:
ROW 16: [LOCKED] DEEP CRYPTO CHALLENGE [cipher_mastery 120+ required]
ROW 17:
ROW 18:
ROW 19: CIPHER MASTERY PROGRESS: ████████░░░░░░░░ 35/60 (Apprentice Cryptographer)
ROW 20: Next unlock: FREQUENCY ANALYSIS (cipher_mastery 40)
ROW 21:
ROW 22: [CAR=select] [CDR=next] [INFO=details] [SYS=menu] [EVAL=begin]
ROW 23: CIPHER GARDEN MISSION BOARD | AWAITING DECISION | OPERATOR: CIPHER
ROW 0: CIPHER GARDEN > SUBSTITUTION PUZZLE [Difficulty 2/5]
ROW 1:
ROW 2: PUZZLE LOADED: "THE QUICK MESSAGE"
ROW 3:
ROW 4: Cipher type: SUBSTITUTION (Caesar variant)
ROW 5: Plaintext length: 80 characters
ROW 6: Estimated difficulty: Easy (20 minute solution baseline)
ROW 7:
ROW 8: ═══════════════════════════════════════════════════════════════════════════
ROW 9:
ROW 10: CIPHERTEXT (encrypted message):
ROW 11:
ROW 12: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ
ROW 13: YDOXDEOH RGGV RQ FRYHU QRWLFH WKH SDWWHUQ
ROW 14:
ROW 15: ═══════════════════════════════════════════════════════════════════════════
ROW 16:
ROW 17: YOUR TASK:
ROW 18: Decrypt this message by discovering the substitution cipher key.
ROW 19: Use frequency analysis, pattern matching, or brute force (all strategies valid).
ROW 20: No time pressure. No failure state. Infinite attempts allowed.
ROW 21:
ROW 22: [INFO=frequency analysis] [CONS=substitution table] [ATOM=cipher type] [EVAL=test]
ROW 23: CIPHER GARDEN | PUZZLE LOADED AND READY | Press CAR to begin analysis

Screen 3: Frequency Analysis Display (Modal)

Section titled “Screen 3: Frequency Analysis Display (Modal)”
ROW 0: CIPHER GARDEN > FREQUENCY ANALYSIS [MODE: Histogram]
ROW 1:
ROW 2: ╔════════════════════════════════════════════════════════════════════════╗
ROW 3: ║ CHARACTER FREQUENCY IN CIPHERTEXT ║
ROW 4: ║ ───────────────────────────────────────────────────────────────────── ║
ROW 5: ║ Char Count Percent Predicted(English) Status ║
ROW 6: ║ ───────────────────────────────────────────────────────────────────── ║
ROW 7: ║ H 5 6.25% E (12.7%) ← Most frequent (try H→E) ║
ROW 8: ║ W 4 5.00% T (9.1%) ← Second (try W→T) ║
ROW 9: ║ K 4 5.00% A (8.2%) ← Check duplicates ║
ROW 10: ║ U 3 3.75% O (7.5%) ║
ROW 11: ║ B 3 3.75% I (7.0%) ║
ROW 12: ║ Q 3 3.75% N (6.7%) ║
ROW 13: ║ R 3 3.75% S (6.3%) ║
ROW 14: ║ G 2 2.50% H (6.1%) ║
ROW 15: ║ O 2 2.50% R (6.0%) ║
ROW 16: ║ [other chars] [low frequency = X, Z, Q typical] ║
ROW 17: ║ ║
ROW 18: ║ Index of Coincidence (IoC): 0.068 ║
ROW 19: ║ Assessment: Consistent with ENGLISH (0.065-0.080 range) ║
ROW 20: ║ NOT consistent with random cipher (0.038-0.045) ║
ROW 21: ║ → Conclusion: HIGH confidence this is English plaintext ║
ROW 22: ║ ║
ROW 23: ║ [CDR=bigrams] [INFO=IoC details] [CONS=mapping] [BACK=return] ║
ROW 24: ╚════════════════════════════════════════════════════════════════════════╝
ROW 0: CIPHER GARDEN > SUBSTITUTION TABLE MAPPING [Progress: 5/26]
ROW 1:
ROW 2: Cipher → Plain Confidence │ Cipher → Plain Confidence
ROW 3: ─────────────────────────────────┼──────────────────────────────────
ROW 4: A → ? 0% [ ] │ N → ? 0% [ ]
ROW 5: B → ? 0% [ ] │ O → ? 0% [ ]
ROW 6: C → ? 0% [ ] │ P → ? 0% [ ]
ROW 7: D → ? 0% [ ] │ Q → ? 0% [ ]
ROW 8: E → ? 0% [ ] │ R → E 100% [✓] ← locked
ROW 9: F → ? 0% [ ] │ S → ? 0% [ ]
ROW 10: G → ? 0% [ ] │ T → ? 0% [ ]
ROW 11: H → E 85% [>] │ U → ? 0% [ ]
ROW 12: I → ? 0% [ ] │ V → ? 0% [ ]
ROW 13: J → ? 0% [ ] │ W → T 90% [>]
ROW 14: K → A 60% [ ] │ X → ? 0% [ ]
ROW 15: L → ? 0% [ ] │ Y → ? 0% [ ]
ROW 16: M → ? 0% [ ] │ Z → ? 0% [ ]
ROW 17:
ROW 18: PARTIAL PLAINTEXT (real-time preview):
ROW 19: "ETA QUICK FROWN ... JUMPS OVER ETA LAZY ..."
ROW 20: Confidence: 70% (mostly vowels and common words recognized)
ROW 21:
ROW 22: [CAR=prev char] [CDR=next char] [CONS=edit] [INFO=suggestion] [EVAL=test]
ROW 23: SUBSTITUTION TABLE | 5 MAPPINGS CONFIRMED | PARTIAL SOLUTION VISIBLE

Screen 5: Kasiski Examination (Vigenère Analysis)

Section titled “Screen 5: Kasiski Examination (Vigenère Analysis)”
ROW 0: CIPHER GARDEN > KASISKI EXAMINATION (Vigenère Key Length)
ROW 1:
ROW 2: ╔════════════════════════════════════════════════════════════╗
ROW 3: ║ REPEATING SUBSTRINGS IN CIPHERTEXT ║
ROW 4: ╠════════════════════════════════════════════════════════════╣
ROW 5: ║ ║
ROW 6: ║ Pattern "ZRG" found at positions: 5, 23, 41 ║
ROW 7: ║ Gaps between repeats: 23−5=18, 41−23=18 ║
ROW 8: ║ → Key length likely divides 18 ║
ROW 9: ║ ║
ROW 10: ║ Pattern "RZA" found at positions: 12, 36, 60 ║
ROW 11: ║ Gaps: 24, 24 ║
ROW 12: ║ → Key length likely divides 24 ║
ROW 13: ║ ║
ROW 14: ║ GCD(18, 24) = 6 ║
ROW 15: ║ ═══════════════════════════════════════════════════════ ║
ROW 16: ║ MOST PROBABLE KEY LENGTHS: 2, 3, 6 ║
ROW 17: ║ BEST CANDIDATE: 6 (most likely, divisor of both gaps) ║
ROW 18: ║ ║
ROW 19: ║ [CDR=test length 3] [CONS=test length 2] [EVAL=use 6] ║
ROW 20: ║ ║
ROW 21: ╚════════════════════════════════════════════════════════════╝
ROW 22: [INFO=lane analysis] [ATOM=confirm] [BACK=return]
ROW 23: KASISKI EXAMINATION | CANDIDATE KEY LENGTH: 6 | READY FOR LANE SOLVE

Screen 6: Crib Mode (Known Plaintext Attack)

Section titled “Screen 6: Crib Mode (Known Plaintext Attack)”
ROW 0: CIPHER GARDEN > CRIB: KNOWN PLAINTEXT ATTACK [Progress: 2/4]
ROW 1:
ROW 2: Known plaintext phrase: "THE QUICK BROWN"
ROW 3:
ROW 4: Searching for alignment in ciphertext...
ROW 5: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ROW 6:
ROW 7: MATCH 1: Position 5 (offset +0)
ROW 8: Plain: THE QUICK BROWN
ROW 9: Cipher: ZRG TZAUR FUVPX [confidence ██████░░░░ 65%] (some misalignments)
ROW 10:
ROW 11: MATCH 2: Position 12 (offset +2)
ROW 12: Plain: THE QUICK BROWN
ROW 13: Cipher: RZ A DJUVU KRSQP [confidence ████░░░░░░ 40%] (partial match)
ROW 14:
ROW 15: MATCH 3: Position 33 (offset -1)
ROW 16: Plain: THE QUICK BROWN
ROW 17: Cipher: GYQ TXAVM YBJXP [confidence ███████████ 95%] ← BEST MATCH
ROW 18: Implied mappings: T→G, H→Y, E→Q, Q→T, U→X, I→A, C→V, K→M
ROW 19:
ROW 20: [CAR=apply best match] [CDR=next match] [INFO=detail] [BACK=exit]
ROW 21:
ROW 22: [EVAL=select Match 3 and lock mappings]
ROW 23: CRIB MODE | MATCH 3 BEST (95% confidence) | 8 NEW MAPPINGS INFERRED
ROW 0: CIPHER GARDEN > CIPHER SOLVED [Difficulty 3/5]
ROW 1:
ROW 2: ╔════════════════════════════════════════════════════════════════════════╗
ROW 3: ║ ✓ PLAINTEXT REVEALED ║
ROW 4: ╚════════════════════════════════════════════════════════════════════════╝
ROW 5:
ROW 6: ORIGINAL MESSAGE:
ROW 7:
ROW 8: "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
ROW 9: VALUABLE ODDS ON COVER NOTICE THE PATTERN
ROW 10: HERE LIES YOUR ENCRYPTION KEY."
ROW 11:
ROW 12: ═══════════════════════════════════════════════════════════════════════════
ROW 13:
ROW 14: SCORING:
ROW 15: Cipher type: Substitution (difficulty ×1.3)
ROW 16: Base reward: 150 ¤
ROW 17: Speedrun bonus (15 min / 25 min target): +30 ¤
ROW 18: Cipher mastery multiplier (35+): ×1.18
ROW 19: Rep multiplier (12): ×1.10
ROW 20: TOTAL PAYOUT: 248 ¤
ROW 21: cipher_mastery: +2 → 37
ROW 22:
ROW 23: [CAR=next puzzle] [BACK=board] [SYS=save/exit]
ROW 0: CIPHER GARDEN > LEADERBOARD (Fastest Solvers) [Rank: 28/150]
ROW 1:
ROW 2: Top 15 Operators — Substitution (Difficulty 2/5)
ROW 3: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ROW 4:
ROW 5: RANK OPERATOR CIPHER TYPE TIME DATE NOTES
ROW 6: ─────┼──────────────────┼──────────────┼────────┼──────────┼──────
ROW 7: 1 CIPHER Substitution 3:42 2026-04-11 (perfect)
ROW 8: 2 ECHO Substitution 4:15 2026-04-10
ROW 9: 3 LAMBDA Substitution 5:01 2026-04-09
ROW 10: 4 ALPHA Substitution 5:17 2026-04-11
ROW 11: 5 YOU (current) Substitution 15:32 2026-04-15 ← (beginner)
ROW 12: 6 QUOTE Caesar 2:58 2026-04-08 (easier diff)
ROW 13: 7 EVAL Caesar 3:21 2026-04-07
ROW 14: 8 CONS Caesar 4:02 2026-04-11
ROW 15: 9 ATOM Vigenère 28:15 2026-04-12 (harder)
ROW 16: 10 NIL Vigenère 31:44 2026-04-14 (harder)
ROW 17:
ROW 18: YOUR STATS:
ROW 19: Caesar: 2 solves (average time 4:12)
ROW 20: Substitution: 3 solves (average time 12:33, improving)
ROW 21: Vigenère: 0 solves (locked until cipher_mastery 60)
ROW 22:
ROW 23: [CAR=operator profile] [CDR=page 2] [INFO=rules] [BACK=return]

END OF SPECIFICATION


Cipher Garden’s voice: cryptanalyst at a quiet terminal at 3 AM. Bureau 9’s clinical tone. Observational of frequency distributions, never elated; never disappointed. The voice knows things about the ciphertext the operator hasn’t discovered yet but does not spoil them.

(:subject "ciphertext" "key" "round" "pattern" "bigram"
"frequency" "plaintext" "candidate" "hypothesis")
(:object "match" "delta" "shift" "schedule" "lattice")
(:location "frame" "round" "column" "block" "lattice")
(:verb-present "matches" "shifts" "collapses" "aligns" "resists"
"yields")
(:verb-past-participle "solved" "broken" "reduced" "aligned"
"yielded" "resisted")
(:memory-keyword "key" "round" "schedule" "pattern" "match")
(:affect-word "clean" "stubborn" "partial" "aligned" "off-by-one")
(:mode-observe
(3 (:subject) ". " (:affect-word) ".")
(2 "round " (:ciphergarden/round-number) " " (:verb-present) ".")
(1 "match."))
(:mode-annotate
(3 "pattern holds. " (:affect-word) ".")
(1 "off by one.")
(1 "the schedule cracks."))
(:mode-reflect
(3 "same round. " (:memory-fragment))
(2 "this candidate. " (:memory-fragment)))
(:mode-drift
(2 "the key from the winter contract.")
(1 "a hypothesis that almost worked."))
(:ciphergarden/round-number
(3 "one.") (3 "two.") (3 "three.") (2 "final."))
:event-types
((:type :candidate-tested :affect (:routine))
(:type :partial-match :affect (:significant))
(:type :full-break :affect (:significant))
(:type :key-captured :affect (:significant)))
Beatobserveannotatereflectdriftsilent
:active-hack (analysis)+0.10+0.05+0.05
:phase-transition (key tested)+0.15
:debrief+0.10+0.10
((:active-hack (:terseness +24 :certainty +8))
(:debrief (:terseness +8 :certainty +32)))

Cipher Garden is the primary caller of (aux-show-seed key-bytes :label "KEY"). On a successful decryption, the cart freezes Row 1 with the key value and prompts TERM capture. Cipher meanwhile drifts on CIPHER-LINE Rows 2–3 about past keys, using the coherence stack’s key keyword biasing:

Row 1 SEED KEY: 0A 3F 91 C2 88
Row 2 another schedule cracked.
Row 3 last one held longer.
Row 4 TERM: CAPTURE BACK: DISMISS

Structurally Important Moments Preserved on CIPHER-LINE

Section titled “Structurally Important Moments Preserved on CIPHER-LINE”
BeatIntentCIPHER-LINE fragment(s)
Candidate tested(no editorial)(silent)
Partial match”Partial plaintext emerging.”partial.
Full break”Key recovered.”broken. then clean.
Key captured to slot(firmware fires automatically)filed.

Per ADR-0016 (nEmacs + REPL + Input Model), each cart declares what its scripted-mission surface looks like — grammar fragments contributed to the predictive palette, domain vocabulary that earns the +5 ranking boost (ADR-0016 §7), whether it uses prompt-text for raw text entry (§8), and whether any of its keys bind :double-tap or :long-press events (§9). Cipher Garden’s decryption-as-pattern-recognition loop is a natural fit for scripted puzzle composition — the operator can author custom solvers, frequency-analysis helpers, and plaintext hypothesizers.

Yes — puzzle-composition and solver scripting. Cipher Garden rewards the operator who writes small Lisp helpers that embody cryptanalytic technique. A hand-rolled (frequency-model ciphertext) is not required — the cart ships a built-in — but an operator who composes their own learns the underlying math more deeply. The module’s Round-3 bounty chain expressly tasks the operator with authoring solvers for specific cipher families. Scripted missions remain optional on the critical path (ADR-0002); the built-in solvers clear every non-bounty puzzle.

Typical scripted-mission shapes:

  • (frequency-model ciphertext) — returns letter-frequency distribution.
  • (test-key candidate-key ciphertext) — returns plaintext + match-score.
  • (caesar-shift ciphertext n) — simple substitution.
  • (plausibility-score plaintext) — language-model heuristic over candidate output.

Contributed via (emacs-extend-grammar ...) at cart-load:

(emacs-extend-grammar
;; Ciphertext primitives
(ciphertext) ; current puzzle's ciphertext
(ciphertext-at (puzzle-id))
(plaintext-candidate) ; current best guess
(alphabet (&optional :set)) ; current alphabet (A..Z, ASCII, etc.)
;; Analysis
(frequency-model (text))
(bigram-model (text))
(index-of-coincidence (text))
(chi-squared-against (text expected-freq))
;; Keys
(key (slot))
(test-key (candidate text))
(capture-key (key-bytes :slot slot)) ; routes through aux-show-seed
(key-schedule (cipher-family))
;; Solvers
(caesar-shift (text n))
(vigenere-try (text candidate-key))
(substitution-map (mapping text))
(xor-key (text key))
;; Bureau 9 puzzles (bounty-only)
(bureau-9-classify (puzzle-id))
(plausibility-score (text)))

Via (emacs-extend-vocabulary ...). Cryptanalysis and pattern-recognition terms:

(emacs-extend-vocabulary
"cipher" "ciphertext" "plaintext" "key" "alphabet"
"frequency" "bigram" "trigram" "distribution"
"caesar" "vigenere" "substitution" "transposition" "xor"
"schedule" "round" "nonce" "salt" "entropy"
"pattern" "repeat" "period" "shift" "rotation"
"hypothesis" "candidate" "match" "partial" "full"
"bureau" "challenge" "seed" "slot"
"analysis" "coincidence" "chi-squared" "crib"
"decipher" "break" "recovered" "solved")

Yes — candidate entry and plaintext submission. Three call sites:

Call sitePurposeTypical length
Key candidateOperator types a candidate key to test against the current puzzle1–32 chars
Plaintext submissionFinal-answer entry for bounty puzzles where the operator types the recovered plaintext5–200 chars
Cipher-family labelClassify a puzzle during the Bureau 9 bounty chain (“Vigenère, period 7”)5–40 chars

Plaintext submission is the one compose-heavy case; multi-tap fatigue is partially offset by the cart’s rich T9 vocabulary (above) ranking cryptanalytic terms high in the palette. The ADR-0016 §8 promise that “3–5 of 14 carts realistically use it” holds — Cipher Garden is one of them.

Cipher Garden opts into ADR-0016 §9 lightly:

Key:tap:double-tap:long-press
INFOshow-ciphertext-metadatashow-analysis-summary — freq model, IoC, etc.show-full-history — every attempt this session
EVALtest-candidatetest-with-rotations — tries candidate ± a few shifts
QUOTEsave-candidate — to working-set

Row 24 renders: INFO:META INFO²:ANALYSIS INFO…:HISTORY EVAL:TEST EVAL²:ROTATE QUOTE:SAVE.

Context-Polymorphic Key Semantics (Cart Gameplay)

Section titled “Context-Polymorphic Key Semantics (Cart Gameplay)”

Cipher Garden’s cart has two primary cursor contexts: puzzle view (ciphertext + analysis panel) and key slot view (captured keys):

KeyPuzzle viewKey slot view
INFOshow-metadatashow-slot-history
CARdrill-into-analysisdrill-into-slot
CDRnext-analysis-panelnext-slot
CONScombine-analysis — e.g., freq + bigramlink-slot-to-puzzle
EVALtest-candidatere-use-slot-key
QUOTEsave-candidaterename-slot
BACKexit-puzzleexit-slot-view
Numpadalphabet-position selectslot index 1–9

When the operator opens nEmacs to compose a solver, dispatch yields to :nemacs-nav per ADR-0016 §3 — the editor keymap takes over and Row 24 reflects structural-editing verbs.