Docsity

Playfair Cipher-Computer Security-Lecture Slides, Slides of Computer Security

Partial preview of the text

Download Playfair Cipher-Computer Security-Lecture Slides and more Slides Computer Security in PDF only on Docsity!

Computer Security

Playfair Cipher

• Multiple-letter encryption cipher

• Treats the set of plain text as a single unit

• Invented by sir Charles Wheatstone in 1854

• Known by the his friend Baron Playfair

• Uses a key matrix [5X5] to encrypt the plaintext

• Operation / working

 Key generation  Diagram formation  Encryption of diagram using key matrix

Plain text preparation

• Convert all letters to upper case

• Write all the letters in plaintext as pairs

• If a letter is repeated in a pair replace it by x or z

• If last letter is a single one add x or z to form a pair

• Our plaintext

THIS SECRET MESSAGE IS ENCRYPTED

• After Step-

TH IS SE CR ET ME SS SA GE IS EN CR YP TE D—

• After Step-

TH IS SE CR ET ME SX SA GE IS EN CR YP TE DX

Encryption Rules

• Pick up a pair from prepared plaintext

• Find the letters in the key matrix

• Rule-

 Replace the letters by the letters that lies in opposite corners of the rectangle they form

• Rule-

 If both letters are in same row then replace each by the letter to the right  Wrap the text from right to left

• Rule-

 If both letters are in same column then replace each by the letter beneath  Wrap the text from top to bottom

• Rule-

 Follow the direction of the text

Rule-

Plaint Text TH IS SE CR ET ME SX SA GE IS EN CR YP TE DX Key M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z

• If both letters are in same row then replace each by the letter to the

right

..... E S T.. ..... ..... ..... Cipher Text

TH IS SE CR ET ME SX SA GE IS EN CR YP TE DX BN FR TS

Rule-

Plaint Text

TH IS SE CR ET ME SX SA GE IS EN CR YP TE DX

Key

M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z

• If both letters are in same column then replace each by the letter

beneath

... C. ... R. ... I/J. ..... .....

Cipher Text

TH IS SE CR ET ME SX SA GE IS EN CR YP TE DX

BN FR TS RI

Hill Cipher

• Multiple-letter cipher

• Takes m successive plaintext letters

• Substitutes m ciphertext letters

• Substitution is determined by m linear equations

• Each letter is assigned a numerical value in the equations

• For m = 3 the equations will be

C 1 =(k 11 p 1 +k 12 p 2 +k 13 p 3 )mod

C 2 =(k 21 p 1 +k 22 p 2 +k 23 p 3 )mod

C 3 =(k 31 p 1 +k 32 p 2 +k 33 p 3 )mod

For rest of Hill Cipher

Refer to the Class Discussion

Vigenere Cipher

Vigenere Cipher…

  • The character in the keywords defines the row in table
  • The character in the plaintext defines the column in the table
  • The intersection of the two generates the cipher letter
  • To make the key as long as the plain text the key is repeated
  • The punctuations are eliminated
  • Example

“we are discovered save yourself”

Key

Painttext

Ciphertext

Vernam Cipher

• Operates on bits rather than letters

• Use a key that provide no statistical relationship between

plaintext and ciphertext

• The cipher text is generated by bitwise XOR of plain text and

cipher text

• Decryption is reverse of the encryption

• The process is actually using a very long key

• The key is eventually repeated

• More strong than Vigenere cipher but not secure completely

One-Time-Pad

• Improvement over Vernam Cipher

• Suggests purely random key

• Key and plaintext lengths are same

• No repetition of the key

Rotor Machine