How is a Hill Cipher vulnerable to chosen plaintext attack?


Hill Cipher is a multiletter polyalphabetic cipher invented by Lester S. Hill cipher is a coding system by combining the notion of a matrix with the approach of linear congruence in the phase of encrypting a plaintext into a ciphertext and decrypting a ciphertext into a plaintext.

Hill Cipher does not restore each of the same alphabets in plaintext with the same alphabet in ciphertext because it help matrix multiplication by encryption and decryption. Hill Cipher which is a polyalphabetic cipher can be categorized as a block cipher because the text to be handled will be divided into blocks of a specific size.

Each character in one block will affect the other characters in the encryption and decryption procedure so that the similar character is not mapped to the similar character.

Hill Cipher is contained in classical cryptographic algorithms which cryptanalysts are very complex to solve if completed only by understanding the ciphertext file only. However, this approach can be solved quite simply if the cryptanalyst has a ciphertext file and an element of the plaintext file. This cryptanalysis technique is called a known-plaintext attack.

The basis of the Hill Cipher need matrix multiplication techniques and inverse techniques for matrices. The essential to Hill Cipher is the matrix n x n with n is the block size.

The K matrix that becomes this key should be an invertible matrix, which has inverse K-1 therefore that the key should have an inverse because the K-1 matrix is the key used to decrypt.

The phases of Hill Cipher is as follows −

  • In hill cipher, plaintext is divided into same size blocks.

  • The blocks are encrypted one at a time such that each character in the block provides to the encryption of new characters in the block.

  • In hill cipher, the key is a square matrix of size m x m where m defines the size of block if it can call the key matrix K, described as −

    $$\mathrm{K=\begin{bmatrix} K_{11} & K_{12} & K_{1m} \ K_{21}& K_{22}& K_{2m}\ K_{31} & K_{32}& K_{3m}\ \end{bmatrix}}$$

  • If there are m characters in the plaintext blocks, that is P1,P2 … Pm,the corresponding characters in ciphertext blocks are C1,C2 … Cm will be defined by the following equations −

    $$\mathrm{C_{1}=P_{1}\, K_{11}+P_{2}\, K_{12}+P_{3}\, K_{13}\: mod\: 26}$$

    $$\mathrm{C_{2}=P_{1}\, K_{21}+P_{2}\, K_{22}+P_{3}\, K_{23}\: mod\: 26}$$

    $$\mathrm{C_{3}=P_{1}\, K_{31}+P_{2}\, K_{32}+P_{3}\, K_{33}\: mod\: 26}$$

  • These equations can be defined in terms of column matrices −

    $$\mathrm{\begin{pmatrix} C_{1} \ C_{2} \ C_{3} \end{pmatrix}=\begin{pmatrix} K_{11} &K_{12} & K_{13} \ K_{21} & K_{22} & K_{23} \ K_{31} & K_{32} & K_{33} \ \end{pmatrix} \begin{pmatrix} P_{1} \ P_{2} \ P_{3} \end{pmatrix} \: mod\: 26}$$

  • In general hill cipher, the equations can be defined as −

    $$\mathrm{C\: =\: K\, P\: mod\: 26}$$

    $$\mathrm{P\: =\: K^{-1}\, C\: mod\: 26}$$

  • Hill Cipher can be simply destroyed with a known plaintext attack. Assume that it can have m plaintext ciphertext pairs each of length m such that

    $$\mathrm{C_{i}\, =\, K\, P_{i}\: for\: 1\leq i\leq m}$$

  • The unknown key matrix K can be computed as −

    $$\mathrm{K=C_{i}\: P_{i}^{-1}}$$

    And once the key is calculated it can be easily broken.

Updated on: 14-Mar-2022

929 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements