### CS27 : Fodszqujpo!

Since the dawn of time, man has wished to communicate in secret. In ancient Roman times, men used to shave their heads and have secret messages tattooed onto them, in the second world war, Germany communicated with the Enigma machine. In modern times, cryptography is crucial to the operation of the Internet.

We are learning ...
So that we can ...
• Describe Cryptography
• Explain how to implement the Caesar cipher (poor)
• Explain how to implement the Vernam cipher (excellent)
• Compare encryption techniques to assess their effectiveness.

 Activity 1 What is cryptography?

"The science of protecting data by scrambling the characters based on rules is called Cryptography. The scrambling method is called a cryptosystem or a cipher. The process of converting the original (plain text) data into the scrambled (ciphertext) version is called encryption. The opposite process (converting ciphertext into plaintext) is called decryptionA cryptographer is someone who studies the science of cryptography. A cryptanalyst is someone who studies other peoples scrambled messages with the intention of decrypting them through application of brute force methods or via analytical methods like frequency analysis. All ciphers use a key which instructs the encryption algorithm how to scramble the plaintext. In symmetric ciphers, the same key is used to both encrypt and decrypt the message and transmission of the key is a point of weakness in these systems. In asymmetric ciphers, different keys are used to encrypt and decrypt the message."

 Task 1.1 See, they were right!In your notebooks : Write definitions for all 8 key terms from the passage above. You may need to do some extra research to find out details for some of them but don't worry about going into too much depth :)OUTCOME : Definitions concerning cryptography!

 Activity 2 The Caesar Cipher

One of the earliest documented encryption systems is called the Caesar Cipher, so named because it is believed that it was used by Julius Caesar over two thousand years ago.

The Caesar Cipher is an example of a shift cipher because the plaintext characters are shifted to create the ciphertext characters. The encryption key for Caesar's secret system was simply 3 - the number of places to shift the letters.

Caesar never had to change the key for the reasons he has explained above, but even if he did, there are only 26 possible messages which could result from any one ciphertext - hence, shift ciphers are easy to decrypt and are therefore not secure (in their simplest form).

 Activity 3 The Vernam Cipher

The Vernam cipher or the 'perfect cipher', is a crypto-algorithm where plaintext is combined with a randomly generated, variable length key. Each letter in the plaintext is encrypted with an individual, single use key which is chosen at random and never used twice.

Original patent document available in lesson resources

It is the only existing mathematically unbreakable cipher as long as ...
• There are only ever two copies of the key;
• Both sides of the communication link have the same key;
• The key is used only once;
• The key is destroyed immediately after use;
• The key contains truly (not pseudo) random data.
Technically, the original Vernam cipher is an example of a stream cipher where the plain text is logically combined with 'key stream' to generate the cipher text. This process happened electronically; originally, punched paper tape was used.

Click to view

A key tape generator was used to produce two identical tapes - one for encryption and one for decryption.

Unashamedly stolen from Cryptomuseum

As with any symmetrical cipher, the only problem is transferring / concealing the key tapes, but this is the only weak point in the encryption method  ...

From "Untangling the Web" - Royal Institution Christmas Lectures

 Task 3.1 The original Vernam stream cipher You will be provided with an activity sheet called Vernam Cipher.docx which explains how the original OTT Vernam stream cipher works and also gives you an exercise to carry out your own encryption. Your teacher will show you how to complete the sheet. OUTCOME : Completed ciphertext from the stream cipher on the worksheet.

The Vernam cipher led to the development of the One Time Pad, commonly in use during wartime.

One Time Pad used by soldiers in the second world war.
The table on the left is a reciprocal alphabet table.
The book on the right contains a series of unique one time pads.

The One Time Pad encrypts using a series of random letters using either modulus-26 mathematics (Vigenere tables) or encryption / decryption tables which use reciprocal alphabets. Again, two copies of each pad are made and shared between sender and receiver (the only weak point). Each pad is used only once and then destroyed.

 Task 3.2 One Time Pad You will be provided with a copy of the activity sheet called One Time Pad Encryption.docx which allows you to perform a One Time Pad (OTP) encryption. Your teacher will show you how to complete the sheet. OUTCOME : Completed ciphertext example.

 Activity 4 Cipher strength

Some encryption techniques are better then others. Here, the word 'better' means 'harder for a cryptanalyst to decrypt' (without knowledge of the key). Consider the following frequency analysis on message containing 6659 characters (you'll meet this later).

Letter frequency for natural text, sample text encrypted using a caesar cipher
and the same text encrypted using a vernam cipher. Click to enlarge.

As you can see, it is obvious from the letter frequency analysis for the caesar cipher what key has been used (10) as the 'E' is shifted 10 letters to the right. A cryptanalyst could decrypt this message, instantly! However, the same message encrypted with a vernam cipher essentially normalises the letter frequency distribution. There is no pattern in the distribution and no way of decrypting the message (without the key of course!)

Why are you bothering?

A brute force attack on this cipher would be pointless ...
• Encrypt the word 'SECRET' using a random 6 character one time pad.
• Each letter has 26 potential keys.
• There are 6 letters in the message so there are 626 or 170,581,728,179,578,208,256 potential one time pads!
• Even checking 1,000,000 one time pads per second, it would still take us just over 5,409,111 years to check every one but in the process, we would generate every 6 letter word in the English language at some point and would be none the wiser as to the original message! Pointless!

 Extension Activities