Docsity

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

Partial preview of the text

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

Computer Security

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

Example

• Plain Text

 Herbert Yardley wrote The American Black Chamber

• Break the message into digraphs (we are using four keys only)

 he rb er ty ar dl ey wr ot et he am er ic an bl ac kc ha mb er

• Now convert each pair of letters to its number-pair equivalent

 8 5 18 2 5 18 20 25 1 18 4 12 5 25 23 18 15 20 5 20 8 5 1 13 5 18 9 3 1 14 2 12 1 3 11 3 8 1 13 2 5 18

• Select a key matrix

  • Encode first pair of letters
  • Writing answer in mod
  • The ciphertext is G (7) V (22).
  • Do this for every pair and obtain

 GVPJKGAJYMRHHMMSCCYEGVPEKGVCWQLXXOBMEZAKKG

3 7 8 59 5 12 5 100

                 

59 7 mod 26 100 22

           

  • Deciphering first two letters of cipher text i.e. G (7) V (22).
  • So P=K-1C mod26 =

Which are h (8) e (5).

12 19 7 8 mod 26 21 3 22 5

                  

Poly Alphabetic Ciphers

• The schemes under this umbrella deploys more than different

substitution for a singe letter

• Example a f , ay, ah

• Principle

 Uses a set of related mono-alphabetic substitution  The key is used to select one of the rule

• Implementations

 Vigenere Ciphere  Uses set of Ceaser ciphers  The length of key is equal to the length of plain text  Encryption is performed using Vigenere tableau  Decryption is performed using the reverse method

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

Strength of Vigener Cipher

• Multiple letters for each plaintext letter

• Frequency analysis is not possible or not simple

• Cryptanalysis

 Knowing the cipher?  Frequency analysis of the ciphertext  Comparison with standard frequency range  Vigenere Cipher (Y/N)  A vigenere cipher is suspected  Weak point length of the key  The repetition of the key may produce same patterns in cipher text  A plain text word that is repeated at an interval equal to or multiple of key length can reveal key length

One-Time-Pad

• Improvement over Vernam Cipher

• Suggests purely random key

• Key and plaintext lengths are same

• No repetition of the key

• The most secure cipher

• Problems

 Key is as much long as the plain text  Pure random key is itself a problem

Transposition Techniques

• No substitutions

• Implementation

 Rail Fence Cipher (depth =2)  Letters are written in two rows in a diagonal  The resulting letters are written in one row  Example Plain text: This is easy to learn T I E S T L A N H S A Y O E R Cipher Text: TIESTLANHSAYOER  More complex schemes are possible by increasing the depth

Assignment

• Use a Hill cipher with key to encipher the following

message.

Agnes Driscoll worked for NSA.

• 3. The following message was enciphered with a Hill cipher with

key. Decipher the message.

ZKYZR QHBDM JMPVX WLCGF MIXGM PKBUZ FHPCI
XZTIW

3 7 5 12

     

3 7 5 12

     