# Lecture: Polyalphabetic Substitution Cyphers

### Background Material

• Lecture on monoalphabetic substitution cyphers
• Elementary discrete probability

• Section 5.2 of the text

### Topics

• Review frequency analysis and the limitation of monoalphabetic substitution cyphers.
• Homophones
• Polyalphabetic substitution cyphers
• Index of coincidence
1. Comparing two texts - e.g. prob A = .75, B = .25. Probability of coincidence = .625. If A and B are swapped in both texts, the probability remains the same; however, if A and B are swapped in only one of the texts the probability of coincidence drops to .375.
2. Can use the same concept to a single text.
1. IC = sum((n[i]*(n[i]-1))/(N*(N-1)/c),i=1..c), c = size of alphabet, N = length of text, n[i] = number of occurrences of ith letter in test.
2. IC_E = sum(f[i]^2/(1/c),i=1..c), f[i] = frequency of ith letter.
3. IC_E = 1.73 for English.
4. Can use IC to detect monoalphabetic substitution cyphers.
• Vigenere cypher
• Cryptanalysis of the Vigenere cypher - determining the code length followed by frequency analysis of the subtext obtained from letters separated by the code length.

### Assignments

This assignment is a practice assignment not intended to be handed in.
• Calculate the expected IC using the frequencies of letters in English.
• Calcuate IC for a given plaintext and the corresponding cypher texts using monoalphabetic and polyalphabetic substitution cyphers.
• Install Maple on your computer.
• Download and study the worksheet (sub.mw).
• Implement a Maple function to determine the shift in a shift cipher
Created: April 1, 2009 (revised Sept. 23, 2016) by jjohnson AT cs DOT drexel DOT edu