classic cryptography history. some basic terminology plaintext - original message ciphertext - coded...

26
Classic Cryptography History

Upload: christiana-miles

Post on 02-Jan-2016

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Classic CryptographyHistory

Page 2: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Some Basic Terminology

• plaintext - original message • ciphertext - coded message • cipher - algorithm for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • Key space – number of possible keys• encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext from plaintext• cryptography - study of encryption principles/methods• cryptanalysis (codebreaking) - study of principles/ methods of

deciphering ciphertext without knowing key• cryptology - field of both cryptography and cryptanalysis

Page 3: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Atbash Cipher

Hebrew scribes copying the book of Jeremiah used this cipher. It is very simple, just reverse the alphabet. This is, by modern standards, a very primitive and easy to break cipher. But it will help you get a feel for how cryptography works.The ATBASH cipher is a Hebrew code which substitutes the first letter of the alphabet for the last and the second letter for the second to the last, etc. It simply reverses the alphabet.A becomes Z, B becomes Y, C becomes X, etc.

Page 4: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Atbash Cipher Example

A cat sleepsBecomesZ xzg hovvkh

This is obviously a rather simple cipher and not used in modern times. However it illustrates the basic concept of cryptography. That is to perform some permutation on the plain text to render it difficult to read by those who don’t have the key to ‘un scramble’ the cipher text.

Page 5: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Caesar Cipher

This cipher was first used by Julius Caesar. Every letter is shifted a fixed number of spaces to the left or the right in the alphabet. Caesar purportedly shifted 3 to the right, but you can apply this with any type of shift you prefer.The shifting is the ‘key’ for this algorithmThe shift is often called the ‘alphabet’ being used. So the Caesar Cipher is an example of a single alphabet substitution since all letters are shifted the same amount.

Page 6: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Caesar Cipher ExampleExample: Shifting One to the Left

Page 7: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

ROT 13

This is another single alphabet substitution cipher. All characters are rotated 13 characters through the alphabet.

The phraseA CATBecomesN PNG

Page 8: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Scytale

• A cylinder tool used by Spartans for substitution encryption.

Page 9: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Playfair

The Playfair cipher is a bit more complex than most historical ciphers. It also encrypts two letters rather than one. It was invented in 1854 by Charles Wheatstone. It was named after Lord Playfair who promoted the use of the cipher.The Playfair cipher uses a 5 by 5 table containing a key word or phrase. To generate the key table, one would first fill in the spaces in the table with the letters of the keyword (dropping any duplicate letters), then fill the remaining spaces with the rest of the letters of the alphabet in order. People often omitted Q from the list.To encrypt a message, youwould break the message into groups of 2 letters. For example, “CheeseBurger" becomes “Ch ee se Bu rg er", and map them out on the key table. If both letters are the same (or only one letter is left), add an "X" after the first letter. Encrypt the new pair and continue. If the letters appear on the same row of your table, replace them with the letters to their immediate right . If the letters appear on the same column of your table, replace them with the letters immediately below .While this is rather complex and cumbersome it is not any more secure then other classic ciphers such as Vigenere.

Page 10: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Playfair Cipher

not even the large number of keys in a monoalphabetic cipher provides security

one approach to improving security was to encrypt multiple letters the Playfair Cipher is an example invented by Charles Wheatstone in 1854, but named after his friend

Baron Playfair

Page 11: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Playfair Key Matrix

a 5X5 matrix of letters based on a keyword fill in letters of keyword (sans duplicates) fill rest of matrix with other letters eg. using the keyword MONARCHY

MM OO NN AA RR

CC HH YY BB DD

EE FF GG I/JI/J KK

LL PP QQ SS TT

UU VV WW XX ZZ

Page 12: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Encrypting and Decrypting

• plaintext is encrypted two letters at a time 1. if a pair is a repeated letter, insert filler like 'X’2. if both letters fall in the same row, replace each with letter to right (wrapping

back to start from end) 3. if both letters fall in the same column, replace each with the letter below it

(wrapping to top from bottom)4. otherwise each letter is replaced by the letter in the same row and in the

column of the other letter of the pair

Page 13: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

The Playfair Cipher

The Playfair Cipher was invented around 1854 by Sir Charles Wheatstone. It was used by the British in WWI.

It makes use of a 55 matrix containing the letters of the alphabet, with i and j treatedas one character.

You start with a keyword, remove repeated letters and write them into the matrix by filling the first row from left to right, then continuing on to the next row, etc.

Now you fill in the rest of the entries with the remaining letters of the alphabet.

Example

Keyword playfair playfir

p l a y f

ij r b c d

e g h k m

n o q s t

u v w x z

Page 14: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

The Playfair Cipher

