Autokey cipher

From Academic Kids

Missing image
A tabula recta for use with an autokey cipher

An autokey cipher is a cipher which incorporates the message (the plaintext) into the key. There are two forms of autokey cipher: key autokey and text autokey ciphers. A key-autokey cipher uses previous members of the keystream to determine the next element in the key stream. A text-autokey uses the previous message text to determine the next element in the keystream.

In modern cryptography, self-synchronizing stream ciphers are autokey ciphers.


The first autokey cipher was invented by Girolamo Cardano, and, although it contained a weakness that made it easy to break, a number of attempts were made by other cryptographers to produce an autokey system that was not trivial to break; eventually one was invented by Blaise de Vigenère. Vigenère started with a tabula recta, a square with 26 copies of the alphabet, the first line starting with 'A', the next line starting with 'B', etc., like the one on the right.

In order to encrypt a plaintext, one locates the row with the first letter to be encrypted, and the column with the first letter of the key. The letter where the line and column cross is the ciphertext letter. This continues for all the letters of the message. So far, this is identical to an earlier cipher scheme, which, confusingly, was erroneously attributed to Vigenère: the Vigenère cipher.

Despite this, Vigenère's innovation was in the way the key was generated. He started with a relatively short keyword, and appended the message to it. So if the keyword was "QUEENLY", and the message was "ATTACK AT DAWN", the key would be "QUEENLYATTACKATDAWN".


The ciphertext message would therefore be "QNXEPVYTWTWP".

This text-autokey cipher was hailed as "le chiffre indéchiffrable", and was indeed undeciphered for over 200 years, until Charles Babbage discovered a means of breaking the cipher.

Autokey in modern ciphers

Modern autokey ciphers use very different encryption methods, but they follow the same approach of using either key bytes or plaintext bytes to generate more key bytes. Most modern stream ciphers are based on pseudorandom number generators: the key is used to initialize the generator, and either key bytes or plaintext bytes are fed back into the generator to produce more bytes.

Some stream ciphers are said to be "self-synchronizing", because the next key byte usually depends only on the previous N bytes of the message. If a byte in the message is lost or corrupted, therefore, the key-stream will also be corrupted--but only until N bytes have been processed. At that point the keystream goes back to normal, and the rest of the message will decrypt correctly.

Classical cryptography edit  (
Ciphers: ADFGVX | Affine | Atbash | Autokey | Bifid | Book | Caesar | Four-square | Hill | Permutation | Pigpen | Playfair | Polyalphabetic | Reihenschieber | Running key | Substitution | Transposition | Trifid | Two-square | Vigenère

Cryptanalysis: Frequency analysis | Index of coincidence
Misc: Cryptogram | Polybius square | Scytale | Straddling checkerboard | Tabula recta

Academic Kids Menu

  • Art and Cultures
    • Art (
    • Architecture (
    • Cultures (
    • Music (
    • Musical Instruments (
  • Biographies (
  • Clipart (
  • Geography (
    • Countries of the World (
    • Maps (
    • Flags (
    • Continents (
  • History (
    • Ancient Civilizations (
    • Industrial Revolution (
    • Middle Ages (
    • Prehistory (
    • Renaissance (
    • Timelines (
    • United States (
    • Wars (
    • World History (
  • Human Body (
  • Mathematics (
  • Reference (
  • Science (
    • Animals (
    • Aviation (
    • Dinosaurs (
    • Earth (
    • Inventions (
    • Physical Science (
    • Plants (
    • Scientists (
  • Social Studies (
    • Anthropology (
    • Economics (
    • Government (
    • Religion (
    • Holidays (
  • Space and Astronomy
    • Solar System (
    • Planets (
  • Sports (
  • Timelines (
  • Weather (
  • US States (


  • Home Page (
  • Contact Us (

  • Clip Art (
Personal tools