Skip to content

Repository files navigation

Jeff Disk

Jeff Disk represents my next step after BetterYou, leveraging Hankweave to explore agentic workflows for cryptographic puzzle solving.

Named after the Jefferson Disk, it aims to test the execution LLM harness problems.

Case Study: Deciphering the Naruto Monologue

To test the system, I used a simple substitution cipher generated via cryptii.com. The plaintext is a monologue from the anime Naruto.

Setup

Example Easy Setup

The Challenge: OCR Noise

The primary difficulty lay not in the cipher itself, but in the specific image noise which confused the OCR engine. Notably, the letter c was frequently misread as ¢.

View Extracted Text (OCR)
Ke rwx Apkemgb ewtcb... xm'a vqk fdp gww cgkx. Qb'u yml\nrwe fzc... Haqvgsg'h eqng zq chb ugrajkml dp fdp bpgp\njxom. Jwk ppmpmt zr'h fmiulptw jg yyyi mpma dyctom vf\nyrvwuregha, jmhfpt mpmki bttbp. Op jxym pcj ptttta sctg\nnene mu gwbjzlv ucb hrganzm. eflibvecejn kmrgtrtw jg\nVjsctlm. Weygem bq jrdi ug higtgl, ipu sctjtg km ekwbgtr\ntbbpgi kn Lbcfvli hz ua decmwz. Efketzmf km iam otvyi\ntvl evjtuzivvb sxmlu fd iam Pqbyvx. Ug ctrxhva cic\nikqnnzlv bvakxlxyqkcer iaqvij gewmmf, Z uxlp bjrr x\nvwenu fpom Lkvb absm graw hn bjv Fddiog. R rpem qu flar\nia ifms ta qvj dxgit vlpe hn mxvlil. I xnfr ipgav... rls\nfgavritl izg rl xfxwtkyem xitk mu ppm remi maw. K'me\nabdmf dw abnm ccupra jgcgtoqvi kfpm bpg cchlwvu Z\njttzvgu ygx epck fdgml ov... G hpwzg Z'b pvkwogjxlp i\nfvcs lw Otvyi. Mpiv zr Lhctf fzabbmtrrt ttt op dpbtctvq.\nX wqm... ¢ jnaxviku Qwbvwdz . Yi emiuk rwtb'a jfu xm eiu\njseiwagu rd zw. Jwk rwba... ua gjdm bekjr. Br bike\ncewqvi cgzx bpkj, rwx ozgrr ahzl gebtk xzqgftlqmf. Kfpm\nQ eqljs um bjv mcx bw ilgsx i zgmmanbqge. Y exzaqe uwh\neqne kpdm i iicpm kpqzat mpiv ngae jzkee tbbpgi nttkm qi\nbtlbzwtrxhv bq kft pwznu mu ppm Uygchjq. K kfdnopy Z\udntl fvdttb Xezl, hmwx vyc Pdibulix, tvl urtt mpm yfpaw\nnzqd btlbzwtrxhv. Jwk ge mpm geb... X yign kfpm bwq. Yml\nigbkwsa... awe urb iaib vygh pqtn sc... iam mpugez bekjr\nih bpg kyax wn Lzppbgi vyc Vtttcer. Laib c nmgmptgjq\nhmwza zr inzvgu mjm bw dv\n\n

Performance & Cost Analysis

I evaluated the workflow against three model configurations. All correctly identified the Vigenère cipher, but their handling of OCR noise varied significantly. Cost estimates are per-run.

Model Config Cost Result
Gemini 2.5 Flash / 3 Pro ~$2.50 Gemini Result
Claude Haiku / Sonnet ~$2.00 Claude Result
Claude Haiku / Opus ~$5.54 Claude Opus Result

Detailed Analysis (Click to Expand)

Gemini 2.5 Flash / 3 Pro

Method Vigenère Cipher with key 'CRYPTII'. The cipher is applied to the text, but the key index effectively skips one position at the '¢' character (start index of Part 2 is key_idx_after_part1 + 1). (Confidence: high)

Reasoning The decoded text is a recognizable monologue from the character Jiraiya in the Naruto series. The text contains consistent typos (e.g., 'Shinori' instead of 'Shinobi', 'mystakes' instead of 'mistakes') which seem to be part of the puzzle or faithful to the source. The coherence of the text and the specificity of the key 'CRYPTII' confirm the solution.

Decoded Text

In the Shinori world... it's not how you live. It's how
yow die... Shinebi's life is not meacured by how they
live. But rather it's measured by what they manage to
accompnish, before their death. My life has really been
fwln of nothing but failure. continwanly rejected by
Tsunade. Unarle to stop my friend, and unable to protect
either my Student or my mgntor. Compared to the great
and celebrated deeds of the Hokage. My actions are
trifling insignificant things ipdeed, I wish that i
cowld have Died like each of the Hokage. A tale is only
as good as its final turp of events. A plot twyst... and
mystakes are an importapt part of the pnot tso. I've
lived my life always believing that the lessons I
learned are what honed me... I swore I'd accomplish a
deed so Great. That it Would obliterate all my failures.
I die... ¢ splenaid Shinobi . At least that's how it was
supposed to go. But this... my plot twist. My tain
epding like this, the great lord ender prophesied. That
I would be the one to guide a revolutien. A person who
wiln make a great choice that will bring either peace or
destruction to the world of the Shinobi. I thoughw I
would defeat Pcin, stop the Akatsuki, and save the world
from destruction. But ip the end... I fayl that too. How
pytiful... how sad that this will be... the endipg twist
to the tale of Jiraiya the Gallant. What a worthless
story it turned out to be
Claude Haiku / Sonnet

