Hill Cipher Decryption
This guide on Hill Cipher decryption in Number Theory provides a clear, step-by-step explanation of how to reverse the encryption process and recover the original message. Using basic concepts from linear algebra and modular arithmetic, it walks you through the method of finding the inverse key matrix and applying it to decode a ciphertext. With a detailed example and easy-to-follow instructions, this resource is perfect for students, educators, and anyone interested in classical ciphers and the mathematical principles behind secure communication.
Hill Cipher
The Hill cipher is a classical encryption technique based on linear algebra and modular arithmetic. It was introduced by Lester S. Hill in 1929 and encrypts plaintext by transforming it into vectors and applying a key matrix.
If \( P \) is a plaintext vector and \( K \) is an invertible \( n \times n \) matrix modulo 26, then the ciphertext \( C \) is given by:
To decrypt the message, use the inverse of the key matrix:
2×2 Hill Cipher
Let the key matrix be:
Convert plaintext (e.g., "HI") into numeric form: H = 7, I = 8, so:
Then compute the ciphertext:
So the ciphertext is J (9), E (4) → "JE"
.
Example
The ciphertext B ZRVU GRNPEKSTWSQ
has been enciphered with the cipher
\(C_1\equiv 3P_1 +5P_2 \pmod{26}\), \(C_2\equiv 8P_1 +13P_2 \pmod{26}\). Derive the plaintext.
We have a Hill‐cipher on digraphs with key matrix
The ciphertext is B Z R V U G R N P E K S T W S Q
, which we group as:
We work modulo \(26\), with the mapping \(A \mapsto 0,\; B \mapsto 1,\dots,Z \mapsto 25\).
Step 1: Compute \(K^{-1} \bmod 26\)So \((\det K)^{-1} \equiv 25\) since \(25 \cdot 25 = 625 \equiv 1 \pmod{26}\).
The adjugate of \(K\) is
Hence,
For a ciphertext digraph \(C = (c_1, c_2)^T\),
Below we convert letters to numbers and back:
Concatenating the plaintext digraphs yields:
i.e.