Top Banner
Classical Encryption Techniques 1 BSIT-7 th Delivered by Inam ul Haq Chapter 2 Cryptography and Network Security by William Stallings
26

Classical Encryption Techniques

Jan 20, 2017

Download

Education

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Classical Encryption Techniques

Classical Encryption Techniques 1

BSIT-7th

Delivered by Inam ul HaqChapter 2 Cryptography and Network Security by William Stallings

Page 2: Classical Encryption Techniques

Table of Contents

• 2 Main Types of Encryption• Symmetric Encryption• Basic Terminologies• Symmetric Cipher Model• Cryptography & Cryptanalysis• Brute Force Search• Ciphers [Caesar, Monoalphabetic, ]

Page 3: Classical Encryption Techniques

2 Main Encryption Types

• Two main encryption types are• Symmetric: the same key is used for

both encryption and decryption• Asymmetric: different keys for

encryption and decryption, e.g. public-keyencryption such as RSA.

Page 4: Classical Encryption Techniques

Symmetric Encryption

• Encryption and decryption keys are same• Conventional / private-key / single-key• Sender and recipient share a common key• All classical encryption algorithms are private-

key• First prior to invention of public-key in 1970’s• Most widely used

Page 5: Classical Encryption Techniques

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 • 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: Classical Encryption Techniques

Symmetric Cipher Model

Page 7: Classical Encryption Techniques

Requirements

• Two requirements for secure use of symmetric encryption:– a strong encryption algorithm– a secret key known only to sender / receiver

• mathematically:Y = E(K, X)X = D(K, Y)

• Assume encryption algorithm is known• Implies a secure channel to distribute key

Page 8: Classical Encryption Techniques

Cryptography• Can characterize cryptographic system by:– type of encryption operations used

• substitution• transposition• product

– number of keys used• single-key or private• two-key or public

– way in which plaintext is processed• block• stream

Page 9: Classical Encryption Techniques

Cryptanalysis

• Objective to recover key not just message• General approaches:– cryptanalytic attack– brute-force attack

• if either succeed all keys are compromised

Page 10: Classical Encryption Techniques

Types of Attacks on Encrypted Messages ciphertext only

only know algorithm & ciphertext, is statistical, know or can identify plaintext

known plaintext know/suspect plaintext & ciphertext

chosen plaintext select plaintext and obtain ciphertext

chosen ciphertext select ciphertext and obtain plaintext

chosen text select plaintext or ciphertext to en/decrypt

Page 11: Classical Encryption Techniques

More DefinitionsUnconditional security

no matter how much computer power or time is available, the cipher cannot be broken since the ciphertext provides insufficient information to uniquely determine the corresponding plaintext

Computational security given limited computing resources (eg time

needed for calculations is greater than age of universe), the cipher cannot be broken

Page 12: Classical Encryption Techniques

Brute Force Search

• Try every possible character (from dictionary)• most basic attack, proportional to key size • assume either know / recognise plaintext

4-Digits PIN < 1s

Upper+Lower+Number+Symbol <25s

6 characters 11hrs

7 characters 6 weeks

8 characters 5 months

9 characters 10 years

Page 13: Classical Encryption Techniques

1-Caesar Cipher

• Earliest known substitution cipher• By Julius Caesar • First attested use in military affairs• Replaces each letter by 3rd letter on• example:

Page 14: Classical Encryption Techniques

1-Caesar Cipher

1-Monoalphabetic substitution– One table describes all substitutions– Jump x step in the alphabet where 0 ≥ x ≥ 26– If x = 3 then the table below could be used for encryption

and decryption

– ROT 13 another Caesar cipher

Page 15: Classical Encryption Techniques

Cryptanalysis of Caesar Cipher

only have 26 possible ciphers A maps to A,B,..Z

could simply try each in turn a brute force search given ciphertext, just try all shifts of lettersdo need to recognize when have plaintexteg. break ciphertext "GCUA VQ DTGCM"

Page 16: Classical Encryption Techniques

1-Caesar Cipher

• 1-Monoalphabetic Cipher Security• now have a total of 26! = 4 x 1026 keys • with so many keys, might think is secure • but would be !!!WRONG!!! • problem is language characteristics

Page 17: Classical Encryption Techniques

Language Redundancy and Cryptanalysis

human languages are redundant eg "th lrd s m shphrd shll nt wnt" letters are not equally commonly used in English E is by far the most common letter

followed by T, A, O, I other letters like Z,J,Q,X are fairly rare have tables of single, double & triple letter

frequencies for various languages

Page 18: Classical Encryption Techniques

English Letter Frequencies

Page 19: Classical Encryption Techniques

2-Polyalphabetic Cipher• Also substitution cipher• Vigenère cipher is probably the best-known example• Polyalphabetic cipher that uses a tableau of 26 alphabets

!  Invented by Blaise de Vigenère in the 16th century• Encrypting a plaintext character:

!  Lookup the column that corresponds to the current character in the key!  Use the row that begins with the current plaintext character!  Replace the plaintext character with the one highlighted by the current column and row!  To decrypt, just reverse the procedure

Page 20: Classical Encryption Techniques

2-Polyalphabetic Cipher (Vigenère cipher)

Page 21: Classical Encryption Techniques

2-Polyalphabetic Cipher (Vigenère cipher)

• !  Key phrase = ”Boldtbol dtb oldtboldt”!  Plaintext = ”Overhead the albatross”!  Ciphertext = ”Pjpuafoo waf owetufzvl”!  So, which keyword was used?

Page 22: Classical Encryption Techniques

3-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 23: Classical Encryption Techniques

Playfair Key Matrix

a 5X5 matrix of letters based on a keyword fill in letters of keyword (filter duplicates) fill rest of matrix with other letterseg. 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 24: Classical Encryption Techniques

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 25: Classical Encryption Techniques

Security of Playfair Cipher Security much improved over monoalphabetic Better than Vigenere cipher Widely used for many years

eg. by US & British military in WW1 How to decipher? Since still has much of plaintext structure

Page 26: Classical Encryption Techniques

Exercise

– Can you make your cipher?– How to decipher Playfair?– How many times Caesar Cipher has been broken?