cipher.ink Write a message

Learn · History

A short history of cryptography

Four thousand years in one read: counting letters, mixing alphabets, machines, mathematics and open contests, with a link to every cipher.

People have hidden what they write for as long as they've written. The history of that effort, cryptography, is a long contest between the people who make ciphers and the people who break them, where each advance on one side forces the other to invent something new. It runs from a Mesopotamian potter guarding a glaze recipe to quantum-resistant algorithms standardized in 2024, and its turning points are fewer than you'd expect: counting letters, mixing alphabets, machines, mathematics, and the decision to build ciphers in public. This is the short version, with links to every cipher in the encyclopedia and to the timeline that lists the dates in one place.

The ancient world: hiding, not yet encrypting

The earliest examples are modest. An Egyptian tomb from about 1900 BC has hieroglyphs written in unusual ways, which scholars don't consider serious attempts at secret communication. A Mesopotamian clay tablet from near 1500 BC records a pottery-glaze recipe in a disguised script, presumably because the recipe was worth money. Hebrew scribes of the sixth century BC or thereabouts used Atbash, which reverses the alphabet, and the book of Jeremiah contains it. Those are puzzles and trade secrets, not systems.

The Greeks and Romans left the first descriptions of methods. A Spartan staff, the scytale, appears in the poet Archilochus in the seventh century BC, and Plutarch described it around AD 100 as a way to write messages that only a staff of the right size could read (whether anyone used it for secrecy is disputed). Polybius, around 150 BC, described a square for turning letters into pairs of numbers, which gave later ciphers their grid (Polybius square). And Julius Caesar wrote private letters with a shift of three, as Suetonius records, and it's been the schoolroom cipher ever since (Caesar cipher, ROT13, and its textbook relatives, the affine cipher and simple substitution).

The first great break: counting letters

For about a thousand years, every cipher in use replaced each letter with a fixed substitute. Around 850, in Baghdad, the philosopher al-Kindi wrote the oldest known description of how to break them: count how often each letter appears, and match the commonest ciphertext symbols to the commonest letters of the language (al-Kindi and frequency analysis). The method needs only the structure of the language, so it sidesteps the key entirely, and it made simple substitution unsafe for anything important. Europe had similar methods by the Renaissance, and in 1474 Cicco Simonetta wrote a manual on deciphering Latin and Italian.

The Renaissance answer: more than one alphabet

The countermeasure was to stop using a single substitution. Early in the fifteenth century the court of the Duke of Mantua used a homophonic cipher, with several symbols for common letters. Around 1467 Leon Battista Alberti proposed changing the alphabet during the message. In 1553 Giovan Battista Bellaso described a repeating-key version, which people later credited to Blaise de Vigenère by mistake, and in 1586 Vigenère published a different and stronger idea, the autokey (Vigenère, autokey, Beaufort). For three centuries it went by le chiffre indéchiffrable.

The state meanwhile ran on codes and nomenclators, lists of symbols for words and syllables. The cipher that betrayed Mary, Queen of Scots in 1586 was one of these, and so was the Great Cipher of the French kings, which the Rossignol family designed in the seventeenth century and which resisted every attempt until about 1890. The story of 1586 is in the cipher that convicted Mary. Other tools appeared too: Bacon's binary cipher (1605), keyed columnar transposition (described in 1685), pigpen as used by Freemasons, and the book cipher that made the Beale papers famous.

The nineteenth century: the telegraph and the mathematicians

The telegraph turned secrecy into a mass problem, since every message crossed wires anyone could tap. In 1854 Charles Wheatstone described a cipher that encrypts letters in pairs, which Lord Playfair promoted and armies used for decades (Playfair, and the later pair and block ciphers two-square, four-square and bifid of Félix Delastelle). Thomas Jefferson's wheel cypher, described in the 1790s, was reinvented by Étienne Bazeries in 1891 and adopted by the US Army as the M-94 in 1922 (wheel cipher).

The Vigenère cipher finally fell in the 1850s and 1860s to Charles Babbage and Friedrich Kasiski, who saw that a repeating key turns the cipher into several Caesar ciphers side by side. In 1883 Auguste Kerckhoffs wrote down the rule that has governed serious cryptography since: the system shouldn't need secrecy, and the enemy may know everything but the key (Kerckhoffs's principle). In 1882 a banker named Frank Miller had described a one-time key for telegrams, an idea rediscovered only in 2011.

Machines and world wars

In 1917 Gilbert Vernam of AT&T devised a teleprinter cipher that adds a key tape character by character. With a key that's random, as long as the message and used once, nobody can break the result (the one-time pad). The First World War also gave us the ADFGVX cipher, introduced by Germany in 1918 and broken by Georges Painvin the same year (ADFGVX). Between the wars came rotor machines, which change the substitution with every letter. Arthur Scherbius applied for his patent in February 1918, and Enigma entered military service in 1930. Marian Rejewski worked out its wiring in December 1932, the Poles read it for seven years, and Bletchley Park turned their method into an industry (breaking Enigma). Other machines each have their own story: the German Lorenz teleprinter cipher (Lorenz), the Japanese diplomatic Purple, Britain's Typex, America's SIGABA and the Hagelin M-209. Lester Hill's 1929 cipher, built on matrix algebra, hinted at what was coming (Hill cipher).

