---
title: "Classical ciphers"
description: "Caesar to Enigma. Letters in and letters out. Every choice that makes a puzzle answer reproducible is written down."
canonical_url: "https://ciphers.agntn.dev/ciphers/classical"
---
# Classical ciphers

> Caesar to Enigma. Letters in and letters out. Every choice that makes a puzzle answer reproducible is written down.

The pen and paper half of the library, plus one machine. They work on letters A to Z and leave everything else where it was, so a sentence keeps its spaces and its commas and still reads like a sentence after encoding. Great for riddles, lessons and CTFs. Useless for anything you actually want to keep secret, and that's fine, it's not what they're here for.

<cipher-roster category="classical">



</cipher-roster>

## Conventions they share

- Latin alphabets are A to Z. Digits, punctuation, emoji and non-Latin letters pass through untouched unless `stripNonAlpha` is set, and they never advance a key.
- `preserveCase` is on by default. Lowercase in, lowercase out.
- Playfair, Polybius and Bifid fold J into I. Tap code shares C and K. Bacon uses 26 letters unless `letters: 24` asks for his own table. Enigma is the Wehrmacht M3 with rotors I, II, III and reflector B.
- Shift 0, one rail, a multiplier or a Hill matrix with no inverse. An option that would make the cipher an identity or break the bijection is an error before the first letter. No silent pass.

## Families

**Shift** adds a constant to every letter. **Reflection** mirrors the alphabet. **Mixed alphabet** shuffles the whole thing. By keyword or by hand. **Multiplicative** multiplies and adds modulo 26. **Polyalphabetic** changes the shift as it goes, by keyword, by position or by turning a disk. **Digraph** works on pairs. **Polygraphic** runs a whole block through a matrix, so one letter changes all of it. **Fractionation** breaks a letter into coordinates or symbols and, in Bifid and ADFGVX, shuffles the pieces. Nihilist adds a key to them instead. **Transposition** moves letters without changing a single one. **Rotor** has one member, and that one has enough settings for the rest of the list combined.

## Where to start

Stuck on a puzzle? [Count the letters](https://ciphers.agntn.dev/guide/analysis) first. A histogram that still looks like English means one alphabet, maybe shifted, and a Caesar [brute force](https://ciphers.agntn.dev/playground?op=brute) takes a second. A flat one means a key that changes as it goes, so the Vigenère family is the next stop.


## Sitemap

See the full [sitemap](https://ciphers.agntn.dev/sitemap.md) for all pages.