Method Vigenère cipher with key length 7 (Confidence: high)

Reasoning The hypothesis correctly identified this as a Vigenère cipher with key length 7. The key 'CRYPTII' was systematically deduced through: (1) Index of Coincidence analysis showing IC=0.043 (polyalphabetic signature), (2) Kappa IC test revealing elevated values at key lengths 7 (0.0556) and 14 (0.0572), strongly indicating key length 7, (3) Frequency analysis per key position using chi-squared testing against English letter frequencies, and (4) Validation against known plaintext patterns (the opening 'In the Shinobi world'). The decoded text is ~85% coherent English and recognizable as Jiraiya's final monologue from the anime/manga series Naruto. The first 820 characters decode cleanly with proper grammar, contractions (it's, I've, I'd), and narrative coherence. Common words like 'the', 'and', 'not', 'how', 'you' appear frequently as expected in English text. The statistical evidence (IC analysis, Friedman test estimate of 5-6, repeated trigrams MPM/BPG/TTT) all strongly supported the Vigenère hypothesis. The successful decryption validates both the methodology and the key.

Decoded Text

In the Shinori world... it's not how you live. It's how
yow die... Shinebi's life is not meacured by how they
live. But rather it's measured by what they manage to
accompnish, before their death. My life has really been
fwln of nothing but failure. continwanly rejected by
Tsunade. Unarle to stop my friend, and unable to protect
either my Student or my mgntor. Compared to the great
and celebrated deeds of the Hokage. My actions are
trifling insignificant things ipdeed, I wish that i
cowld have Died like each of the Hokage. A tale is only
as good as its final turp of events. A plot twyst... and
mystakes are an importapt part of the pnot tso. I've
lived my life always believing that the lessons I
learned are what honed me... I swore I'd accomplish a
deed so Great. That it Would obliterate all my failures.
I die... ¢ hwcicacs Zymcovx . Hk ptami ayei's bdd zx lam
hbgtdsys af kd. Boi aymh... ms esfx iwcha. Dc iacc
lghxna apbi ihch, ayi vrypa csgd yckvv erieovwxex. Iorx
X wijsu ft tbt vei io ajpui p rykvcyiiyc. H gigsic dys
lifc trot a aglrx rhixjv xwan lpcp qrccn vmihyg wvere ig
kvwirorazsc ti iov adrfs vw xwe Mwpesqi. C iofyvhq X
dfyad xtmvei Pwxu, jxdp nwl Roptmjrz, ecd mpcv xwe qdych
urib kvwirorazsc. Boi pg xwe yck... Z jpyf iorx ioi. Wvn
tntcubc... ldw mpk klpt nwpj axlf ql... klt ehspgk iwcha
ks ihy ihci df Dxyrmna nwl Xealuca. Nlpt u lvixwlyhz
jxdrs xa kygnys vlx io vt
Claude Haiku / Opus

Method Vigenere cipher decryption with key 'CRYPTII' (length 7, shifts: C=2, R=17, Y=24, P=15, T=19, I=8, I=8). The special character ¢ (cent sign) acts as a key-advancing token that shifts the key cycle by one position without producing decrypted output. All non-alphabetic characters (spaces, punctuation, newlines) are preserved in place and do not advance the key, except for the ¢ which does advance the key. (Confidence: high)

Reasoning Multiple independent lines of evidence converge on this solution: (1) The Index of Coincidence of 0.043 is characteristic of a polyalphabetic cipher. (2) 13 unique single-letter cipher words rule out monoalphabetic substitution. (3) Kasiski examination found the 11-character sequence 'btlbzwtrxhv' repeating at distance 91 = 7 x 13, confirming key length 7. Factor 7 divides 35 repeated-sequence distances, far more than any other factor. (4) Splitting into 7 streams raises per-stream IoC from 0.043 to 0.056, approaching English (0.067). (5) Chi-squared frequency analysis independently recovers the key as 'CRYPTII'. (6) The decrypted text is a recognizable passage: Jiraiya's death monologue from Naruto Shippuden, beginning 'In the Shinobi world... it's not how you live. It's how you die...' and ending '...What a worthless story it turned out to be.' (7) Independent analysis of the second half (after the cent sign) recovers the key 'RYPTIIC', which is 'CRYPTII' rotated by 1 position, confirming the cent sign advances the key. (8) Independent verification: 83% of decoded words match a common English word list (219/264 words). Alternative hypotheses tested and ruled out: key length 14 ('CRYPTIICRYPFII') scored only 61.7% word match and introduced far more errors; Beaufort cipher with same key produced gibberish (4.9% match). Approximately 27 scattered single-character errors remain (e.g., 'Shinori' for 'Shinobi', 'yow' for 'you', 'meacured' for 'measured'), likely due to OCR noise in the source image rather than a decryption error — the errors appear at inconsistent key positions and do not follow a systematic pattern.

