Classical Cipher Comparison Table

Compare 23 classical ciphers side by side. This reference table covers cipher type, key format, security level, key space size, and best use cases to help you choose the right cipher for your needs.

Full Cipher Comparison

CipherTypeKey TypeKey SpaceSecurityYear
Caesar CipherMonoalphabetic SubstitutionSingle integer (1-25)25Very Weak~58 BC
ROT13Monoalphabetic SubstitutionFixed (shift of 13)1None (obfuscation only)1982
Atbash CipherMonoalphabetic SubstitutionNone (fixed mapping)1Very Weak~500 BC
Affine CipherMonoalphabetic SubstitutionTwo integers (a, b)312Weak~1900s
Keyword CipherMonoalphabetic SubstitutionKeyword string~2×10²⁶Weak~1500s
Pigpen CipherSymbol SubstitutionNone (fixed grid)1Very Weak~1700s
Polybius SquareFractionation5×5 grid arrangement~2×10²⁶Weak~150 BC
Vigenère CipherPolyalphabetic SubstitutionKeyword string26ⁿ (n = key length)Moderate1553
Beaufort CipherPolyalphabetic SubstitutionKeyword string26ⁿ (n = key length)Moderate~1857
Autokey CipherPolyalphabetic SubstitutionKeyword + plaintext extension26ⁿ (non-repeating key)Moderate-Strong1586
Trithemius CipherPolyalphabetic SubstitutionNone (auto-incrementing shift)1Weak1508
Gronsfeld CipherPolyalphabetic SubstitutionNumeric key (digits 0-9)10ⁿ (n = key length)Weak-Moderate~1700s
Porta CipherPolyalphabetic SubstitutionKeyword string (13 alphabets)13ⁿ (n = key length)Moderate1563
Running Key CipherPolyalphabetic SubstitutionBook/text passage (same length as message)Very large (full text)Moderate-Strong~1800s
Playfair CipherDigraph Substitution5×5 keyword matrix~2×10²⁶Moderate1854
Four-Square CipherDigraph SubstitutionTwo 5×5 keyword matrices(~2×10²⁶)²Strong (for classical)1902
Hill CipherPolygraphic SubstitutionN×N invertible matrixVery large (matrix dependent)Moderate-Strong1929
Alberti Disk CipherPolyalphabetic SubstitutionDisk position + shift scheduleVariable (depends on rotation frequency)Moderate1467
Baconian CipherBinary Encoding / SteganographyNone (fixed 5-bit encoding)1Weak (steganographic only)1605
Homophonic CipherHomophonic SubstitutionMultiple symbols per letterVery large (mapping dependent)Moderate-Strong~1400s
Morse CodeEncoding (not encryption)None (standard mapping)1None (encoding, not cipher)1837
Vernam Cipher (OTP)Stream CipherRandom key (same length as message)26ⁿ (truly random)Perfect (information-theoretically secure)1917
Straddling CheckerboardFractionationLetter arrangement + row headersVery largeModerate~1940s
Quagmire CipherPolyalphabetic Substitution1-3 keyword alphabets + indicatorVery large (multiple mixed alphabets)Strong (for classical)~1900s

Caesar vs ROT13 vs Atbash: Monoalphabetic Comparison

Caesar, ROT13, and Atbash are the simplest substitution ciphers. They all replace each letter with a fixed counterpart, but they differ in how that substitution is determined. The table below shows the same plaintext encrypted under each system.

FeatureCaesar CipherROT13Atbash Cipher
Substitution RuleShift each letter forward by k positionsShift each letter forward by 13 positionsReverse the alphabet (A↔Z, B↔Y, ...)
KeyInteger 1-25 (variable)None (fixed at 13)None (fixed reversal)
Key Space2511
Self-Inverse?No (decrypt requires reverse shift)Yes (apply twice → original)Yes (apply twice → original)
"HELLO" encryptedKHOOR (shift 3)URYYBSVOOL
"ATTACK" encryptedDWWDFN (shift 3)NGGNPXZGGZXP
FormulaE(x) = (x + k) mod 26E(x) = (x + 13) mod 26E(x) = (25 − x) mod 26
Handles Numbers?Optional (with extended alphabet)No (letters only; use ROT5 for digits)No (letters only)
OriginJulius Caesar, ~58 BCUsenet forums, 1982Hebrew scholars, ~500 BC
Best Use CaseTeaching encryption fundamentalsHiding spoilers, casual obfuscationHistorical study and puzzles

