Polyalphabetic cipher

Learn this with friends

ComputingComputer science theory2:274 check-ins

About this video

A polyalphabetic cipher uses a secret shift word, turned into numbers and repeated along the message, so each letter is shifted by a different amount. This flattens the letter-frequency fingerprint, but the repeating code word still leaks information: a code breaker who finds the word's length can split the message into several Caesar ciphers and break each one.

You'll be able to

  • encrypt a short message using a shift word with a polyalphabetic cipher.
  • explain why a polyalphabetic cipher gives a flatter frequency distribution than a Caesar cipher.
  • describe how Eve breaks the cipher by finding the length of the shift word.
  • explain why a longer shift word makes the cipher stronger.

Key words

polyalphabetic cipher
A cipher that uses several different shifts across a message, set by a repeating secret shift word.
shift word
The secret word Alice and Bob share; its letters give the numbers used to shift each letter.
frequency distribution
How often each letter appears in a message, which acts like a fingerprint.
information leak
Any clue, like uneven letter frequencies, that helps a code breaker.
Caesar cipher
A cipher that shifts every letter by the same single amount.
Transcript

A strong cipher is one which disguises your fingerprint. To make a lighter fingerprint is to flatten this distribution of letter frequencies. By the mid-15th century, we had advanced to polyalphabetic ciphers to accomplish this. Imagine Alice and Bob shared a secret shift word.

First, Alice converts the word into numbers according to the letter position in the alphabet. Next, this sequence of numbers is repeated along the message. Then each letter in the message is encrypted by shifting according to the number below it. Now she is using multiple shifts instead of a single shift across the message, as Caesar had done before.

Then the encrypted message is sent openly to Bob. Bob decrypts the message by subtracting the shifts according to the secret word he also has a copy of. Now imagine a code breaker, Eve, intercepts a series of messages and calculates the letter frequencies. She will find a flatter distribution, or a lighter fingerprint.

So how could she break this? Remember, code breakers look for information leak, the same as finding a partial fingerprint. Any time there is a differential in letter frequencies, a leak of information occurs. This difference is caused by repetition in the encrypted message.

In this case, Alice's cipher contains a repeating code word. To break the encryption, Even would first need to determine the length of this shift word used, not the word itself. She will need to go through and check the frequency distribution of different intervals.

When she checks the frequency distribution of every fifth letter, the fingerprint will reveal itself. The problem now is to break five Cesar Ciphers in a repeating sequence. Individually this is a trivial task, as we have seen before. The added strength of this cipher is the time taken to determine the length of the shift word used.

The longer the shift word, the stronger the cipher.

Video © Khan Academy, used under CC BY-NC-SA. Watch on Khan Academy. Puzzicle is not affiliated with Khan Academy.