Cabinet Noir>Learn / Alberti cipher

Not sure which cipher? Identify it
The first polyalphabetic cipher: two rotating discs switch alphabets every few letters.
Typepolyalphabetic substitution cipher
Breaking iteasy to break by hand
Era15th century
NameDevised by Leon Battista Alberti around 1467 on his cipher disk, Formula.
Modesencrypt · decrypt · cryptoanalysis

Learn

Alberti cipher

How the Alberti cipher works

The idea in one sentence

Alberti's cipher disk is the first Polyalphabetic cipher: two concentric discs carry two different Alphabets, and the inner disc turns after every few letters, so the Substitution keeps changing while you write — the same plaintext letter becomes different Ciphertext letters.

The recipe

  1. Write your message and keep only the letters that sit on the disc — Alberti's ring holds 20 Latin letters (no H, J, K, U, W, Y) plus the digits 1–4. The tool drops the rest.

  2. Set the period: how many letters are encrypted before the disc turns.

  3. Set the increment: how many positions the inner disc jumps at every turn.

  4. For each chunk of period letters, read the ciphertext letter sitting opposite on the inner disc. Then turn the inner disc by the increment and continue with the next chunk.

A worked example

Step 1 of 10
Plaintext letter
Disc alignment
Result
S
A→m
r

The disc column shows the alignment at work: it starts with the outer A over the inner m, so S becomes r and E becomes f. After the two-letter chunk the disc jumps three positions — A now sits over h, and C becomes d. Every restart of the alignment gives the alphabet a fresh shuffle; that is the polyalphabetic idea in miniature.

The formula

Each chunk is a substitution, and the substitution changes between chunks. With position counting on the discs:

cipher = target[(index of plain) ]        # within one chunk
target = rotate(target, increment)        # after every chunk

Decryption runs the same story backwards: read each chunk through the current alignment, and turn the disc by the increment after every chunk. Because the receiver needs period, increment and the starting alignment, the shared secret has three parts.

The discs of the tool

The tool reproduces Alberti's rings exactly: the fixed outer disc (Stabilis) carries the uppercase Latin alphabet ABCDEFGILMNOPQRSTVXZ plus the digits 1234, which Alberti used for a second, numeric code. The movable inner disc (Mobilis) carries a mixed lowercase alphabet mqihfdbacegklnprtuz&xyso — the mix is Alberti's own extra shuffle on top of the turning. The arrows turn the inner disc by hand if you want to start somewhere other than the default alignment.

Try it in the tool

Step-by-step guides

Encrypt your first message

  1. Type your message into the message input. Only the 20 letters of the disc get encrypted — H, J, K, U, W, Y are dropped, exactly as on Alberti's Latin disc.

  2. Set the chunk length with the period slider the period slider and the disc jump with the increment slider the increment slider.

  3. If you want a different starting alignment, turn the inner disc with the arrows the left arrow under the discs and the right arrow under the discs.

  4. Read the encrypted result in the output field — lowercase, like the inner disc itself.

Decrypt a message you received

  1. Paste the cryptogram into the message input.

  2. Press the swap button the swap button to switch to decrypt mode.

  3. Set the same period the period slider and increment the increment slider the sender used, and bring the discs into the same starting alignment with the arrows. You need all three — period, increment and alignment — to undo the encryption.

  4. Read the original message in the output field.

Break a message without the key

The disc turns at fixed intervals, so letters at the same position inside every chunk are encrypted with the same substitution. That regularity is the way in:

  1. Guess the period: cut the ciphertext into chunks of that length (start with 2 or 3) and put letters of the same position into one pile.

  2. Each pile is a single Substitution — apply Frequency analysis to it. The inner alphabet is mixed, so a pile gives you letter pairs rather than a simple shift, but even two or three solved letters identify the alignment.

  3. Set the discs to that alignment with the arrows, enter the period the period slider and increment the increment slider, and decrypt. Wrong guess? Try the next candidate period — a short message may need several.

Breaking the Alberti cipher

The disk cipher was a leap: a Substitution that changes while you write defeats the plain letter counting that broke Caesar. But Alberti's scheme turns the disc at fixed intervals, and that regularity leaves a fingerprint. This page shows how the fingerprint gives the key away.

Try it in the tool

The flaw: the disc turns like clockwork

After every chunk of period letters the inner disc jumps by exactly increment positions. So letter number 1 of every chunk was always read through one alignment, letter number 2 through another, and so on. Split the text by chunk position and you get period piles — and every pile is a plain monoalphabetic cipher again, exactly like the slices of the later Vigenère attack.

Attack 1 — slice by chunk position

  1. Guess the period (2 or 3 is typical) and cut the ciphertext into chunks of that length.

  2. Collect letters of the same position — the first letter of every chunk into pile 1, the second into pile 2…

  3. Run Frequency analysis on each pile. A pile maps plaintext letters to positions on a mixed alphabet, so one pile reveals letter pairs rather than a shift — but two or three solved pairs pin down the disc alignment.

  4. Rebuild the key: the alignment, the period and the increment. Enter them in the tool and decrypt.

Attack 2 — brute force, gently

Everything is small: a period of 1–4, an increment of 1–10, 24 alignments. If a message stays stubborn, walk the combinations:

  1. Fix the period and increment and switch the tool to decrypt mode with the swap button.

  2. Turn the discs with the arrows until the Ciphertext starts saying something. Alignment is the most sensitive part — one step changes every letter.

  3. Still nothing? Change the period and start over. A Brute force walk over a few hundred combinations was not feasible for Alberti's enemies, and it costs you seconds.

What Alberti actually solved

Before the disk, Al-Kindi's Frequency analysis had made every single-alphabet cipher transparent. Alberti's answer — change the alphabet while you write — is the root idea of all polyalphabetic cryptography. His successors kept the idea and regularised it: instead of a mixed disc turned by hand, a tabula recta turned by a key letter. That regularised descendant is the Vigenère cipher — easier to use, and easier to break, but built on the same turn.

The mixed alphabet's extra mile

Note the inner disc is not a shifted alphabet but a mixed one (mqihfdbacegklnprtuz&xyso). Mixing kills the "distance from E" shortcut inside every pile: the attacker must solve actual substitutions, not shifts. It is the first appearance of a trick that later ciphers (Playfair among them) reuse — and a reminder that key design, not key length, was Alberti's real invention.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Key — The secret that controls how the text is scrambled.
Alphabet — The set of letters the cipher works with.
Substitution — Replacing each letter with another one.
Polyalphabetic — A cipher that uses several alphabets in turn instead of one.
Period — How many letters are encrypted before the disc or alphabet changes; after each period the substitution starts over.
Frequency analysis — Studying how often letters appear; comparing the counts with the language reveals the plaintext.
Brute force — Trying every possible key until the message makes sense; possible only when the key space is small.