At the other extreme, a cipher with perfect theoretical secrecy was in use and got broken anyway, because its users cut corners: the Soviet one-time pads of the Venona project (Shannon and perfect secrecy).

1945 to 1980: mathematics takes over

Claude Shannon's classified report of September 1945, published in 1949, did for cryptography what Euclid did for geometry. It said exactly what a secure cipher is and proved what perfect secrecy costs (Shannon and perfect secrecy). Then computers arrived, and the question became what to do with them. In the mid-1970s the US government published a standard cipher for everyone, the Data Encryption Standard, adopted in 1977 with a 56-bit key and S-boxes whose design criteria were never published (DES, the history of AES).

The same decade solved the old key distribution problem. In 1976 Whitfield Diffie and Martin Hellman published public-key cryptography (Diffie-Hellman). In 1977 Rivest, Shamir and Adleman made the first practical public-key encryption (RSA). And in 1997 it came out that three mathematicians at Britain's GCHQ had found the same ideas in secret between 1969 and 1974 (public-key cryptography was invented twice). More schemes followed: Massey-Omura in 1982, ElGamal and elliptic-curve cryptography in 1985.

The Crypto Wars and the open contest

When cryptography became useful to everyone, governments objected. They restricted export of strong ciphers, investigated the author of PGP, proposed an NSA-designed chip with escrowed keys (it failed), and faced a student who sued over his right to publish a program (the Crypto Wars). Meanwhile cryptographers showed the rules were pointless. In 1998 the EFF built a machine for under $250,000 that found a DES key in 56 hours, and DES was finished.

The answer was a competition. NIST asked the world in 1997 for a successor, received fifteen candidates in 1998, picked five finalists in 1999, and announced Rijndael on October 2, 2000. It's the cipher that protects most traffic on the Internet, including the messages on this site (AES, how AES works). The finalists Serpent and Twofish are in the encyclopedia, along with the older Triple DES and Blowfish and the stream ciphers RC4 and ChaCha20. The contest model, with open scrutiny and no secrets, is Kerckhoffs's principle in practice, and people used it again for the SHA-3 hash and for the post-quantum algorithms. Where the process failed, the lesson is just as clear: the unexplained constants in Dual_EC_DRBG.

Hashes, and the breaking of MD5 and SHA-1

A cryptographic hash is a different tool, a fingerprint with no key. MD5 (1991) and SHA-1 (1995) were the standards. In 2004 collision attacks broke the full MD5, and in 2017 the SHAttered attack did the same to SHA-1 (what a hash function is, MD5, SHA-1). Their successors are SHA-2 (SHA-256 step by step) and SHA-3 (SHA-3).

Puzzles that survived

Some ciphers held out for generations and then fell to patient work with computers. The Zodiac Killer's 340-character cipher was solved on December 5, 2020 (how the Zodiac 340 was solved), and lost letters of Mary, Queen of Scots were deciphered and announced in 2023. Others remain open. The fourth passage of Kryptos, the sculpture dedicated at the CIA on November 3, 1990, has no public solution.

Today and tomorrow: the quantum horizon

The public-key systems of the 1970s rest on factoring and discrete logarithms, which a large quantum computer would solve efficiently. Symmetric ciphers and hashes lose far less. So NIST ran another open contest, announced its first choices in July 2022, and published the first post-quantum standards on August 13, 2024 (post-quantum cryptography, ML-KEM, ML-DSA). The first deployments combine the old and the new, and they're already in use.

The patterns

  • Something its designers never considered breaks every cipher: letter counts, repeating keys, wiring, reused key pages, short keys, bad random numbers.
  • Secrecy of the method is a weak foundation, and openness of the method a strong one.
  • Procedures break more systems than mathematics does. Enigma's operators, Venona's duplicated pads and Mary's barrel are the same story.
  • Old ideas come back. Substitution and transposition are still the two halves of every modern cipher, with mathematics to make them hard.

How cipher.ink fits in

This site stands at the end of the line: AES-256-GCM, with a key made by PBKDF2-HMAC-SHA256, in the browser, with code open to inspection (how it works, the code). It's been through the story itself, starting in 2016 with a weak mode and getting rebuilt in 2026 (the history of cipher.ink). For the whole sweep in one list, see the timeline.

On the timeline

  • c. 1900 BC Unusual hieroglyphs in an Egyptian tomb: play with writing rather than serious secret communication.
  • c. 1500 BC A Mesopotamian clay tablet records a pottery-glaze recipe in a disguised script, presumably a valuable trade secret.

Further reading

  1. Kahn: The Codebreakers (Scribner, 1996)
  2. Singh: The Code Book (1999)
  3. Wikipedia: History of cryptography
  4. Shannon: Communication Theory of Secrecy Systems (1949)