Vernam Cipher

Explore another version of the one-time pad known as the Vernam cipher.

Introducing the Vernam cipher

The most common one-time pad is the version that applies to binary plaintexts and keys (as opposed to the versions applied to letters of the alphabet and numbers from 1 to nn that we have just described). This version is often called the Vernam cipher.

The Vernam cipher can be created as follows:

  • Let the plaintext be a string of bits, P1P_1, P2P_2, …, PnP_n (where PiP_i means the iith bit of the plaintext).

  • Randomly generate a key that consists of nn bits K1K_1, K2K_2, . . ., KnK_n.

  • Encrypt plaintext bit PiP_i by XORing it to key bit KiK_i to obtain ciphertext bit CiC_i. Mathematically put:

C1=P1K1C_1 = P_1 \oplus K_1

C2=P2K2C_2 = P_2 \oplus K_2

\vdots

Cn=PnKnC_n = P_n \oplus K_n

This process is depicted in the figure given below:

Get hands-on with 1200+ tech skills courses.