jcolinpatrick/kryptos

1

stars

2

commits

Python

primary language

Aug 26, 2026

updated

README

KryptosBot

KryptosBot

An open-source computational analysis of Kryptos K4
671 billion+ configurations evaluated across recorded experiments. 1,000+ experiment scripts. Zero verified breakthroughs.

kryptosbot.com · Workbench · Submit a Theory · Browse Eliminations


What is this?

Kryptos is an encrypted sculpture at CIA headquarters in Langley, Virginia. Installed in 1990 by artist Jim Sanborn with cryptographic assistance from Ed Scheidt (retired Chairman of the CIA Cryptographic Center), it contains four encrypted messages. The first three (K1–K3) were solved in 1998–1999. The fourth, K4, remains unsolved after over 35 years.

This repository is a systematic attempt to solve K4. At a minimum, it rigorously documents what doesn't work within clearly stated assumptions. No K4 solution is claimed by this project; no real-K4 progress is currently claimed; K4 is not proven impossible. Public-data-only K4 is judged underdetermined from the current public evidence pool — see docs/REAL_K4_CURRENT_POSITION.md for the authoritative status report.

K4 at a glance

CiphertextOBKRUOXOGHULBSOLIFBBWFLRVQQPRNGKSSOTWTQSJQSSEKZZWATJKLUDIAWINFBNYPVTTMZFPKWGDKZXTJCDIGKUHUAUEKCAR
Length97 characters (prime), all 26 letters present
Known plaintextPositions 21-33: EASTNORTHEAST, Positions 63-73: BERLINCLOCK
IC0.0361 (below random expectation of 0.0385)

What's here

src/kryptos/          # Core library: cipher transforms, scoring, constraints
  kernel/             #   Pure computation: alphabets, transforms, Bean constraints
    scoring/          #     Crib scoring, n-gram analysis, IC
  pipeline/           #   Candidate evaluation and parallel sweep runner
  novelty/            #   Hypothesis generation and triage
  corpus/             #   Egyptological corpus for running-key testing
  cli/                #   Command-line tools (sweep, reproduce, novelty, report)

scripts/              # 1,000+ experiment scripts organized by cipher family
  substitution/       #   Vigenere, Beaufort, Hill, monoalphabetic, etc.
  transposition/      #   Columnar, rail fence, route, grid-based
  fractionation/      #   Bifid, Trifid, ADFGVX, Playfair
  grille/             #   Cardan grille, turning grille, tableau overlays
  polyalphabetic/     #   Kasiski analysis, period detection
  running_key/        #   Book ciphers, thematic running keys
  encoding/           #   Morse (K0), misspelling analysis, binary tests
  campaigns/          #   Structured multi-stage campaigns (preregistered)
  ...and more

kryptosbot/           # Multi-agent research controller (Claude Agent SDK):
                      #   theorist/critic/red-team cycle, typed hypothesis DSL,
                      #   kernel-verified dispatch, provenance-gated claims

tests/                # 2,000+ unit, QA, and benchmark tests (plus 2,400+ under kryptosbot/tests/)
bench/                # Cipher-solving benchmark framework + K4Bench synthetic calibration suite
ops/site_builder/     # Static site generator for kryptosbot.com
ops/api/              # FastAPI backend (theory classifier, submission queue)
ops/publish/          # Content-scan guard run by the pre-push hook

Quick start

Python 3.11+ required. The repo uses a small Python dependency stack for testing, scientific computing, web/API serving, and agent tooling; see requirements.txt.

# Clone
git clone https://github.com/jcolinpatrick/kryptos.git
cd kryptos

# Run tests
PYTHONPATH=src pytest tests/

# Run an experiment
PYTHONPATH=src python3 -u scripts/substitution/e_atbash_01_keyword_decrypt.py

# Try the workbench cipher solver
PYTHONPATH=src python3 -m kryptos sweep <config.toml>

# Check environment health
PYTHONPATH=src python3 -m kryptos doctor

Scoring system

Every candidate decryption is scored against known constraints:

ScoreClassificationMeaning
0-9NoiseExpected random performance
10-17InterestingWorth logging, likely noise
18-23SignalUnusual within tested scope; requires follow-up and validation
24BreakthroughAll cribs match; potential solution

The score is based on crib consistency (do the known plaintext positions produce a valid keystream?), Bean constraints (equality/inequality relationships between key positions), index of coincidence, and n-gram quality.

After 671 billion+ configurations: no verified solution has emerged within the tested families and parameter ranges. Many standard bounded classical families have been saturated under direct positional correspondence, but that does not rule out multi-layer, procedural, or differently aligned constructions.

What's been eliminated

