29
INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

Embed Size (px)

Citation preview

Page 1: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

INTRODUCTION TO CRYPTOGRAPHYCONCEPTS AND HISTORY

Page 2: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

WHAT IS CRYPTOGRAPHY

• NOUN:1) The process or skill of communicating in or deciphering secret writings or ciphers.

2) Secret writing.

Page 3: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

WHAT IS CRYPTOGRAPHY

• Cryptography (or cryptology; derived from word kryptós which means "hidden," and the verb gráfo, which means write "write" is the study of message secrecy.

Page 4: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

WHAT IS CRYPTOGRAPHY

Now that you have seen a few dictionary definitions of cryptography, lets synthesize a complete definition: Cryptography is the science of altering communication so that it cannot be understood without having the key.

Page 5: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 6: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

HISTORY

Hidden or secret writing is very old. People have been practicing hidden writing for at least 3000 years. There has always been a need to have hidden communications. Until the latter part of the 20th century, this was almost exclusively for the military and government purposes. In this section we will focus on those historical cryptographic methods that led to today's modern cryptography.

There are many historical ciphers that one can study, we will be focusing on a select group of those that have been the most influential in the history of cryptography.

Page 7: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

MONO-ALPHABET SUBSTITUTION

These are among the most primitive of cryptographic algorithms. These algorithms simply substitute one character of cipher text for each character of plain text. Some examples are:

• Atbash cipher

• Caesar cipher

• Rot13

Page 8: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

SINGLE SUBSTITUTION WEAKNESSESWhile single cipher cryptography algorithms may have been adequate when the bulk of the population was illiterate, they are totally inadequate today. There are a few reasons they are so easy to break. The most important reason is that all languages have a certain letter and word frequency. For example in English the words’ the and and are the two most common three letter words. The most common single letter words are I and a. If you see two of the same letters together in a word, it is most likely ee or oo.

All single alphabet substitution ciphers preserve the underlying letter and word frequency and are thus vulnerable to cryptanalysis.

Page 9: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

ATBASH CIPHERHebrew 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 10: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

ATBASH CIPHER EXAMPLEA cat sleeps

Becomes

Z 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 11: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

CAESAR CIPHERThis 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 algorithm

The 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 12: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

CAESAR CIPHER EXAMPLE

Example: Shifting One to the Left

Page 13: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

ROT 13

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

The phrase

A CAT

Becomes

N PNG

Page 14: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

SCYTALE

• Pronounced “skit a lee”

• A cylinder tool used by Spartans for substitution encryption.

Page 15: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

PLAYFAIRThe 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 16: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

PLAYFAIR KEY MATRIXa 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 17: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 18: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

RAIL FENCE CIPHER

• This is a transposition cipher. Rather than changing letters, their position is changed. The process is as follows:• write message letters out diagonally over a

number of rows

• then read off cipher row by row

• eg. write message out as:L n a t e e c

a d t h b a h

• giving ciphertextlnateecadthbah

Page 19: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 phrase

A CAT

Becomes

B BCA

The 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 20: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 21: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

CIPHER DISKThe 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 22: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 23: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 24: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 25: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 26: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

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 27: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

ELECTRO-MECHANICAL ROTOR CIPHERS

• Electro-mechanical rotor ciphers invented and patented

by 4 people in 4 countries after WW1

• Most famous was the German Enigma machine

• Current went through multiple rotors to change each

letter several times. Basically a mechanical poly-

alphabet cipher

• Key was the selection and order of rotors with addition

of plugboard for Enigma

• Enigma was broken by Polish, then British and US code-

breakers, significantly shortening WW2

• 2003 discovery - electro-mechanical rotor cipher was

first invented in 1915 by 2 Dutch Naval Officers, but kept

secret

Page 28: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

THE ENIGMA MACHINEIn World War II, the Germans made use of a mechanical

rotor based cipher system known as Enigma machine. It was essentially a typewriter that implemented a polyalphabet substitution cipher. 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 a “E” in the cipher text, and the next time it might be a “S”. Essentially this was a multi-alphabet cipher consisting of 26 possible alphabets.

Page 29: INTRODUCTION TO CRYPTOGRAPHY CONCEPTS AND HISTORY

IDENTIFY FRIEND OR FOE CIPHER WHEELS

Invention of radar and faster planes required pilots to identify

enemy aircraft before visual sighting

IFF radios were invented in WW2, but cryptology was needed

to prevent the enemy from using the radio from a downed

plane

Germans were the first to use IFF which included encryption

keys, but the British made a device to locate the German

plane, so the IFF was not used

First US IFF radio was the ABA-1, used a cipher wheel inserted

into the dynamotor of the radio

Crypto was crude but effective, one of 10 wheels was selected

for use that day

IFF later developed into the transponder, which is in every

aircraft today