0% found this document useful (0 votes)
15 views6 pages

Report on Hill 1 Cipher

The Hill Cipher is a polygraphic substitution cipher that uses matrix multiplication to encrypt plaintext by transforming it into numerical values and processing it in blocks. Key components include the multiplication matrix, determinant, adjoint matrix, and key inverse, which are essential for both encryption and decryption. An example demonstrates the encryption of the plaintext 'HELLO' into ciphertext using a 2x2 key matrix.

Uploaded by

شنو منو
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Report on Hill 1 Cipher

The Hill Cipher is a polygraphic substitution cipher that uses matrix multiplication to encrypt plaintext by transforming it into numerical values and processing it in blocks. Key components include the multiplication matrix, determinant, adjoint matrix, and key inverse, which are essential for both encryption and decryption. An example demonstrates the encryption of the plaintext 'HELLO' into ciphertext using a 2x2 key matrix.

Uploaded by

شنو منو
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

566565656

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 \)).

2. **Calculate Adjoint Matrix \( \text{Adj}(K) \)**):


\[
\text{Adj}(K) = \begin{bmatrix} 3 & -8 \\ -17 & 5 \end{bmatrix} \equiv \
begin{bmatrix} 3 & 18 \\ 9 & 5 \end{bmatrix} \mod 26
\]

3. **Calculate Key Inverse \( K^{-1} \)**):


\[
K^{-1} = 3 \times \begin{bmatrix} 3 & 18 \\ 9 & 5 \end{bmatrix} \mod 26 = \
begin{bmatrix} 9 & 2 \\ 1 & 15 \end{bmatrix}
\]

4. Encryption and Decryption:


- Plaintext: "HELLO" → "HE LX LO" (split into blocks of size 2).
- Encrypt "HE" (7, 4):
\[
\begin{bmatrix} 5 & 8 \\ 17 & 3 \end{bmatrix} \begin{bmatrix} 7 \\ 4 \
end{bmatrix} = \begin{bmatrix} 67 \\ 131 \end{bmatrix} \equiv \
begin{bmatrix} 15 \\ 1 \end{bmatrix} \mod 26 → "PB"
\]
- Decrypt using \( K^{-1} \).

You might also like