STATION 25 / FIELD MANUAL

← Back to crypto library

Autokey

Polyalphabetic

Plaintext-autokey begins with a short seed word, then extends the key with the message itself. Unlike Vigenère, it does not keep repeating the seed. This reference uses addition with A=0.

How to recognise it

A seed-key clue with weak or absent repeating-key patterns may suggest Autokey. There are also ciphertext-autokey variants; the extension rule must be known before decrypting.

Worked example: encrypt GARDEN with seed DOG

Plaintext   G  A  R  D  E  N
Values      6  0 17  3  4 13
Key stream  D  O  G  G  A  R
Key values  3 14  6  6  0 17
Sums mod26  9 14 23  9  4  4
Ciphertext  J  O  X  J  E  E
  1. Start the key stream with DOG.
  2. Extend it with the plaintext GARDEN, taking only as many letters as needed: DOGGAR.
  3. Add letter values modulo 26. At the last position, 13+17=30 becomes 4 (E). The result is JOXJEE.

Work backwards: decrypt JOXJEE

  1. Subtract the known seed DOG from JOX to recover GAR.
  2. Append those recovered letters to the key stream.
  3. Subtract GAR from the remaining JEE: 9−6=3 (D), 4−0=4 (E), 4−17+26=13 (N).
  4. Join the recovered sections: GARDEN.

Conventions and common mistakes

You cannot write the entire decryption key in advance unless you already know the plaintext. Work progressively. Repeating DOG as DOGDOG would produce a different cipher. One incorrect recovered letter can affect later key-stream positions.

  • Vigenère — The repeating-key construction to compare against.
  • Known plaintext — How known letters can reveal key-stream positions.

Useful desk reference

Alphabet positions — Use the A=0 row for modular arithmetic.

Support this project

Enjoying Advent of Cypher? If you'd like to support the project and help keep it running, you can make a small donation. Completely optional, always appreciated.