Switch alphabets with the Vigenère cipher

Can four identical letters turn into two different letters? Let a repeating keyword set the wheel.

Follow the worked example below to see how the keyword changes the shift at each position.

One keyword, several shifts

In Lesson 2.1, you set a Caesar wheel once for the whole message. With the Vigenère cipher, each position gets its own setting from the keyword, the letters used as the key. Start at the first key letter and take one per message letter. When the keyword runs out, go back to its first letter.

Count from zero in the alphabet. A selects shift 0, B selects +1, C selects +2, and so on through Z at +25. Each shift gives a different ciphertext alphabet. On the wheel, line up the key letter on the inner ring with A on the outer ring. Then find the plaintext letter on the outer ring and read inward.

Encrypting AAAA with keyword BC
Position1234
PlaintextAAAA
Key letterBCBC
Shift+1+2+1+2
CiphertextBCBC

Use the same settings to read it back

Start again at the first key letter and use the same wheel setting at each position. Find the ciphertext letter on the inner ring and read outward to move back by the shift. At position 1, B on the inner ring lines up with A on the outer ring at +1. At position 2, C lines up with A at +2. The same two settings undo the last two letters of BCBC.

In Lesson 2.3, a letter had the same replacement wherever it appeared. Here, the four As produce both Bs and Cs because the setting varies with position. The keyword still repeats, so the first and third As use the same setting. Try a one-letter keyword to use the same shift everywhere, just like the Caesar cipher. This historical cipher is for practice.

For a historical cipher disk and a table of shifted alphabets, see Friedman and Callimahos’s Military Cryptanalytics, Part II, figures 3–4.

Check your understanding

Try predicting the fourth shift with the keyword CAB. When the keyword starts over, which key letter comes next, and what shift does it select?

Show the answer

The key letters go C A B C. The fourth letter starts the keyword again at C, so the fourth shift is +2.