computer security

13
Computer security Section 3

Upload: daria-fleming

Post on 31-Dec-2015

20 views

Category:

Documents


0 download

DESCRIPTION

Computer security. Section 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computer security

Computer security

Section 3

Page 2: Computer security

2

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 3: Computer security

3

Playfair 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

Page 4: Computer security

4

Playfair Cipher Con.,

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

•Plaintext is encrypted two letters at a time•If a pair is a repeated letter, insert filler like 'X’. •e.g. BALLOON will be treated as:

BA LX LO ON

• If both letters m1 and m2 fall in the same row, then c1 and c2 replace each with letter to the right of m1 and m2, respectively.

m1 c1 m2 c2(wrapping back to start from end)

Page 5: Computer security

5

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

If the plaintext has an odd number of characters, a null letter is appended to the end of plaintext.

Playfair Cipher Con., m1

c1

m2

c2

Page 6: Computer security

6

Playfair Cipher Con.,

• Otherwise each letter is replaced by the letter in the same row and in the column of the other letter of the pair.

• Ex. Encrypt the message “ playfair invented by Charles” using Playfair cipher.

M O N A RC H Y B DE F G I/J KL P Q S TU V W X Z

pl ay fa ir in ve nt ed by ch ar le sx

qp nb io ka ga uf rq kc db hy rm ul xa

Page 7: Computer security

7

Playfair Cipher Con.,

• Encipher the following word “ RENAISSANCE” using Playfair key as shown.

RE NA IS SA NC EX

HG WC BH HR WF GV

H A R P SI C O D BE F G K LM N Q T UV W X Y Z

Page 8: Computer security

Vigenère Cipher

• Simplest polyalphabetic substitution cipher is the Vigenère Cipher

• Effectively multiple caesar ciphers • Given a key letter X and a plain text Y, the

cipher text letter is at inspection of the row labelled x and the column labelled y in this case the cipher text is V.

• Decryption simply works in reverse

8

Page 9: Computer security

Example

• Write the plaintext out • Write the keyword repeated above it• Use each key letter as a caesar cipher key • Encrypt the corresponding plaintext letter• eg using keyword deceptive

key: deceptivedeceptivedeceptiveplaintext: wearediscoveredsaveyourselfciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ

9

Page 10: Computer security

10

Page 11: Computer security

Security of Vigenère Ciphers

• Have multiple ciphertext letters for each plaintext letter

• Hence letter frequencies are obscured• But not totally lost• Start with letter frequencies

– see if look monoalphabetic or not

11

Page 12: Computer security

12

Row Transposition ciphers

– In general write message in a number of columns and then use some rule to read off from these columns.

– Key could be a series of number being the order to: read off the cipher; or write in the plaintext

– Plain: THE SIMPLEST POSSIBLE TRANSPOSITIONSXX

– Key (R Cipher): 41532Key (W Plain) : 4 1 5 3 2

1 2 3 4 5 1 2 3 4 5 T H E S I S T I E H M P L E S E M S L P T P O S S S T S O P I B L E T E I T L B R A N S P S R P N A O S I T I T O I I S O N S X X X O X S N

– Cipher: STIEH EMSLP STSOP EITLB SRPNA TOIIS XOXSN

Page 13: Computer security

13

Example

– We can use a word, with letter order giving sequence: to write in the plaintext; or read off the cipher

– Plain: A,CONVENIENT,WAY,TO,EXPRESS, THE,PERMUTATION

– Key (W): C O M P U T E R – Key (W): 1 4 3 5 8 7 2 6 –

A C O N V E N I A N O C N I E V E N T W A Y T O E T T N W O Y A E X P R E S S T E S P X R T S E H E P E R M U T H U P E E T M RA T I O N Z Z Z A Z I T O Z Z N

-Cipher: ANOCN IEVET TNWOY AESPX RTSEH UPEET MRAZI TOZZN