cyberchef_substitution_break
Recover plaintext from monoalphabetic substitution ciphers by hill-climbing against English trigram fitness. Also cracks Caesar, ROT-N, and Atbash; accept known letter pairs to refine results.
Instructions
Recover a monoalphabetic substitution mapping from ciphertext alone, by hill-climbing on English trigram fitness with random restarts. Substitute needs the mapping and no operation finds one. Also solves Caesar, ROT-N and Atbash. Measured on held-out prose: 83.6% of letters at 150, 91.2% at 250, 95.9% at 350 — so expect one or two letter pairs still swapped. Pin what you can read with known_mapping and run it again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Make the search reproducible. Unset is non-deterministic, which is the right default: a fixed seed that lands in a bad local optimum lands there every time. | |
| input | Yes | The ciphertext. Non-letters are ignored and restored in the output. | |
| restarts | No | Independent hill climbs. More is better and slower; the measured figures used 120. Bounded by a 20-second wall clock. | |
| known_mapping | No | Letters you already know, as comma-separated `cipher:plain` pairs, e.g. "q:t,w:h". Held fixed and never swapped. | |
| preview_letters | No | How much decrypted text to return. 0 for none. |