Docsity

Ciphers-Computer Security-Lecture Slides, Slides of Computer Security

Partial preview of the text

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

Computer Security

0 1 0 COMP U TER 0 1 SECURITY 0 1 1 1BY 0 1 0 0NAUMAN 1 0 1 1 1SHAMIM 1 11 010 11 0 1

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

Example

  • Cipher Text
  • UZQSOVUOHXMOPVGPOZPEVSGWSZOPFPESXUDBMETSXAIZVUE PHZHMDSHZOWSFPAPPDTSVPQUZWYMXUZUHSXEPYEPOPDZSUF POMBZWPFUPZHMDJUDTMOHMQ
  • Relative frequencies of letters in cipher text can be compared with the

0

2

4

6

8

10

12

14

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

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

Key generation

  • Rules  Convert all the alphabet to upper case  Punctuations and space will not be considered  Place the keyword in a 5 by 5 matrix starting from top left corner  Repeating letters are written once  I/J are treated as one letter  Remaining matrix is populated with rest of the alphabets  The letters already appeared will not be written again
  • Our key word  “MANCHESTER”
  • Key Matrix 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

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-04 docsity.com

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

  • Replace the letters by the letters that lies in opposite corners of the rectangle they form .. N. H .. T. B ..... ..... ..... Cipher Text BN FR

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 BN FR TS RI

Rule-0X

  • Complete the rest of the conversion

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

Cipher Text BN FR TS RI

Hill Cipher (2)

  • P 13. standard frequency distribution for English
  • Z 11.
  • S 8.
  • U 8.
  • O 7.
  • M 6.
    • H 5.
    • D 5.
    • E 5.
    • V 4.
    • X 4.
      • F 3.
      • W 3.
      • Q 2.
      • T 2.
      • A 1.
        • B 1.
        • G 1.
        • Y 1.
        • I 0.
        • J 0.
          • C 0.
          • K 0.
          • L 0.
          • N 0.
          • R 0.
  • 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 - k 11 p 1 +k 12 p 2 +k 13 p - k 21 p 1 +k 22 p 2 +k 23 p - k 31 p 1 +k 32 p 2 +k 33 p
    • C
    • C
    • C - P - P - P

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