The kryptosbot.com site currently documents 522 recorded eliminations across 7 categories (count as of 2026-06-11; the site rebuilds from the same data in this repo):

  • Substitution. Vigenere, Beaufort, Quagmire, Hill, Caesar, mixed alphabets.
  • Transposition. Columnar, double-columnar, AMSCO, Myszkowski, rail fence, route, grille.
  • Fractionation. Bifid, Trifid, ADFGVX, Playfair, four-square (structurally eliminated under direct correspondence).
  • Multi-layer. Substitution + transposition combinations, null extraction, three-layer cascades.
  • Key models. Running keys, autokey (structurally eliminated), progressive, Fibonacci, date-derived.
  • Bespoke. RS44, VIC, Wheatstone, Weltzeituhr, DRYAD charts, NATO/COMSEC.
  • Uncategorized. Morse-derived, encoding schemes, sculpture-physical hypotheses.

Important caveat: These eliminations are always scoped to the assumptions actually tested. Single-layer eliminations do not rule out the same cipher family as one layer of a multi-layer construction.

Working hypotheses

None of these are proven. They represent live hypothesis surfaces or residual coverage gaps. Status as of June 2026.

  1. Two systems. Sanborn has publicly stated K4 uses "two systems of enciphering," distinct from the Vigenere used for K1-K3. The project treats this as Tier-3 contextual hearsay (per claims-registry entries C-SANBORN-01 and C-SANBORN-02), not as a load-bearing piece of operational evidence. The phrase admits multiple mutually-incompatible structural interpretations and has so far not produced a non-arbitrary cipher mechanism. Any specific mechanistic interpretation remains a hypothesis that must be paired with independent measurable evidence before it gains evidentiary weight. See the pseudo-clue-pack admission standard rule 11.
  2. CT perturbation. Photographed coding charts in Sanborn's archive raised the possibility that the canonical 97-character ciphertext includes a small number of transcription errors. Stage A (every single-character variant) was tested and closed clean-negative in May 2026; the as-carved text is treated as authoritative. Multi-error variants remain formally open but are not a live lead.
  3. W-delimiter structural hypothesis. The five carved Ws at positions 20, 36, 48, 58, and 74 explain the old width-21 vertical-bigram anomaly. As a single-layer construction the W-segmentation hypothesis has been saturated (80+ tested, no signal); it remains admissible as one layer within multi-layer constructions. Whether the Ws are delimiters, nulls, row markers, or something else remains open.
  4. Null insertion or procedural markers. Some positions in K4 may be filler or marker symbols. The number, placement, and interpretation remain unknown. The older statistical "null palette" family is retired and should not be treated as evidence.
  5. Residual running-key and non-periodic additive models. Within additive-key assumptions and direct correspondence, running-key style models remain an open residual family. That is a scoped statement, not a global claim about all possible K4 constructions.

See docs/research_questions.md for the full list of open questions.

What is public, and what is not

As of June 2026 this repository is published in full as a gift to the Kryptos community, including the complete kryptosbot/ multi-agent controller and the full research history. Exactly four classes stay out of the public repo:

  1. Agent and skill definitions (.claude/): the precise prompt construction of the research agents stays private. The architecture they implement is fully visible in kryptosbot/.
  2. Secrets: API keys and .env files.
  3. Local reference material (reference/, archive/, analysis_runs/): third-party books and scans (some copyrighted), bulk photo corpora, and community-thread archives. The photographs the project shares are the ones published on kryptosbot.com/archive.
  4. Machine outputs: multi-gigabyte run outputs, caches, and build artifacts. Result summaries that feed the site live in results/ and docs/.

Contributing

The whole point of open-sourcing this is to get more eyes on K4.

Try a theory: Use the browser workbench, no install needed. Apply transpositions and substitutions, see crib scores in real time.

Submit a theory: Use kryptosbot.com/submit to check if your idea has already been tested. Novel feasible theories are queued for evaluation.

Write an experiment: See any script in scripts/ for the pattern. Import constants from kryptos.kernel.constants, implement an attack() function, check results against the scoring system.

Report an error: If you think an elimination is wrong, open an issue.

Project research-state documents

Key external references

  • Bean 2021: "Cryptodiagnosis of Kryptos K4," HistoCrypt 2021.
  • Elonka Dunin's Kryptos page: community hub and transcription.
  • Ed Scheidt interviews and Sanborn's August 2025 open letter: summarized on kryptosbot.com/about-kryptos. (The project's local reference/ corpus of third-party source material is not in the public repo for copyright reasons.)

Credits

Built by Colin Patrick (human lead) and Claude (computational partner, Anthropic).

The sculpture Kryptos was created by Jim Sanborn with cryptographic assistance from Ed Scheidt (retired Chairman of the CIA Cryptographic Center).


Contributors

jcolinpatrick

2 commits