Decoded Text

In the Shinori world... it's not how you live. It's how
yow die... Shinebi's life is not meacured by how they
live. But rather it's measured by what they manage to
accompnish, before their death. My life has really been
fwln of nothing but failure. continwanly rejected by
Tsunade. Unarle to stop my friend, and unable to protect
either my Student or my mgntor. Compared to the great
and celebrated deeds of the Hokage. My actions are
trifling insignificant things ipdeed, I wish that i
cowld have Died like each of the Hokage. A tale is only
as good as its final turp of events. A plot twyst... and
mystakes are an importapt part of the pnot tso. I'vg
lived my life always believing that the lessons I
learned are what honed me... I swore I'd accomplish a
deed so Great. That it Would obliterate all my failures.
I die... ¢ splenaid Shinobi . At least that's how it was
supposed to go. But this... my plot twist. My tain
epding like this, the great lord ender prophesied. That
I would be the one to guide a revolutien. A person who
wiln make a great choice that will bring either peace or
destruction to the world of the Shinobi. I thoughw I
would defeat Pcin, stop the Akatsuki, and save the world
from destruction. But ip the end... I fayl that too. How
pytiful... how sad that this will be... the endipg twist
to the tale of Jiraiya the Gallant. What a worthless
story it turned out to be

How It Works

The program employs Hankweave Loops, where each iteration of hypothesizing and decoding refines the context produced by the previous one.

Workflow

[Start]
   |
   v
+-----------------------------+
|    Analyze Project          |
| (analyze-gemini-flash)      |
+-------------+---------------+
              |
              v
     /-----------------\
     |  Decoding Loop  | <-------+
     | (Max 2 iters)   |         |
     \--------+--------/         |
              |                  |
              v                  |
   +-----------------------+     |
   |  Hypothesize Solution |     |
   | (hypothesize-gemini-pro)|   |
   +----------+------------+     |
              |                  |
              v                  |
   +-----------------------+     |
   |    Decode Solution    |     |
   |   (decode-gemini-pro) | ----+
   +-----------------------+
              |
              | (After loop)
              v
+-----------------------------+
|    Display Results          |
| (display-results-gemini-flash)|
+-----------------------------+
   |
   v
 [End]

Supported Ciphers

Constrained to encoding/decoding schemes available on cryptii.com:

  • Transform: Replace, Reverse, Case transform, Numeral system, Bitwise operation
  • Alphabets: Morse code, Spelling alphabet
  • Ciphers: Enigma, Caesar, Affine, ROT13, A1Z26, Vigenère, Bacon, Substitution, Rail fence
  • Polybius: Polybius square, ADFGX, Bifid, Nihilist, Tap code, Trifid
  • Encoding: Base32, Base64, Ascii85, Baudot, Unicode, URL, Punycode, Bootstring, Integer
  • Modern: Block Cipher, RC4, Hash, HMAC

Current Limitations

Complex Formatting / Lossy OCR: The system currently struggles with inputs where the text extraction is too lossy to reconstruct the cipher structure.

  • example_hard.png: A complex challenge from /r/Decoders remains unsolved for this reason.

Repository Structure

  • hank.json — Workflow definition (codons, models, file tracking)
  • prompts/ — Prompt files for each codon (one per harness)
  • data/ — Sample files to analyze
  • examples/ — Case study and example images
  • .gitignore — Ignore patterns for execution artifacts
  • rig-files/ — Helper scripts and tools
    • scripts/ — Python scripts (e.g., ocr_extract.py)

Getting Started

OCR Setup & Testing

To use the OCR extraction script (rig-files/scripts/ocr_extract.py), you need to set up the environment:

  1. System Requirements: Install Tesseract OCR engine.

    • Ubuntu/Debian: sudo apt-get install tesseract-ocr
    • MacOS: brew install tesseract
  2. Python Environment:

    • A virtual environment is recommended.
    • Install dependencies: pip install pytesseract Pillow
    • (Note: The script expects a venv at rig-files/scripts/venv for the test command below)
  3. Testing: Run the included test suite to verify your setup:

    rig-files/scripts/venv/bin/python3 rig-files/scripts/test/run_test.py

Managing Codons

The hank.json file is generated from hank_template.json and individual codon files in the codons/ directory.

To update hank.json:

  1. Edit hank_template.json to include pointers to codon files (e.g., "./codons/analyze-gemini-flash.json").
  2. Run the merge script:
    rig-files/scripts/venv/bin/python3 utils/merge_codons.py
    This will read the template, resolve the pointers by loading the referenced JSON files, and overwrite hank.json.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages