Hill Cipher - PowerPoint PPT Presentation

About This Presentation
Title:

Hill Cipher

Description:

An Introduction – PowerPoint PPT presentation

Number of Views:4374
Slides: 20
Provided by: inam12
Tags:

less

Transcript and Presenter's Notes

Title: Hill Cipher


1
Hill Cipher
(Network Security)
Umer Farooq Roll No 3049 Bs (Hons)-IT-Evening Se
ssion 2013-2017 University Of Okara
2
Outline
  • Hill Cipher
  • Definition
  • History
  • Key Point
  • Key Table
  • Examples
  • Encryption
  • Decryption
  • Online Hill Cipher

3
Hill Cipher
  • Hill cipher is a polygraphic substitution
    cipher based on linear algebra.
  • Invented by Lester S. Hill in 1929, it was the
    first polygraphic cipher in which it was
    practical (though barely) to operate on more than
    three symbols at once. 
  • In Hill Cipher Index of Ceaser Cipher is used.
  • Plain Text is used Column Matrix.
  • Key is given in Matrix Form.

4
Key Points
  • Each letter is represented by a number modulo 26.
  • Simple scheme A 0, B 1, ..., Z 25 is used,
    but this is not an essential feature of the
    cipher.
  • To encrypt a message, each block of n letters
    (considered as an n-component vector) is
    multiplied by an invertible n  n matrix,
    against modulus 26.
  • To decrypt the message, each block is multiplied
    by the inverse of the matrix used for encryption.
  • The matrix used for encryption is the cipher key,
    and it should be chosen randomly from the set of
    invertible n  n matrices (modulo 26).

5
Key
0 1 2 3 4 5
A B C D E F
6 7 8 9 10 11
G H I J K L
12 13 14 15 16 17
M N O P Q R
18 19 20 21 22 23
S T U V W X
24 25
Y Z
6
Example
  • Encryption
  • Plain Text NETWORK
  • Where N 13, E 4,
  • T 19, W 22, O 14,
  • R 17, K 10 
  • Key is 2 x 2 so we use
  • Pairs of Plain Text
  • i.e. NE, TW, OR, KX
  • Key 2 3 1 3

7
Encryption Start
  • NE 
  • N 13 E 4 MOD 26
  • 2 3 1 3 13 4 38 25
  • 38 MOD 26 12
  • 25 MOD 26 25
  •  12 M 25 Z
  • CIPHER of Plain Text
  • NE MZ
  • TW 
  • T 19, W 22 MOD 26 
  • 2 3 1 3 19 22 104 85
  • 104 MOD 26 0
  • 85 MOD 26 7
  • 0 A 7 H
  • CIPHER of Plain Text
  • TW AH

8
Encryption Cont. . .
  • OR
  • O 14, R 17 MOD 26
  • 2 3 1 3 14 17 79 65
  • 79 MOD 26 1
  • 65 MOD 26 13
  • 1 B 13 N
  • CIPHER of Plain Text
  • OR BN
  • KX
  • K 10, X 23 MOD 26
  • 2 3 1 3 10 23 89 79
  • 89 MOD 26 11
  • 79 MOD 26 1
  • 11 L 1 B 
  • CIPHER of Plain Text
  • KX LB

9
Encryption Complete
  • Plain Text NE TW OR
  • Cipher MZ AH BN

10
Decryption Start
  • Decryption
  • CIPHER MZ AH BN LB
  • Formula
  • C K x P MOD 26
  • P K-1 C (Order of K C is important)
  • First Find the K-1
  • K-1 (Adj of K) x K-1
  • K 2 3 1 3
  • In Adj of K interchange a11 with a22 and change
    the sign of a12 a21  
  • Adj of K K (a11 x a22) (a12 x a21)
  • K (3 x 2) (3 x 1)
  • K 6 (3) 6 3 3
  • K-1 3s Inverse is 9  

11
Table of Find Inverse of Determinant
12
Decryption Cont . . .
  • Now Formula
  • K-1 (Adj of K) x K-1 MOD 26 
  • K-1 3 -3 -1 2 (9) MOD 26
  • K-1 27 -27 -9 18 MOD 26
  • 27 MOD 26 1
  • -27 MOD 26 -27 26 -1 26 25
  • -9 MOD 26 -9 26 17
  • 18 MOD 26 18
  • K-1 1 25 17 18

13
Decryption Cont . . .
  • CIPHER MZ AH BN LB 
  • MZ
  • M 12, Z 25
  • P K-1 C MOD 26
  • P 1 25 17 18 12 25 MOD 26
  • P 637 654 MOD 26
  • P 13 4
  • N 13 E 4
  • Thus MZ NE 

14
Decryption Cont . . .
  • CIPHER AH BN LB
  • AH
  • A 0, H 7
  • P K-1 C Mod 26
  • P 1 25 17 18 0 7 MOD 26
  • P 175 126 MOD 26
  • P 19 22
  • T 19 W 22
  • Thus AH TW

15
Decryption Cont . . .
  • CIPHER BN LB
  • BN
  • B 1, N 13
  • P K-1 C Mod 26
  • P 1 25 17 18 1 13 MOD 26
  • P 326 251 MOD 26
  • P 14 17
  • O 14 R 17
  • Thus BN OR 

16
Decryption Cont . . .
  • CIPHER LB
  • LB
  • L 11, B 1
  • P K-1 C Mod 26
  • P 1 25 17 18 11 1 MOD 26
  • P 36 205 MOD 26
  • P 10 23
  • K 10 X 23
  • Thus LB KX 

17
Decryption COMPLETE
  • Cipher Text MZ AH BN LB
  • Plain Text NE TW OR KX

18
ONLINE Hill Cipher
  • http//www.dcode.fr/hill-cipher

19
Thank You
Write a Comment
User Comments (0)
About PowerShow.com