jcolinpatrick/kryptos

1

stars

2

commits

Python

primary language

Aug 26, 2026

updated

README

KryptosBot

KryptosBot

An open-source computational analysis of Kryptos K4
671 billion+ configurations evaluated across recorded experiments. 1,000+ experiment scripts. Zero verified breakthroughs.

kryptosbot.com · Workbench · Submit a Theory · Browse Eliminations


What is this?

Kryptos is an encrypted sculpture at CIA headquarters in Langley, Virginia. Installed in 1990 by artist Jim Sanborn with cryptographic assistance from Ed Scheidt (retired Chairman of the CIA Cryptographic Center), it contains four encrypted messages. The first three (K1–K3) were solved in 1998–1999. The fourth, K4, remains unsolved after over 35 years.

This repository is a systematic attempt to solve K4. At a minimum, it rigorously documents what doesn't work within clearly stated assumptions. No K4 solution is claimed by this project; no real-K4 progress is currently claimed; K4 is not proven impossible. Public-data-only K4 is judged underdetermined from the current public evidence pool — see docs/REAL_K4_CURRENT_POSITION.md for the authoritative status report.

K4 at a glance

CiphertextOBKRUOXOGHULBSOLIFBBWFLRVQQPRNGKSSOTWTQSJQSSEKZZWATJKLUDIAWINFBNYPVTTMZFPKWGDKZXTJCDIGKUHUAUEKCAR
Length97 characters (prime), all 26 letters present
Known plaintextPositions 21-33: EASTNORTHEAST, Positions 63-73: BERLINCLOCK
IC0.0361 (below random expectation of 0.0385)

What's here

src/kryptos/          # Core library: cipher transforms, scoring, constraints
  kernel/             #   Pure computation: alphabets, transforms, Bean constraints
    scoring/          #     Crib scoring, n-gram analysis, IC
  pipeline/           #   Candidate evaluation and parallel sweep runner
  novelty/            #   Hypothesis generation and triage
  corpus/             #   Egyptological corpus for running-key testing
  cli/                #   Command-line tools (sweep, reproduce, novelty, report)

scripts/              # 1,000+ experiment scripts organized by cipher family
  substitution/       #   Vigenere, Beaufort, Hill, monoalphabetic, etc.
  transposition/      #   Columnar, rail fence, route, grid-based
  fractionation/      #   Bifid, Trifid, ADFGVX, Playfair
  grille/             #   Cardan grille, turning grille, tableau overlays
  polyalphabetic/     #   Kasiski analysis, period detection
  running_key/        #   Book ciphers, thematic running keys
  encoding/           #   Morse (K0), misspelling analysis, binary tests
  campaigns/          #   Structured multi-stage campaigns (preregistered)
  ...and more

kryptosbot/           # Multi-agent research controller (Claude Agent SDK):
                      #   theorist/critic/red-team cycle, typed hypothesis DSL,
                      #   kernel-verified dispatch, provenance-gated claims

tests/                # 2,000+ unit, QA, and benchmark tests (plus 2,400+ under kryptosbot/tests/)
bench/                # Cipher-solving benchmark framework + K4Bench synthetic calibration suite
ops/site_builder/     # Static site generator for kryptosbot.com
ops/api/              # FastAPI backend (theory classifier, submission queue)
ops/publish/          # Content-scan guard run by the pre-push hook

Quick start

Python 3.11+ required. The repo uses a small Python dependency stack for testing, scientific computing, web/API serving, and agent tooling; see requirements.txt.

# Clone
git clone https://github.com/jcolinpatrick/kryptos.git
cd kryptos

# Run tests
PYTHONPATH=src pytest tests/

# Run an experiment
PYTHONPATH=src python3 -u scripts/substitution/e_atbash_01_keyword_decrypt.py

# Try the workbench cipher solver
PYTHONPATH=src python3 -m kryptos sweep <config.toml>

# Check environment health
PYTHONPATH=src python3 -m kryptos doctor

Scoring system

Every candidate decryption is scored against known constraints:

ScoreClassificationMeaning
0-9NoiseExpected random performance
10-17InterestingWorth logging, likely noise
18-23SignalUnusual within tested scope; requires follow-up and validation
24BreakthroughAll cribs match; potential solution

The score is based on crib consistency (do the known plaintext positions produce a valid keystream?), Bean constraints (equality/inequality relationships between key positions), index of coincidence, and n-gram quality.

After 671 billion+ configurations: no verified solution has emerged within the tested families and parameter ranges. Many standard bounded classical families have been saturated under direct positional correspondence, but that does not rule out multi-layer, procedural, or differently aligned constructions.

What's been eliminated

