The Vernam Cipher is a symmetric encryption technique that combines each letter of the plaintext with a corresponding character from a secret key using modular addition on their alphabetical indices. Developed by Gilbert Vernam in 1917, it is the foundation of the one-time pad when the key is truly random and used only once. Its main strength lies in producing ciphertext that is theoretically unbreakable if the key is never reused.

Each plaintext character is converted into its alphabetical index (A=0…Z=25) and combined with the corresponding key character using modular addition (mod 26). Decryption applies the same operation in reverse with the same key to recover the original message.

Vernam Cipher: Encoding

To encode a message, each plaintext character is combined with the corresponding key character. For example, using the key XMCKL to encode HELLO:

Plaintext: HELLO
Key: XMCKL

Alphabetical Index:
H → 7 E → 4 L → 11 L → 11 O → 14
X → 23 M → 12 C → 2 K → 10 L → 11

Encoding (mod 26 addition):
(7 + 23) % 26 = 4 → E
(4 + 12) % 26 = 16 → Q
(11 + 2) % 26 = 13 → N
(11 + 10) % 26 = 21 → V
(14 + 11) % 26 = 25 → Z

Ciphertext: EQNVZ

Vernam Cipher: Decoding

To decode, subtract the key letters’ numerical indices from the ciphertext modulo 26 to recover the plaintext:

Ciphertext: EQNVZ
Key: XMCKL

Alphabetical Index:
E → 4 Q → 16 N → 13 V → 21 Z → 25
X → 23 M → 12 C → 2 K → 10 L → 11

Decoding (mod 26 subtraction):
(4 - 23 + 26) % 26 = 7 → H
(16 - 12 + 26) % 26 = 4 → E
(13 - 2 + 26) % 26 = 11 → L
(21 - 10 + 26) % 26 = 11 → L
(25 - 11 + 26) % 26 = 14 → O

Plaintext: HELLO

Vernam Cipher: Notes

The security of the Vernam Cipher depends entirely on the secrecy, randomness, and non-reuse of the key. - When the key is truly random, as long as the message, and never reused, the cipher functions as a one-time pad and is theoretically unbreakable. - If the key is reused or predictable, the cipher can be broken using frequency analysis or other attacks. - The Vernam Cipher is historically significant as the basis for modern symmetric key cryptography.

Vernam Cipher (One-Time Pad)

T Aa
🗝