Read this lesson as text
Classical Ciphers
Number Theory · Axiom Academy
Explore the mathematical foundations of cryptography through Caesar ciphers, frequency analysis, and polyalphabetic encryption 1. Caesar Cipher: Shift Ciphers and Modular Arithmetic The Caesar cipher is one of the simplest and oldest encryption techniques. It works by shifting each letter in the alphabet by a fixed number of positions. Julius Caesar famously used a shift of 3 to communicate with his generals. where we treat A=0, B=1, C=2, ..., Z=25. The mod 26 operation ensures we "wrap around" the alphabet. 2. Breaking Substitution Ciphers: Frequency Analysis A substitution cipher replaces each letter with another letter according to a fixed mapping. While there are 26! possible mappings (making brute force impractical), these ciphers are vulnerable to frequency analysis . In English text, certain letters appear more frequently than others. The most common letters are E, T, A, O, I, N. By analyzing the frequency distribution of letters in the ciphertext, we can make educated guesses about the substitution mapping. 3. Vigenere Cipher: Polyalphabetic Encryption The Vigenere cipher addresses the weakness of simple substitution ciphers by using multiple shift values. Instead of one fixed shift, we use a keyword to determine different shifts for different positions. The Vigenere cipher resists frequency analysis because the same letter (like 'L' in "HELLO") gets encrypted differently depending on its position. This makes it a polyalphabetic cipher .
This is the written version of the interactive lesson above. See the full Number Theory course.