The Polyalphabetic Cipher is a class of substitution ciphers that uses multiple cipher alphabets instead of a single one. Unlike a simple substitution cipher where each plaintext letter always maps to the same ciphertext letter, a polyalphabetic system changes the substitution depending on position in the message. This shifting pattern helps obscure letter frequencies, making the cipher far more resistant to classical frequency analysis.

The concept was developed during the Renaissance as cryptographers attempted to strengthen simple substitution ciphers. One of the most famous implementations is the Vigenère Cipher, which applies a repeating keyword to determine which substitution alphabet should be used for each letter. Because the substitution alphabet changes repeatedly throughout the message, identical plaintext letters may encrypt into different ciphertext letters depending on their position.

Polyalphabetic Cipher: Encoding

To encode a message, choose a keyword that determines which substitution alphabet will be applied to each letter of the plaintext. The keyword repeats until it matches the length of the plaintext. Each plaintext letter is then shifted according to the alphabetical position of the corresponding key letter.

Plaintext: HELLO WORLD 
Keyword: KEYKEY KEYKE 

Each letter of the keyword determines the shift amount. For example:

Alphabet positions: 
A=0 B=1 C=2 D=3 E=4 F=5 G=6 
H=7 I=8 J=9 K=10 L=11 M=12 N=13 
O=14 P=15 Q=16 R=17 S=18 T=19 
U=20 V=21 W=22 X=23 Y=24 Z=25 

Now combine each plaintext letter with the corresponding key letter by adding their positions modulo 26:

Plaintext: H E L L O W O R L D 
Keyword: K E Y K E Y K E Y K 
Shift values: 
H(7) + K(10) = R(17) 
E(4) + E(4) = I(8) 
L(11) + Y(24) = J(9) 
L(11) + K(10) = V(21) 
O(14) + E(4) = S(18) 
W(22) + Y(24) = U(20) 
O(14) + K(10) = Y(24) 
R(17) + E(4) = V(21) 
L(11) + Y(24) = J(9) 
D(3) + K(10) = N(13) 

Ciphertext: RIJVSUYVJN 

Notice how repeated letters in the plaintext, such as the two L’s in “HELLO”, produce different ciphertext letters because different parts of the keyword apply different shifts.

Polyalphabetic Cipher: Decoding

Decoding reverses the process. Instead of adding the key shift, subtract it from each ciphertext letter.

Ciphertext: RIJVSUYVJN 
Keyword: KEYKEYKEYK 
Decoding (ciphertext − key): 
R(17) − K(10) = H(7) 
I(8) − E(4) = E(4) 
J(9) − Y(24) = L(11) 
V(21) − K(10) = L(11) 
S(18) − E(4) = O(14) 
U(20) − Y(24) = W(22) 
Y(24) − K(10) = O(14) 
V(21) − E(4) = R(17) 
J(9) − Y(24) = L(11) 
N(13) − K(10) = D(3) 

Plaintext: HELLOWORLD 

Polyalphabetic Cipher: Notes

Polyalphabetic ciphers represented a major improvement over monoalphabetic substitution systems because they obscure letter frequencies by cycling through multiple alphabets. However, they are still vulnerable if the keyword is short or reused frequently. In the 19th century, techniques such as the Kasiski examination and the Friedman test were developed to determine the keyword length and break these systems.

Despite their weaknesses by modern standards, polyalphabetic ciphers played an important role in the evolution of cryptography and served as the conceptual foundation for later mechanical and electronic encryption systems.

Polyalphabetic Cipher