3 Hill cipher

Hiteishi Diwanji

epgp books

Multiletter cipher – Hill Cipher:

 

  • M – Square Matrix
  • M-1 – Inverse square matrix
  • M(M-1 ) = M-1 M = I – I is the identity matrix where only diagonal elements are 1 from upper left to lower right and all other elements are zero.
  • Every time inverse of the matrix does not exist.

 

M(M-1 ) = I:

  • [1] Cryptography and Network Security By William Stallings

Calculation of inverse of matrix:

 

  • If determinant of a square matrix is nonzero, then the inverse of matrix is computed as [A-1]ij = (det A)-1 (-1)i+j (Dji) where (Dji) is the subdeterminant obtained by deleting the jth row and the ith column of A. det(A) is the determinant of A and (det A)-1 is multiplicative inverse of (det A) mod 26.

Hill Algorithm:

 

  • C = PK mod 26
  • C – ciphertext row vector of length 3
  • P – plaintext row vector of length 3
  • K is 3×3 matrix of encryption key.

 

Hill algorithm example:

Strength of Hill cipher:

 

  • Completely hides single – letter frequency
  • 3×3 Hill cipher hides two-letter frequecy.
  • Protect against ciphertext only attack.
  • Weak against known plaintext attack.
  • Given m Plaintext-ciphertext pairs of length m.
  • C=PK. P and C are known hence K can be obtained.

Evaluation of Known plaintext attack:

 

you can view video on Hill Cipher

Suggested Reading:

 

  1. Cryptography and Network Security Principles and Practice by William Stallings, sixth Edition, PEARSON.
  2. Security in Computing by Charles Pfleeger & Shari Lawrence Pfleeger, fourth Edition, PEARSON.
  3. Network Security by Charlie Kaufman, Radia Perlman, Mike Speciner, second Edition, PHI.
  4. The Complete Reference – Network Security by Roberta Bragg, Mark Rhodes-Ousley & Keith Strassberg, Tata McGraw Hill
  5. Network Security Bible by Eric Cole, Ronald Krutz, James Conley, Wiley
  6. Hacking 6 Exposed by Stuart McClure, Joel Scambray & George Kurtz , Tata McGraw Hill .
  7. www.snort.org
  8. https://nmap.org