What is the Autokey Cipher?

The Autokey cipher is a type of cipher in which the characters of a plaintext are substituted with other characters. It is different because the same letter at different parts of the plaintext can be mapped to different letters in the ciphertext. It is more secure than the Vigenère cipher because of its different implementation. The encryption and decryption is also done with the table below:

vigenere cipher square

For example, suppose that the plaintext to be encrypted is ATTACKATDAWN.

The person sending the message chooses a keyword and appends it with letters from the plaintext until it matches the length of the plaintext, for example, the keyword "LEMON": LEMONATTACKA

Each row starts with a key letter. The rest of the row holds the letters A to Z (in shifted order). Although there are 26 key rows shown, a code will use only as many keys (different alphabets) as there are unique letters in the key string, here just 5 keys: {L, E, M, O, N}. For successive letters of the message, successive letters of the key string will be taken and each message letter enciphered by using its corresponding key row. The next letter of the key is chosen, and that row is gone along to find the column heading that matches the message character. The letter at the intersection of [key-row, msg-col] is the enciphered letter.

For example, the first letter of the plaintext, A, is paired with L, the first letter of the key. Therefore, row L and column A of the Vigenère square are used, namely L. Similarly, for the second letter of the plaintext, the second letter of the key is used. The letter at row E and column T is X. The rest of the plaintext is enciphered in a similar fashion:

Plaintext:  ATTACKATDAWN
Key:        LEMONATTACKA
Ciphertext: LXFOPKTMDCGN

Decrypting

Autokey ciphers are extremely difficult to decrypt by hand. The math behind it is extremely complex and beyond the scope of this website. However, there are plenty of tools that do the job by brute forcing it and other means.

Encrypting

Crypto Corner tool for encrypting plaintext at crypto.interactive-maths.com