XTRMC ROXXN LGWWM PQILL WLYMP OXBOH COGSD XHEBF ZMROD XLMEP MFNZO K

Where it started: 56 letters from an Enigma emulator, and no settings.

From 610,000 years to 4.4 seconds

What I learned cracking Enigma with Claude. I brought the sources, a YouTube video and a 1995 research paper. Claude read them and turned each one into working code.

Claude doesn’t decrypt anything itself. It wrote Python scripts that attack the ciphertext, and every measured time on this poster is those scripts running on my 14-core laptop.

The crib. Knowing the message began with TEST cut 77 billion settings down to 1.3 million.

How long one crack takes

Time to recover the settings, on my 14-core laptop. The scale is logarithmic, so equal distances mean equal multiples: 1 s to 10 s spans the same width as 1 min to 10 min.

Four inputs, four jumps

Every big improvement started with something I handed over: a fact about the message, a video, a paper, and then a second question about the same paper. The quotes are my actual prompts.

  1. Step 0

    The wall

    “I want you to guess it without correct setting. but I worry if that would be too expensive”

    Pulled the emulator’s JavaScript to get the exact rotor wirings, checked them with a round-trip test, then sized the problem honestly.

    Settings without a plugboard
    7.7×1010
    With a plugboard
    1020+
  2. Step 1

    A crib

    “the first 4 plaintext is "TEST", how fast you can do it now?”

    An exact-match filter across every rotor, reflector, ring, and start position, then a multi-core ranking of the survivors by English letter frequency. The answer was certain and unique.

    Survivors out of 77.2 billion
    1,290,588
    Ciphertext to answer
    4.4 min
  3. Step 2

    A video

    “I've watched this youtube video discussing how to bracking enigma, would the strategy mentioned in the video makes it easier?”

    Read the Computerphile transcript and built a ciphertext-only attack in stages: find rotors and start position first, then ring settings. It needs 200+ letters and no crib. Its weak spot: a correct ring search still took minutes.

    Stage 1 combinations
    4,394,000
    Stage 1 time
    ~4 s
    Exhaustive ring search
    4.7 min
  4. Step 3

    The paper behind the video

    “the video is introducing this paper: [link] would that give you any insight to improve our script?”

    Implemented James Gillogly’s 1995 ring recovery: move the ring setting and the start position together, 26 trials per rotor. It found the right rotors and readable English in 0.014 s, cheap enough to check every candidate. On one test, a few letters near rotor turnovers still differed from the exhaustive search.

    Trials, down from 308,915,776
    52
    Ring recovery
    0.014 s
    Full pipeline
    286 s → 4.3 s
  5. Step 4

    Same paper, new question

    “can you implement the plugboard upgrade from the paper?”

    “can you make it the default behavior that assume it'll have plugboard pair and we don't know how many (could be 0)”

    A second, narrower read found a detail the first one skipped: score plugboard guesses with English trigrams. A greedy search then finds every plug and stops on its own when no swap helps, so it runs on every message.

    Plugs found in ~1.3 s
    5 of 5
    Trials, vs 1.5×1014 for 10 plugs
    ~1,295
    End to end
    4.4–15.8 s

Scoring “almost English”

Enigma leaks. A decryption with only some settings right already looks measurably more like English than one with everything wrong. With a score for that, one impossible search becomes three small ones: rotors, then rings, then the plugboard.

  1. 4,394,000rotor orders × start positions, ranked by IoC
  2. 52ring trials per candidate, ranked by IoC
  3. ~1,295plugboard swaps, ranked by trigrams

Where candidates land on Index of Coincidence

How likely two random letters in the text are to match. Higher looks more like English. The two decryptions are from a 269-letter test message.

Three scores, each where it pays off

ScoreWhat it noticesUsed to rankCandidates
Chi-squared Which letters are common (E, T, A…) Crib survivors 1.29 M
IoC How uneven the letter counts are, whichever letters they are Rotors + start, then the ring sweep 4.4 M, then 52
Trigrams Real 3-letter sequences like THE, ING, ION Plugboard swaps ~1,295

Cheap scores for millions of candidates, the sharper and slower score for the last handful.

When IoC gets fooled

On a message with no plugboard at all, IoC scoring added two fake plugs because they nudged the score up from 0.0618 to 0.0638. Trigram scoring correctly found zero.

CorrectINCRYPTOGRAPHYA
Fake plugsINCQYPTOGQAPLYA

Two lessons

“This journey started with my interest in and curiosity about Enigma after watching the video. It taught me more about the Enigma machine itself. More importantly, it taught me how to guide Claude to implement what I learned, using Claude to quickly turn the information I found into working code.” Me, looking back on the project

Curate the knowledge, let Claude implement it

“provide what I learn from YT, paper so claude can use it to implement it”
  • videobecame the staged, ciphertext-only attack
  • paperbecame 52-trial ring recovery, the biggest speedup
  • paper, againfixed the plugboard stage and a real scoring bug

My part was judgment: which source was worth reading, and when a source deserved a second, narrower look. A source is rarely used up after one read. A new question can pull something new out of it.

Partial correctness has a score

“from brute force to partially solve the code. and using a proper scoring system to rank the partial result.”

More hardware would never have covered 1020 settings. What broke the wall was a score that rewards getting some settings right, which let each stage be solved and ranked on its own. Picking the right score for each stage mattered as much as the search itself.

What it cost

~58%(of a 5-hr session limit of Claude Pro, for the whole development)

Measured from the development transcript: each API call’s tokens, weighted by price, then scaled against a stretch where Claude Pro’s usage meter read 35%. Anthropic doesn’t publish exactly how the limit counts each token type, so this is still an estimate.

Built with Claude Sonnet 5.

Share of the limit, by step

  1. Steps 0–1: the wall and a crib9.5%
  2. Sizing the problem, emulator wiring3.7%
  3. Crib search, multi-core ranking1.5%
  4. Crib script, docs, pruning fix4.3%
  5. Step 2: a video12.5%
  6. Reading the YouTube video2.3%
  7. Staged attack + simulator5.1%
  8. Exhaustive ring search3.1%
  9. Checking candidates in order2.0%
  10. Step 3: the paper behind the video6.4%
  11. Reading + implementing the paper5.4%
  12. First progress doc1.0%
  13. Step 4: same paper, new question14.6%
  14. Plugboard audit, discussion only0.2%
  15. Trigram plugboard search9.1%
  16. Plugboard on by default3.4%
  17. Progress doc update1.9%
  18. Docs and reflection15.2%
  19. Development journal + token estimate2.9%
  20. Scoring doc + lessons6.7%
  21. Opus review of the journal5.6%

The answer

The 56 letters from the top of the page, decrypted. The first four are the crib I gave Claude.

Ciphertext XTRMC ROXXN LGWWM PQILL WLYMP OXBOH COGSD XHEBF ZMROD XLMEP MFNZO K decrypts to TESTI FCLAU DECAN DECRY PTANE NIGMA MACHI NEAND HOWFA STITC ANDOI T.

“Test if Claude can decrypt an Enigma machine and how fast it can do it”

Recovered by the crib attack in 4 min 22 s on my 14-core laptop. The correct decryption scored a chi-squared of 21.6, far ahead of the next best at 76.2.

Rotors
III, V, I
Reflector
UKW-C
Ring
AAO
Start
EDH
Plugboard
none

Other ring and start pairs produce the same text on a message this short. This is one of them.