The kryptosbot.com site currently documents 522 recorded eliminations across 7 categories (count as of 2026-06-11; the site rebuilds from the same data in this repo):

  • Substitution. Vigenere, Beaufort, Quagmire, Hill, Caesar, mixed alphabets.
  • Transposition. Columnar, double-columnar, AMSCO, Myszkowski, rail fence, route, grille.
  • Fractionation. Bifid, Trifid, ADFGVX, Playfair, four-square (structurally eliminated under direct correspondence).
  • Multi-layer. Substitution + transposition combinations, null extraction, three-layer cascades.
  • Key models. Running keys, autokey (structurally eliminated), progressive, Fibonacci, date-derived.
  • Bespoke. RS44, VIC, Wheatstone, Weltzeituhr, DRYAD charts, NATO/COMSEC.
  • Uncategorized. Morse-derived, encoding schemes, sculpture-physical hypotheses.

Important caveat: These eliminations are always scoped to the assumptions actually tested. Single-layer eliminations do not rule out the same cipher family as one layer of a multi-layer construction.

Working hypotheses

None of these are proven. They represent live hypothesis surfaces or residual coverage gaps. Status as of June 2026.

  1. Two systems. Sanborn has publicly stated K4 uses "two systems of enciphering," distinct from the Vigenere used for K1-K3. The project treats this as Tier-3 contextual hearsay (per claims-registry entries C-SANBORN-01 and C-SANBORN-02), not as a load-bearing piece of operational evidence. The phrase admits multiple mutually-incompatible structural interpretations and has so far not produced a non-arbitrary cipher mechanism. Any specific mechanistic interpretation remains a hypothesis that must be paired with independent measurable evidence before it gains evidentiary weight. See the pseudo-clue-pack admission standard rule 11.
  2. CT perturbation. Photographed coding charts in Sanborn's archive raised the possibility that the canonical 97-character ciphertext includes a small number of transcription errors. Stage A (every single-character variant) was tested and closed clean-negative in May 2026; the as-carved text is treated as authoritative. Multi-error variants remain formally open but are not a live lead.
  3. W-delimiter structural hypothesis. The five carved Ws at positions 20, 36, 48, 58, and 74 explain the old width-21 vertical-bigram anomaly. As a single-layer construction the W-segmentation hypothesis has been saturated (80+ tested, no signal); it remains admissible as one layer within multi-layer constructions. Whether the Ws are delimiters, nulls, row markers, or something else remains open.
  4. Null insertion or procedural markers. Some positions in K4 may be filler or marker symbols. The number, placement, and interpretation remain unknown. The older statistical "null palette" family is retired and should not be treated as evidence.
  5. Residual running-key and non-periodic additive models. Within additive-key assumptions and direct correspondence, running-key style models remain an open residual family. That is a scoped statement, not a global claim about all possible K4 constructions.

See docs/research_questions.md for the full list of open questions.

What is public, and what is not

As of June 2026 this repository is published in full as a gift to the Kryptos community, including the complete kryptosbot/ multi-agent controller and the full research history. Exactly four classes stay out of the public repo:

  1. Agent and skill definitions (.claude/): the precise prompt construction of the research agents stays private. The architecture they implement is fully visible in kryptosbot/.
  2. Secrets: API keys and .env files.
  3. Local reference material (reference/, archive/, analysis_runs/): third-party books and scans (some copyrighted), bulk photo corpora, and community-thread archives. The photographs the project shares are the ones published on kryptosbot.com/archive.
  4. Machine outputs: multi-gigabyte run outputs, caches, and build artifacts. Result summaries that feed the site live in results/ and docs/.

Contributing

The whole point of open-sourcing this is to get more eyes on K4.

Try a theory: Use the browser workbench, no install needed. Apply transpositions and substitutions, see crib scores in real time.

Submit a theory: Use kryptosbot.com/submit to check if your idea has already been tested. Novel feasible theories are queued for evaluation.

Write an experiment: See any script in scripts/ for the pattern. Import constants from kryptos.kernel.constants, implement an attack() function, check results against the scoring system.

Report an error: If you think an elimination is wrong, open an issue.

Project research-state documents

Key external references

  • Bean 2021: "Cryptodiagnosis of Kryptos K4," HistoCrypt 2021.
  • Elonka Dunin's Kryptos page: community hub and transcription.
  • Ed Scheidt interviews and Sanborn's August 2025 open letter: summarized on kryptosbot.com/about-kryptos. (The project's local reference/ corpus of third-party source material is not in the public repo for copyright reasons.)

Credits

Built by Colin Patrick (human lead) and Claude (computational partner, Anthropic).

The sculpture Kryptos was created by Jim Sanborn with cryptographic assistance from Ed Scheidt (retired Chairman of the CIA Cryptographic Center).


Contributors

jcolinpatrick

2 commits

Languages

Python

97.9%