Caesar cipher · 02 How it works

Caesar cipher: how it works

Two alphabets side by side, one shifted: the mechanism of encryption and decryption step by step.

The easiest way to understand the Caesar cipher is to write two alphabets one under the other, the second shifted forward by the number of positions chosen as the key.

PlainABCDE…WXYZ
Cipher (key 3)DEFGH…ZABC

To encrypt, find each letter of the message in the first row and replace it with the one below. To decrypt, do the opposite: find the cipher letter in the second row and read the one above. Spaces, numbers and punctuation, in the classical version, stay unchanged or are removed.

  1. 01
    Choose the key

    A number from 1 to 25 that both parties know: for example 3.

  2. 02
    Write the two alphabets

    The second starts with the letter k positions after A.

  3. 03
    Substitute

    Each plaintext letter becomes the corresponding letter of the second alphabet.

  4. 04
    Transmit

    The recipient, who knows the key, repeats the procedure in reverse.

The cipher disk

Instead of rewriting the alphabets every time you can use two concentric disks with letters around the edge: turning the inner one by k positions, the substitution table is ready. It is the same principle as the cipher disk described in the Renaissance by Leon Battista Alberti, who however changed the disk’s position during the message — a far more powerful idea that paved the way for polyalphabetic ciphers.

Continue with
03 Worked example

Caesar cipher: a worked example

Let us encrypt and decrypt VENI VIDI VICI with key 3, letter by letter.

↑