Hill Cipher-Computer Security-Assignment, Exercises of Computer Security

This course teaches the key concepts of computer and network security. The course is divided in two parts. The first part covers the key cryptology concepts and protocols while the second half is about the advance topics in network security. This assignment includes: Hill, Cipher, System, Plaintext, Letters, Matrix, Encryption, Keys, Column, Vectors, Linear, Equations, Attack

Typology: Exercises

2011/2012

Uploaded on 08/08/2012

parni
parni 🇮🇳

4.1

(14)

100 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assignment # 1
Hill Cypher
docsity.com
pf3
pf4

Partial preview of the text

Download Hill Cipher-Computer Security-Assignment and more Exercises Computer Security in PDF only on Docsity!

Assignment # 1

Hill Cypher

Hill Cipher

It was developed by the mathematician Lester Hill in 1929. The encryption algorithm takes

„m‟ successive plaintext letters and substitutes for them „m‟ cipher text letters. The

substitution is determined by „m‟ linear equations in which each character is assigned a

numerical value:

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

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

For m=3, the system can be described as follows:

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

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

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

This can be expressed in terms of column vectors and matrices:

C=KP mod 26,

where C and P are column vectors of length 3, representing the plaintext and ciphertext, and

K is 3x3 matrix, representing the encryption key. Operations are performed mod 26.

For example, consider the plaintext “payformoney”, and use the encryption key

K = [ ]

The first 3 letters of the plaintext are represented by the vector (15 0 24). Then K(15 0 24) =

(375 819 486) mod 26 = (11 13 18) = LNS. Continuing in this fashion, the ciphertext for the

entire plaintext is LNSHDLEWMTRW.

Decryption requires using the inverse of the matrix K. The inverse K-1^ of a matrix K is

defined by K K

  • = K - K=I, where I is the unit matrix (1‟s on the diagonal, other elements –

zeroes). The inverse of the matrix does not always exist, but when it does, it satisfies the

preceding equation. In this case, the inverse is

K-1^ = [ ]

mod 26 149 107

K

Finally, check that this key matrix produces required transformation:

mod 26 146

mod 26 161

mod 26 72