Keyword playfair playfir

p l a y f

i r b c d

e g h k m

n o q s t

u v w x z

We may use other patterns in filling the matrix in a Playfair Cipher.The pattern we used in our example may be expressed by a diagram:

Denotes the start

Denotes the end

Page 15: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

The Playfair Cipher

Encryption is now done in two-letter blocks as follows:

First remove spaces and divide into two letter groups; if a group contains repeated letters, insert an x between them and regroup, adding an x at the end if needed.

• If the two letters are in different rows and in different columns of the matrix, replace each letter by the letter that is in its row and the other letter’s column.

• If the two letters are in the same row, replace each letter with the letter immediately to its right, wrapping around if needed.

• If the two letters are in the same column, replace each letter with the letter immediately below it, wrapping around if needed.

p l a y f

Ij r b c d

e g h k m

n o q s t

u v w x z

meet at the school houseme et at th es ch ox ol ho us ex

m and e are in the same row, so mE, e G

e and t are separated, so e M, t N

o and l are in the same column, so oV, l r

Encrypted message: EG MN FQ QM KN BK SV VR GQ XN KU

Page 16: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

The Playfair Cipher

p l a y f

Ij r b c d

e g h k m

n o q s t

u v w x z

meet at the school house

me et at th es ch ox ol ho us ex

m and e are in the same row, so m E, e Gme EG

e and t are separated, so e M, t Net MN

o and l are in the same column, so o V, l Roi VR

Encrypted message: EG MN FQ QM KN BK SV VR GQ XN KU

p l a y f

Ij r b c d

e g h k m

n o q s t

u v w x z

me et at th es ch ox ol ho us ex

p l a y f

Ij r b c d

e g h k m

n o q s t

u v w x z

me et at th es ch ox ol ho us ex

Page 17: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Poly-alphabetic Substitution

The obvious way to make substitution ciphers (like atbash and Caesar) stronger, is to rotate through various alphobets. Any substitution using multiple alphabets. Such using three alphabets like: +1 -1 +2. Then the phraseA CAT BecomesB BCAThe first letter is add 1, then the second is subtract 1 the third is add two then for the fourth letter you start over.

Page 18: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Poly-alphabetic Subsitution

These ciphers break up the letter and word frequency making them harder to break than single substitution ciphers. In fact for a human using a pen and paper, it may be too difficult to crack. Examples of poly-alphabetic substitution include:•Cipher Disk•Vigenère Cipher•Enigma Machine

Page 19: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Cipher Disk

The cipher disk was invented by Leon Alberti in 1466. The cipher disk was polyalphabetic, each time you turned the disk you used a new cipher. It was literally a disk you turned to encrypt plain text.

Page 20: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Vigenère CipherPerhaps the most widely known poly-alphabet

cipher is the Vigenère cipher. This cipher was invented in 1553 by Giovan Battista Bellaso. It is a method of encrypting alphabetic text by using a series of different mono-alphabet ciphers selected based on the letters of a keyword. This algorithm was later misattributed to Blaise de Vigenère, and so it is now known as the "Vigenère cipher“, even though Vigenère did not really invent it.

Page 21: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Vigenère Cipher ExampleMatch the letter of your keyword on the top with the letter of yourPlain text on the left to find the cipher text.

Page 22: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Vigenère Cipher Example

Using the previous chart if you are encrypting the word ‘cat’ and your key word is ‘horse’ then: the cipher text is jok

Page 23: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Vigenère Cipher Example

This is a very effective multi-alphabet cipher and prior to the advent of computers was considered quite strong. It should be noted that the longer the keyword, the more alphabets used to encrypt the message, and thus the stronger the encryption. In fact one does not even need to use a real word. Any serious of letters will work.

Page 24: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Breaking the Vigenère Cipher

In 1863 Friedrich Kasiski was the first person to publish a successful general attack on the Vigenère cipher. Previous attacks on this cipher relied on knowledge of the plaintext (i.e. they where ‘known plaintext’ attacks, which we will discuss in depth in cryptanalysis).

Page 25: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

Rail Fence cipher

• write message letters out diagonally over a number of rows

• then read off cipher row by row• eg. write message out as:

m e m a t r h t g p r y e t e f e t e o a a t

• giving ciphertextMEMATRHTGPRYETEFETEOAAT

Page 26: Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext

The Enigma Machine

In World War II, the Germans made use of an electromechanical rotor based cipher system known as Enigma machine. There were multiple variations on this machine. The machine was designed so that when the operator pressed a key the encrypted cipher text for that plain text was altered each time. So if the operator pressed the A key, he or she might generate an F in the cipher text, and the next time it might be a D. Essentially this was a multi-alphabet cipher consisting of 26 possible alphabets.