Docsity

Notes on The Caesar Cipher - Computer Networks | CPSC 5157U, Study notes of Computer Systems Networking and Telecommunications

Toggle sidebar
bg1
The Caesar Cipher
This scheme is considered to be the oldest monoalphabetic ciphering scheme.
It is certainly the simplest.
In a monoalphabetic scheme, each letter in the plaintext is replaced by
a set letter in the ciphertext.
In the Caesar cipher, each letter is replaced by one a fixed distance from it.
Caesar used a shift of 3, so “A” => “D”, “B” => “E”, “X” => “A”, etc.
The security of the Caesar cipher depended mostly on the fact that
almost nobody could read.
Writing in plaintext was often quite secure, so this additional layer of
security often sufficed in Caesar’s time.
One advantage of the Caesar cipher is that it can be memorized. Capture of
the cipher key is always a VERY BIG VULNERABILITY.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Notes on The Caesar Cipher - Computer Networks | CPSC 5157U and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity!

The Caesar Cipher

This scheme is considered to be the oldest monoalphabetic ciphering scheme. It is certainly the simplest. In a monoalphabetic scheme, each letter in the plaintext is replaced by a set letter in the ciphertext. In the Caesar cipher, each letter is replaced by one a fixed distance from it. Caesar used a shift of 3, so “A” => “D”, “B” => “E”, “X” => “A”, etc. The security of the Caesar cipher depended mostly on the fact that almost nobody could read. Writing in plaintext was often quite secure, so this additional layer of security often sufficed in Caesar’s time. One advantage of the Caesar cipher is that it can be memorized. Capture of the cipher key is always a VERY BIG VULNERABILITY.

Monoalphabetic Substitution Ciphers

In a monoalphabetic substitution cipher, each letter is replaced by a fixed substitution value, based on an encryption key. Here is a sample, based on the standard text used by all typing schools “The quick brown fox jumped over the lazy dogs.” We take the phrase and remove all duplicate letters and spaces to get

THEQUICKBROWNFXJMPDVLAZYGS

The encryption key is thus.

Cleartext: ABCDEFGHIJKLMNOPQRSTUVWXYZ

Ciphertext: THEQUICKBROWNFXJMPDVLAZYGS

For some time, this method was thought to be secure. There are 26!  4.033 10 26 possible key values, so brute force is not an option for attacking this cipher.

Analysis of Substitution Ciphers (Part 2)

Given enough ciphertext, any substitution cipher can be broken. For analysis of enciphered English text, one uses the tables of letter frequencies. Here is a table of the frequencies of the 7 most common letters in English text. Letter “E” “T” “A” “O” “I” “N” “S” Others Frequency 12.7% 9.1% 8.2% 7.5% 7.0% 6.7% 6.1% 42.7% Given enough ciphertext, these frequencies will show through. The main class of substitution ciphers is called “polyalphabetic substitution”. In such a cipher, one uses a set of monoalphabetic substitutions. The Vigenère cipher is one of the most common polyalphabetic substitution ciphers. It is often based on a key word or key phrase. The example cipher will build a table based on the key phrase “THE QUICK”, which will be handled as “THEQUICK”; the space has been removed. The table is usually called a “Vigenère Tableau”.

Using a Vigenère Tableau

Here is part of a complete tableau. The complete tableau would contain substitutions for each of the 26 letters. Plaintext T H E Q U I C K A T H E Q U I C K B U I F R V J D L C V J G S W K E M D W K H T X L F N E X L I U Y M G O F Y M J V Z N H P G Z N K W A O I Q Encrypt “BE A BAD CAFE”. First compress to “BEABADCAFE”. B Col. 1 U D Col. 6 L E Col. 2 L C Col. 7 E A Col. 3 E A Col. 8 K B Col.4 R F Col. 1 Y A Col. 5 U E Col. 2 L The ciphertext is “ULERULEKYL”, possibly written as “ULERU LEKYL”.

Product Ciphers

A product cipher is just a combination of two or more ciphers. One common product cipher is a combination of a substitution cipher and a transposition cipher. Consider the previous plaintext “BE A BAD CAFÉ” with the product cipher

  1. the previous Vigenère Tableau,
  2. a five–by–two transposition. After the substitution, we have ULERULEKYL. Arrange in a rectangle U L E R U L E K Y L The ciphertext is U L L E E K R Y U L.

Modern Transposition Ciphers

The basic assumption of all modern ciphers is that a digital computer will be used, and that all characters will be represented by a character code. Assume ASCII encoding, the string “BE A BAD”. Here we keep the spaces. “B” 0 1 0 0 0 0 1 0 “E” 0 1 0 0 0 1 0 1 “ ” 0 0 1 0 0 0 0 0 “A” 0 1 0 0 0 0 0 1 “ ” 0 0 1 0 0 0 0 0 “B” 0 1 0 0 0 0 1 0 “A” 0 1 0 0 0 0 0 1 “D” 0 1 0 0 0 1 0 0 Here is the transposed text (in binary) 00000000 11010111 00101000 00000000 00000000 01000001 10000100 01010010

Ciphers vs. Codes

It is important to distinguish between ciphers and codes. The term “cipher” is reserved for those methods that process text one character at a time. The term “code” is reserved for those methods that processes text one word at a time. For example, “Midway Island” was coded as “AF”. Codes do not always function to support security. For example, during the days of telegraph communications, commercial codes were devised. The telegraph companies charged by the number of characters sent. The response was to use codes to reduce the character count of the message, and hence the charge to send. These codes were published in Commercial Code Books, so there was no expectation of confidentiality. In the military, it is common practice to super–encrypt the text. It is first encoded, and then the encoded text is encrypted.

Final Warning: “Don’t Roll Your Own”

This aphorism is a warning against trying to develop your own encryption system. This task is generally beyond most of us. It is quite easy to design an encryption system with multiple layers of complexity, but that does not ensure that such a system is hard to crack. History is littered with so–called unbreakable cipher systems that proved amazingly easy to crack. Most of these “invulnerable” systems could be compromised with no more computing power than a modern laptop. True security in encryption comes from:

  1. Using a encryption system that is publicly known and has been extensively studied.
  2. Using a key that is kept sufficiently secure. For example, the DES encryption method was widely rumored to have an easy way to crack it. Years of continuous study by highly respected experts have failed to discover this supposed vulnerability. The most probable case is that no such vulnerability exists.