Autokey

The Autokey cipher is a poly-alphabetic substitution cipher where each letter of the plaintext is combined with a letter from a predetermined key sequence to generate the ciphertext.

Explanation

The autokey cipher extends the Vigenere cipher. Like the Vigenere cipher it uses a keyword to encrypt plaintext, but it also incorporates the plaintext itself into the key stream.

Encryption works by concatenating the message to the keyword. Then you convert the resulting key into a series of numeric values mod 26. Then you advance each letter the indicated number of letters similar to the Caesar cipher.

Decryption works by converting the key the same as encryption, but instead of advancing each letter the given amount the values retreat. As each letter is decrypted the letter needs added to the key as well as the output so that decryption can continue.

The Autokey cipher is more secure than the Vigenere cipher due to the keyword including part of the text to be encoded. However, like the Vigenere cipher, the Autokey cipher is vulnerable to frequency analysis and other cryptanalysis techniques, especially if the keyword is short or if there are patterns in the plaintext.

Facts

The Autokey cipher was the inspiration for the ADFGVX cipher, which Germany used during World War I

It has also served as the precursor to more complex modern encryption methods