When should you use which?

  • Caesar: best for teaching substitution fundamentals and introducing the idea of a secret parameter.
  • ROT13: best for quick reversible obfuscation when you do not want to manage a key.
  • Atbash: best for historical, literary, and puzzle contexts involving mirrored alphabets.

Vigenère vs Beaufort vs Autokey: Polyalphabetic Comparison

Vigenère, Beaufort, and Autokey are all polyalphabetic ciphers built around a keyword, but they differ in key expansion, reciprocity, and whether they leave repeating-key patterns behind.

FeatureVigenère CipherBeaufort CipherAutokey Cipher
Encryption FormulaC = (P + K) mod 26C = (K − P) mod 26C = (P + Kᵢ) mod 26
Key ExtensionKeyword repeats cyclicallyKeyword repeats cyclicallyKeyword + plaintext appended as key
Self-Reciprocal?No (decrypt subtracts key)Yes (same operation encrypts and decrypts)No (decrypt requires iterative key recovery)
Repeating Key Pattern?Yes — vulnerable to KasiskiYes — vulnerable to KasiskiNo — key is non-repeating
"HELLO" + key "KEY"RIJVSDSJJGRIJSS
"ATTACK" + key "KEY"KXDKEMKVFAOQKXDKEK
Key DerivationKEY→KEYKE→KEYKEY...KEY→KEYKE→KEYKEY...KEY→KEYHE→KEYHELLO...
Tabula RectaStandard (row = key, col = plain)Reversed (row = key, col = cipher)Standard (same as Vigenère)
Cracking MethodKasiski + frequency analysisSame as Vigenère (Kasiski + Friedman)Known-plaintext attack, statistical methods
Security LevelModerateModerateModerate-Strong
InventorGiovan Battista Bellaso (1553), later attributed to VigenèreSir Francis Beaufort (~1857)Blaise de Vigenère (1586)

When should you use which?

  • Vigenère: the standard starting point for learning keyword-based polyalphabetic encryption.
  • Beaufort: useful when you want reciprocal encryption and decryption with one operation.
  • Autokey: stronger than Vigenère for short messages because it removes the repeating-key pattern.

How do classical ciphers compare in security?

Security levels range from none to perfect. By modern standards, most classical ciphers fall between very weak and moderate, with their main value lying in education, history, and puzzles.

SecurityCiphersMain Vulnerability
PerfectVernam (One-Time Pad)None — unbreakable if used correctly
StrongFour-Square, Quagmire, HomophonicExtensive cryptanalysis, large known-plaintext needed
ModerateVigenère, Beaufort, Autokey, Playfair, Hill, Porta, Running KeyKasiski examination, known-plaintext attacks, pairwise frequency analysis
WeakAffine, Keyword, Gronsfeld, Trithemius, PolybiusFrequency analysis, small key space, predictable patterns
Very Weak / NoneCaesar, ROT13, Atbash, Pigpen, Morse, BaconianBrute force in seconds, no secret key, known mapping

What are the main types of classical ciphers?

Classical ciphers can be grouped by how they transform plaintext. These categories are useful both for choosing a cipher and for deciding how to attack one analytically.

Cipher TypeHow It WorksExamplesKey Weakness
Monoalphabetic SubstitutionEach letter always maps to the same ciphertext letterCaesar, Atbash, Affine, KeywordPreserves letter frequency — easy to crack with frequency analysis
Polyalphabetic SubstitutionUses multiple alphabets cycling by keywordVigenère, Beaufort, Autokey, PortaRepeating keys create detectable patterns
Digraph / PolygraphicEncrypts 2+ letters together as a unitPlayfair, Four-Square, HillDigraph or polygraphic frequency analysis
FractionationConverts letters into numbers or coordinates, then transforms themPolybius, Straddling CheckerboardFrequency analysis on coordinate pairs
Stream CipherCombines plaintext with a keystream one symbol at a timeVernam (One-Time Pad)Key management — key must be truly random and never reused

When were these classical ciphers invented?

Classical ciphers span more than 2,500 years of cryptographic history, from ancient scholars to 20th-century intelligence systems.

EraPeriodCiphers IntroducedKey Advance
Ancient500 BC – 100 BCAtbash, Caesar, PolybiusFirst substitution and fractionation concepts
Renaissance1400s – 1600sAlberti, Vigenère, Porta, Trithemius, Autokey, BaconianPolyalphabetic substitution emerges
Industrial1700s – 1800sPlayfair, Beaufort, Pigpen, MorseDigraph encryption and practical field ciphers
Modern Classical1900s – 1940sFour-Square, Hill, Vernam, Straddling CheckerboardStronger mathematical foundations and provable security

