0Pricing
Cryptology Academy · Lesson

Vigenère & Polyalphabetic Ciphers

Understand how multiple alphabets defeat frequency analysis.

Vigenère & Polyalphabetic Ciphers is a free Cryptology Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Welcome

The Vigenère cipher defeated frequency analysis for 300 years by using multiple Caesar alphabets in rotation, keyed by a repeating keyword.

Core Concept

Given key 'KEY' and plaintext 'HELLO': H+K=R, E+E=I, L+Y=J, L+K=V, O+E=S → ciphertext 'RIJVS'. Different letters encrypt the same plaintext letter differently.

Vigenère Tabula Recta

The Tabula Recta is a 26×26 grid of alphabets, each row shifted one position. Look up the row for the key letter and the column for the plaintext letter to find the cipher letter.

Why It Defeated Frequency Analysis

If the key is 'CAT' (length 3), the letter 'E' might become 'G', 'E', or 'Y' depending on its position. Frequency distributions flatten, making simple analysis fail.

Python Implementation

def vigenere(text, key, encrypt=True): result, ki = '', 0 for c in text.upper(): if c.isalpha(): shift = ord(key[ki % len(key)].upper()) - 65 if not encrypt: shift = -shift result += chr((ord(c) - 65 + shift) % 26 + 65) ki += 1 else: result += c return result

The Kasiski Test

Kasiski (1863) noticed repeated ciphertext patterns reveal the key length. Repeated plaintext + repeated key = repeated ciphertext. The key length divides the distance between repeats.

Index of Coincidence

IoC measures letter frequency distribution. Random text has IoC ≈ 0.038; English has IoC ≈ 0.065. Trying different key lengths and measuring IoC reveals the correct length.

Breaking Vigenère Step by Step

1. Find key length via Kasiski/IoC. 2. Split ciphertext into groups spaced by key length. 3. Each group is a Caesar cipher — apply frequency analysis to each.

Running Key Cipher

If the key is as long as the message and never repeats (Beaufort / running key), Kasiski fails. If the key is truly random, we get the one-time pad — unbreakable.

Autokey Variant

The Autokey cipher seeds the key with a short primer then appends the plaintext itself. This avoids repetition but is still broken by known-plaintext attacks.

Practical Security Assessment

Vigenère with a short key is trivially broken today. Its historical importance is in demonstrating that frequency analysis has limits when multiple alphabets are used.

Quick Check

What technique did Kasiski use to find the key length of a Vigenère cipher?

Recap

Excellent! You've mastered the Vigenère cipher and how to break it. Next we'll go deeper into frequency analysis as a general cryptanalytic weapon.

Frequently asked questions

Is the “Vigenère & Polyalphabetic Ciphers” lesson free?

Yes — the full text of “Vigenère & Polyalphabetic Ciphers” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “Vigenère & Polyalphabetic Ciphers”?

Understand how multiple alphabets defeat frequency analysis. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Vigenère & Polyalphabetic Ciphers” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Caesar Cipher Mechanics
  2. Atbash & Affine Ciphers
  3. Vigenère & Polyalphabetic Ciphers
  4. Frequency Analysis & Cryptanalysis Basics
← Back to Cryptology Academy