Rather than just shifting the alphabet Could shuffle (jumble) the letters arbitrarily Each plaintext...

Preview:

Citation preview

• Rather than just shifting the alphabet

• Could shuffle (jumble) the letters arbitrarily

• Each plaintext letter maps to a different random cipher text letter

• hence key is 26 letters long

Plain: abcdefghijklmnopqrstuvwxyz Cipher: DKVQFIBJWPESCXHTMYAUOLRGZNPlaintext: ifwewishtoreplacelettersCipher text: WIRFRWAJUHYFTSDVFSFUUFYA

Monoalphabetic CipherMonoalphabetic Cipher

Monoalphabetic Cipher SecurityMonoalphabetic Cipher Security

• Now have a total of 26! keys

• With so many keys, might think the system is secure

• But would be !!!WRONG!!!

• Problem is the regularities of the language

Language Redundancy and Language Redundancy and CryptanalysisCryptanalysis

• Human languages are redundant

• Letters are not equally commonly used

• The English letter e is by far the most common letter

• Then T,R,N,I,O,A,S

• Other letters are fairly rare

• Z,J,K,Q,X

English Letter FrequenciesEnglish Letter Frequencies

Use in CryptanalysisUse in Cryptanalysis

• Key concept - monoalphabetic substitution ciphers do not change relative letter frequencies

• Discovered by Arabian scientists in 9th century

• Calculate letter frequencies for ciphertext

• compare counts against known values

Example CryptanalysisExample Cryptanalysis

• Given ciphertext:

UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZVUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSXEPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

• Count relative letter frequencies (see text)• The most common letters are P & Z and are equivalent to e

and t• The most common Digram are ZW is equivalent to th and

hence ZWP is the• Proceeding with trial and error finally get:

it was disclosed yesterday that several informal butdirect contacts have been made with politicalrepresentatives of the viet cong in moscow

Playfair CipherPlayfair 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

Playfair Key MatrixPlayfair Key Matrix

• A 5X5 matrix of letters based on a keyword

• Fill in letters of keyword

• Fill rest of matrix with other letters

• eg. using the keyword MONARCHY

M O N A R

C H Y B D

E F G I/J K

L P Q S T

U V W X Z

Encrypting and DecryptingEncrypting and Decrypting

• plaintext encrypted two letters at a time: – if a pair is a repeated letter, insert a filler like 'X',

eg. "balloon" encrypts as "ba lx lo on" – if both letters fall in the same row, replace each with letter

to right (wrapping back to start from end), eg. “ar" encrypts as "RM"

– if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom),

eg. “mu" encrypts to "CM" – otherwise each letter is replaced by the one in its row in the

column of the other letter of the pair, eg. “hs" encrypts to "BP", and “ea" to "IM" or "JM"

Security of the Playfair CipherSecurity of the Playfair Cipher

• security much improved over monoalphabetic

• since have 26 x 26 = 676 digrams

• would need a 676 entry frequency table to analyse (verses 26 for a monoalphabetic)

• and correspondingly more ciphertext

• was widely used for many years (eg. US & British military in WW1)

• it can be broken, given a few hundred letters

• since still has much of plaintext structure

Hill CipherHill Cipher

• Developed by the mathematician Lester Hill in 1929.

• The encryption algorithm takes m successive plain text and substitute for them m cipher text letters.

• Each character is assigned a numerical value (a=0,…z=25).

26mod

3

2

1

333231

232221

131211

3

2

1

P

P

P

KKK

KKK

KKK

C

C

C

PPKKCKP

KPC

11 26mod

26mod

Recommended