Best Use Cases by Cipher

CipherBest ForHow It Is Cracked
Caesar CipherEducation, puzzles, ROT13Brute force, frequency analysis
ROT13Spoiler hiding, casual obfuscationApply ROT13 again (self-inverse)
Atbash CipherBiblical studies, simple encodingKnown pattern, frequency analysis
Affine CipherMath education, modular arithmeticBrute force (312 keys), frequency analysis
Keyword CipherMemorable key encryptionFrequency analysis
Pigpen CipherVisual encoding, children's gamesKnown symbol grid
Polybius SquareCoordinate-based encoding, telegraphyFrequency analysis on coordinate pairs
Vigenère CipherHistorical encryption, educationKasiski examination, Friedman test
Beaufort CipherReciprocal encryption (same operation encrypts/decrypts)Same as Vigenère (Kasiski, Friedman)
Autokey CipherImproved Vigenère without repeating keyKnown-plaintext attack, statistical methods
Trithemius CipherHistorical study, progressive shift conceptKnown pattern (predictable shifts)
Gronsfeld CipherNumeric-key variant of VigenèreSame as Vigenère with smaller key space
Porta CipherSelf-reciprocal polyalphabetic cipherFrequency analysis on half-alphabets
Running Key CipherLong-key encryption using existing textStatistical analysis, known-book attack
Playfair CipherMilitary field use, digraph encryptionDigraph frequency analysis
Four-Square CipherDual-key digraph encryptionExtensive digraph frequency analysis
Hill CipherMathematical/matrix-based encryptionKnown-plaintext attack with linear algebra
Alberti Disk CipherFirst polyalphabetic cipher, historical studyPattern analysis on rotation points
Baconian CipherHidden messages in plain text, steganographyPattern recognition on binary groups
Homophonic CipherDefeating frequency analysisStatistical analysis, hill climbing
Morse CodeTelegraph communication, emergency signals (SOS)Standard reference chart
Vernam Cipher (OTP)Provably unbreakable encryption when used correctlyUnbreakable if key is truly random, used once, kept secret
Straddling CheckerboardCompact encoding for spy communicationsFrequency analysis on variable-length codes
Quagmire CipherAdvanced polyalphabetic with mixed alphabetsExtensive cryptanalysis, pattern detection

Frequently Asked Questions

What is the difference between Caesar cipher and Vigenere cipher?

The Caesar cipher uses a single fixed shift value to replace each letter, making it vulnerable to frequency analysis with only 25 possible keys. The Vigenere cipher uses a keyword to apply different shifts to each letter, creating a much larger key space and making it substantially harder to break.

Which classical cipher is the most secure?

The Vernam cipher, or one-time pad, is the only classical cipher with mathematically proven perfect security when used correctly. Among practical classical ciphers, Four-Square and Quagmire are usually considered the strongest because of their larger key spaces and more complex substitution structure.

What is the difference between monoalphabetic and polyalphabetic ciphers?

Monoalphabetic ciphers use one fixed substitution alphabet for the whole message, so letter frequencies remain visible. Polyalphabetic ciphers rotate through multiple alphabets based on a keyword, flattening frequency distributions and making classical frequency analysis much less effective.

Why is ROT13 not considered encryption?

ROT13 is simply a fixed Caesar shift of 13 with no secret key. Because everyone knows the transformation, it provides no real confidentiality and is used only for light obfuscation, such as hiding spoilers.

How do digraph ciphers like Playfair differ from single-letter ciphers?

Single-letter ciphers encrypt one symbol at a time, while digraph ciphers encrypt pairs of letters together. That changes the analysis unit from 26 single letters to 676 possible pairs, which makes direct frequency analysis more difficult.

What is the difference between Caesar, ROT13, and Atbash?

All three are monoalphabetic substitution ciphers. Caesar lets you choose a shift from 1 to 25, ROT13 is the fixed 13-shift special case, and Atbash reverses the alphabet entirely. ROT13 and Atbash are both self-inverse, while a general Caesar cipher is not.

What is the difference between Vigenère, Beaufort, and Autokey ciphers?

Vigenère and Beaufort both repeat a keyword, but they differ in how the key interacts with plaintext. Beaufort is reciprocal, meaning the same operation can encrypt and decrypt. Autokey extends the key with plaintext, removing the repeating-key pattern and making it more resistant to Kasiski-style analysis.