Home › Ciphers › Types of Ciphers
Types of Ciphers
Every classical cipher ever invented does one of two things to a message: it changes the letters, or it changes their order. Everything else — the alphabets, grids, wheels and rotors in this site's catalogue — is machinery built on those two ideas. This guide walks the family tree from that first split down to the named systems, so that when you meet a scrambled text you can ask the right first question: were the letters replaced, or merely moved?
Substitution ciphers replace each letter with another letter, symbol or number — the order survives, the identities change. Transposition ciphers keep every letter and shuffle their positions. Substitution divides further by how many alphabets it rotates through (one: monoalphabetic; many: polyalphabetic) and by the unit it works on (single letters, pairs, or letters split into coordinates). Add the border country — codes, which replace whole words, and encodings, which hide nothing at all — and every system in the catalogue has a home.
Holding a ciphertext rather than a curiosity? Skip the taxonomy and run it through the Cipher Identifier — or learn to read the tells yourself in How to Identify a Cipher.
The master split: replaced, or moved?
Take the word HELLO. A substitution cipher might send it to KHOOR — every letter changed by the same rule (here, shifted three places), the word's shape and length untouched. A transposition cipher might send MEET ME AT NOON to MMNETETONEAO — every letter present and correct, the order destroyed by writing the message onto three rails and reading the rails off in sequence. The two families fail differently, which is how you tell them apart: count the letters. A substitution ciphertext has the wrong letters in the right pattern of frequencies; a transposition ciphertext has exactly the plaintext's letters, frequencies and all, in the wrong order. That single test — does the letter census match ordinary English? — is the first branch of every identification, human or machine.
| Substitution | Transposition | |
|---|---|---|
| What changes | Letter identities | Letter positions |
| Letter frequencies | Disguised but structured — the shape survives under new names | Identical to the plaintext's |
| First attack | Frequency analysis | Anagramming and pattern search |
| Examples here | Caesar, Vigenère, Playfair | Rail fence, columnar, route |
Monoalphabetic substitution — one alphabet, faithfully wrong
The oldest family: a single fixed mapping from plaintext letters to cipher letters, used for the whole message. Caesar is the mapping at its simplest — the alphabet slid by a fixed distance, as Suetonius reports Julius Caesar doing with a shift of three. Atbash mirrors the alphabet instead. A keyword cipher builds the mapping from a word; the general simple substitution allows any of the 26! possible mappings, a key space so large that brute force is hopeless — and irrelevant, because the family's fatal flaw is statistical. Each plaintext letter always becomes the same cipher letter, so the ciphertext inherits English's lopsided letter frequencies under assumed names: the commonest cipher letter is probably E. Al-Kindi described the attack in the 9th century, and it still opens every cryptogram in every newspaper. The cryptogram solver automates exactly that reasoning, with word patterns as reinforcements.
Two refinements try to patch the flaw from inside the family. Homophonic substitution gives common letters several cipher symbols, flattening the frequencies by generosity. The null cipher goes the other way and hides the real letters inside a crowd of decoys, so the message must be extracted by a rule — every third letter, say — rather than decoded.
Polyalphabetic substitution — many alphabets in rotation
If one alphabet leaks frequencies, use several and keep switching. The Vigenère cipher rotates through alphabets chosen by a keyword: with the key LEMON, the plaintext ATTACKATDAWN becomes LXFOPVEFRNHR — the letter A is enciphered four different ways inside one short word. For roughly three centuries the system carried a reputation as le chiffre indéchiffrable, the indecipherable cipher. Its weakness is the key's repetition: once the key length is known — found by hunting repeated sequences, the method Kasiski published in 1863, or by the column statistics the Vigenère solver uses — the message splits into interleaved Caesar ciphers and falls one column at a time.
The family's branches are variations on where the alphabets come from: the key itself running on (autokey), the plaintext feeding the key (running key uses a book's text), the alphabet itself being keyed and re-keyed per letter (Quagmire), or the rotation driven by machinery — which is where this family hands over to the machines below. Its limiting case is the one-time pad: a key as long as the message, truly random, used once — the only system in the catalogue that is provably unbreakable, and the only one whose page is allowed to say so.
Pairs and coordinates — changing the unit
Frequency analysis feeds on single letters, so two families attack the unit itself. Digraph systems encipher letters in pairs through keyed squares: Playfair, the first famous one, replaces each pair by the corners of its rectangle in a 5×5 grid, and its descendants — two-square, four-square, trisquare — multiply the squares. Pair frequencies are far flatter than single-letter ones, and the attack has to climb a harder hill.
Fractionating systems split each letter into coordinates and recombine the halves: the Polybius square turns a letter into two digits; Bifid writes all the row numbers, then all the column numbers, and reads off new letters — a letter's two halves end up in different letters entirely, which is why these systems smear statistics so effectively. The line runs from Polybius through Trifid's cube to the ADFGVX of 1918 and the straddling checkerboard that fed the VIC, the most complex hand cipher in the catalogue. A neighbouring trick, Bacon's biliteral cipher, writes each letter as a five-symbol pattern of two kinds — the ancestor of every binary code.
Transposition — the letters stay, the places change
The second great family's whole art is the route. Write the message into a shape and read it out by a different path: down the columns of a grid whose order a keyword sets (columnar), along a zigzag (rail fence), around a rod (scytale, the Spartan staff), along a spiral or a snake (route), or through the holes of a turning grille. Do it twice (double transposition) and the anagramming problem squares itself, which is why that system served as a field cipher well into the twentieth century. Identification is the mirror of substitution's: the letter census is perfect English while no word reads — the transposition solver tests the standard shapes in order.
Codes, and encodings that are not ciphers at all
A code replaces whole words or phrases from a codebook — “word 4127” for “attack at dawn” — where a cipher works below the word, on letters. Codes and ciphers mix happily in practice (the VIC's checkerboard is part code), and the book cipher straddles the line: the key is a specific text, and the ciphertext is a list of pointers into it. The symbol systems — pigpen, the dancing men — are substitutions whose cipher alphabet happens to be drawn rather than written.
An encoding is not trying to keep a secret at all. Base64, hex and binary rewrite bytes so they survive text channels; Morse rewrites letters so they survive a wire. Anyone may decode them, by design — which is why the identifier checks for them first: a large share of “mystery ciphertexts” are an encoding wearing a cipher's clothes, sometimes with a real cipher underneath, which is the exact situation the chain solver exists for.
Machines — substitution with moving parts
A rotor machine is a polyalphabetic cipher whose alphabet changes with every keystroke, the changes driven by wheels instead of a repeating keyword — so the period explodes from a keyword's length to millions of letters. The Enigma is the famous one; the catalogue also carries its British counterpart Typex, the American SIGABA whose rotors are stepped by other rotors, the Lorenz teleprinter machine, the hand-cranked M-209, and the Jefferson wheel that anticipated them all with disks on a spindle in the 1790s. Two of the machine pages run on disclosed surrogate wirings — the historical tables were never published — and say so on the page, which is the only honest way to offer them. The modern descendant of the whole line is the stream cipher, and its classical seed is here too: XOR, Vernam's operation, the one-time pad at byte level.
How the catalogue files them
The catalogue groups its 91 systems into nine families by mechanism — shifts and simple substitutions; polyalphabetics; keyword, phrase and book systems; Polybius and fractionation; digraphs and squares; transposition; checkerboards, codes and word systems; the ACA and advanced hand systems; and the machines. Mechanism, not era, because mechanism decides how a ciphertext behaves under attack — and therefore which solver you reach for. Within a family, each page names its nearest relatives and the exact difference, so the catalogue reads as an argument rather than a pile: two-square against four-square, Bifid against Trifid, VIC against the checkerboard it grew from.
Which type should you learn first?
For school and first puzzles
Four monoalphabetic systems workable with pencil alone, in rising strangeness. The cheat sheet prints all four.
For puzzle hunts and escape rooms
The three shapes hunt designers actually use, in the order the identification guide teaches you to tell them apart.
For the deep end
One idea — split the letter into coordinates — followed to its limit: the square, the block, the cube, and the Soviet agent system built on a checkerboard.
Frequently asked questions
What is the difference between a cipher and a code?
Granularity. A cipher transforms text at the letter (or pair, or bit) level by an algorithm and a key; a code replaces whole words and phrases from a codebook. “Attack at dawn” might be enciphered letter by letter, or coded as a single codebook number. The identification guide explains how the difference shows in a mystery text.
Is Base64 a cipher?
No — it is an encoding: a public, keyless rewriting of bytes as safe characters, designed for transport, not secrecy. The same goes for hex, binary and Morse. They belong in this guide because they are the first thing a mystery text should be checked against, and because real ciphers so often arrive wrapped in them.
Which type of cipher is strongest?
Among classical systems, the correctly used one-time pad stands alone — it is provably unbreakable, and impractical in equal measure. Everything else trades strength for usability and has a Breaking-it section on its page for a reason. For anything that genuinely matters, none of these is the answer: modern encryption exists, and the classical catalogue is for learning, puzzles and pleasure.
Why does the catalogue group by mechanism instead of by era?
Because era tells you a story but mechanism tells you what to do. A ciphertext from 1550 and one from 1950 fall to the same attack if both are monoalphabetic; grouping by mechanism groups by the attack that works, which is what a solver — human or otherwise — needs first.
Where do hashes fit in this taxonomy?
They don't — a hash is a one-way fingerprint, not a cipher: there is no key and no decryption, by design. This site's Phase 1 covers ciphers and encodings; the identification guide shows how to recognise a hash-shaped string and stop trying to “decode” it.