Report on Hill 1 Cipher
Report on Hill 1 Cipher
1212
Report on Hill Cipher
Introduction
The Hill Cipher is a polygraphic substitution cipher based on linear algebra and
matrix operations. It transforms plaintext into blocks and encrypts them using
matrix multiplication. This report explains the key components of this system.
1. Multiplication Matrix
**Repor
1. Convert plaintext into numerical values (e.g., A=0, B=1, ..., Z=25).
2. Divide the numbers into blocks of size \( n \) (where \( n \) is the size of the
square key matrix).
3. Multiply each block by the key matrix \( K \) using matrix multiplication.
4. Apply modular arithmetic (Mod 26) to the result to obtain the ciphertext.
- Matrix Condition:
The matrix \( K \) must be invertible under Mod 26.
2. Determinant
A scalar value calculated from the elements of a square matrix, determining
whether the matrix is invertible.
- Importance:
- If the determinant \( \text{det}(K) \neq 0 \) and has a multiplicative inverse
under Mod 26, the matrix is usable.
- Example: If \( \text{det}(K) = 5 \), there must be a number \( x \) such that \(
5x \equiv 1 \mod 26 \) (here, \( x = 21 \) because \( 5 \times 21 = 105 \equiv
1 \mod 26 \)).
3. Adjoint Matrix
The adjoint matrix is the transpose of the cofactor matrix.
1. Calculate the cofactor matrix by replacing each element with its signed
minor (\( (-1)^{i+j} \)).
2.
Transpose the cofactor matrix to obtain the adjoint matrix \( \text{Adj}(K) \).
4. Key Inverse
\[
K^{-1} = \text{det}(K)^{-1} \times \text{Adj}(K) \mod 26
\]
where \( \text{det}(K)^{-1} \) is the multiplicative inverse of the determinant
under Mod 26.
- Key Requirement:
\( K^{-1} \) must be calculated for decryption, where:
\[
\text{Plaintext} = K^{-1} \times \text{Ciphertext} \mod 26
\]
5. Example
(size 2x2):
\[
K = \begin{bmatrix} 5 & 8 \\ 17 & 3 \end{bmatrix}
\]
1. Calculate Determinant:
\[
\text{det}(K) = (5 \times 3) - (8 \times 17) = 15 - 136 = -121 \equiv 9 \mod 26
\]
- The multiplicative inverse of 9 under Mod 26 is 3 (since \( 9 \times 3 = 27 \
equiv 1 \mod 26 \)).