About this video
The Caesar cipher, used by Julius Caesar around 58 BC, shifts every letter by an agreed number, such as three, so A becomes D. The receiver subtracts the shift to read the message. Centuries later, Al-Kindi broke it using frequency analysis: counting letters in the encrypted text and seeing how far English's letter 'fingerprint' has shifted.
You'll be able to
- encrypt and decrypt a message with a Caesar cipher shift.
- explain how frequency analysis breaks a Caesar cipher.
- find the shift from the most common letter in an encrypted message.
Key words
- Caesar cipher
- A substitution cipher that shifts every letter forward by the same number of places.
- substitution cipher
- A cipher where each letter is replaced by another letter.
- shift
- The number of places each letter is moved along the alphabet.
- frequency analysis
- Breaking a code by counting how often each letter appears and comparing it with normal language.
- letter frequency
- How often each letter appears in a language; in English, E is the most common.
Transcript
SPEAKER 1: The first well known cipher, a substitution cipher, was used by Julius Caesar around 58 BC. It is now referred to as the Caesar Cipher. Caesar shifted each letter in his military commands in order to make them appear meaningless should the enemy intercept it.
Imagine Alice and Bob decided to communicate using the Caesar Cipher First, they would need to agree in advance on a shift to use-- say, three. So to encrypt her message, Alice would need to apply a shift of three to each letter in her original message. So A becomes D, B becomes E, C becomes F, and so on.
This unreadable, or encrypted message, is then sent to Bob openly. Then Bob simply subtracts the shift of three from each letter in order to read the original message. Incredibly, this basic cipher was used by military leaders for hundreds of years after Caesar.
JULIUS CAESAR: I have fought and won. But I haven't conquered over man's spirit, which is indomitable. SPEAKER 1: However, a lock is only as strong as its weakest point. A lock breaker may look for mechanical flaws. Or failing that, extract information in order to narrow down the correct combination.
The process of lock breaking and code breaking are very similar. The weakness of the Caesar Cipher was published 800 years later by an Arab mathematician named Al-Kindi. He broke the Caesar Cipher by using a clue based on an important property of the language a message is written in.
If you scan text from any book and count the frequency of each letter, you will find a fairly consistent pattern. For example, these are the letter frequencies of English. This can be thought of as a fingerprint of English. We leave this fingerprint when we communicate without realizing it.
This clue is one of the most valuable tools for a codebreaker. To break this cipher, they count up the frequencies of each letter in the encrypted text and check how far the fingerprint has shifted. For example, if H is the most popular letter in the encrypted message instead of E, then the shift was likely three.
So they reverse the shift in order to reveal the original message. This is called frequency analysis, and it was a blow to the security of the Caesar cipher.
Video © Khan Academy, used under CC BY-NC-SA. Watch on Khan Academy. Puzzicle is not affiliated with Khan Academy.