Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

ZETA

MATRIX BASED CRYPTOGRAPHY

THUMMAR PARV KETANBHAI :202251143


PATEL OM NAVINBHAI :202252329
VINOD TEMBHURNE :202251157

1. BASIC ENCODING DECODING WITH MATRIX


The concept of encoding and decoding messages using matrices
is rooted in the field of cryptography, which is concerned with
securing information and communications from unauthorized
access or tampering. The development of matrix-based
encoding and decoding techniques can be attributed to the
following factors:

Security and Confidentiality: The need for secure


communication has been prevalent throughout history. In
ancient times, people used various methods to encode
messages, such as substitution ciphers and transposition
techniques. Matrix encoding and decoding provide a more
sophisticated and mathematically based approach to
encryption, enhancing the security and confidentiality of
messages.

Mathematical Foundations: Matrices offer a powerful


mathematical tool for manipulating and transforming data. The
idea of using matrices for encoding and decoding messages
emerged from the desire to apply mathematical operations to
information, making it more resistant to unauthorized access or
decryption. Matrix operations provide a systematic and efficient
way to process data, making it difficult for adversaries to
reverse-engineer the original message without the proper
decoding key.
We are taking A -> 1 ,B -> 2,….,Y -> 25, Z ->26

Message: SELL NOW


(19 5 12 12 0 14 15 23)
Key : [ 31 52]

ENCODING message:
key× message in matrix form
= [ 31 52] [ 195 12 0 15
12 14 23 ]

DECODING message:
Inverse of key = [−12 −53 ]

=[−12 −53 ] [ 8229 3696 7028 160


61 ]
= [ 5 12 14 23 ]
19 12 0 15

message = SELL NOW


INTRODUCTION AND HISTORY:

The Hill cipher is a polygraphic substitution cipher that operates


on blocks of plaintext letters. It was developed by Lester S. Hill
in 1929 and is considered one of the earliest examples of
symmetric key cryptography. The Hill cipher uses linear
algebraic techniques and relies on the use of matrices for
encryption and decryption.

The basic idea behind the Hill cipher is to transform plaintext


blocks into ciphertext blocks using matrix multiplication. The
key in the Hill cipher is a square matrix, known as the
encryption matrix. The plaintext is divided into blocks, where
each block is represented by a vector of numbers corresponding
to the positions of the letters in the alphabet. The encryption
matrix is then multiplied by each plaintext block vector to
obtain the corresponding ciphertext block vector.

To decrypt the ciphertext, the recipient needs to have the


inverse of the encryption matrix, known as the decryption
matrix. The decryption process involves multiplying the
ciphertext block vector by the decryption matrix to obtain the
original plaintext block vector.

One advantage of the Hill cipher is that it can encrypt multiple


letters at once, making it a polygraphic substitution cipher. This
provides some level of security against frequency analysis
attacks. However, the security of the Hill cipher depends on the
size of the matrix used. For example, a 2x2 matrix can be easily
broken with known-plaintext attacks.
Matrix-based cryptography, of which the Hill cipher is an
example, utilizes mathematical operations on matrices for
encryption and decryption. It is a branch of symmetric key
cryptography that employs linear algebraic techniques.
Matrices are used to represent both the encryption and
decryption keys, and the encryption/decryption processes
involve matrix operations.

In matrix-based cryptography, the choice of matrix size and the


specific operations used for encryption and decryption play a
crucial role in the security of the algorithm. The Hill cipher is a
specific instance of matrix-based cryptography, where the
encryption matrix determines the mapping from plaintext to
ciphertext, and the decryption matrix is used to reverse this
mapping.

The Hill cipher and other matrix-based encryption algorithms


have found applications in various domains. Some examples
include:

Military Communications: Matrix-based ciphers have been


historically used by military organizations to secure sensitive
communications and messages. The Hill cipher was used by the
United States Army during World War II.
Digital Signal Processing: Matrix-based encryption algorithms
are often employed in digital signal processing applications,
such as audio and video encryption. The efficient matrix
operations make them suitable for real-time encryption and
decryption of multimedia data.

Network Security: Matrix-based cryptography techniques can


be applied to secure network communications. By encrypting
data using matrices, the confidentiality and integrity of the
transmitted information can be protected.

Secure Storage: Matrix-based encryption algorithms can be


utilized to secure data stored in databases, file systems, or
other storage mediums. The matrices act as encryption keys,
preventing unauthorized access to the stored information.

It's worth noting that while the Hill cipher and matrix-based
cryptography have their merits, they are not widely used in
modern cryptographic systems. More advanced algorithms,
such as the Advanced Encryption Standard (AES), have replaced
them due to their higher security and efficiency.
HILL CIPHER:

1.ENCRYPTION:

The Hill Algorithm:


This can be expressed as,
C=E(K, P)=P*K mod 26 (where c=cipher text, key, p=plain text)

( ) mod 26
K 11 K 12 K 13
(c1 c2 c3) = (p1 p2 p3) K 21 K 22 K 23
K 31 K 32 K 33

C1=(P1K11+P2K21+P3K31) mod 26
C2=(P1K12+P2K22+P3K32) mod 26
C3=(P1K13+P2K23+P3K33) mod 26

We can understand this algorithm easily by an illustration:


Q) Encrypt “pay more money” using Hill cipher with key

( )
17 17 5
21 18 21
2 2 19
Ans.
p a y m o r e m o n e y
15 0 24 12 14 17 4 12 14 13 4 24

Key= 3*3 matrix


Plain text= pay mor emo ney
Encrypting pay

( ) mod 26
K 11 K 12 K 13
(c1 c2 c3) = (p1 p2 p3) K 21 K 22 K 23
K 31 K 32 K 33

( ) mod 26
17 17 5
(c1 c2 c3) = (15 0 4) 21 18 21
2 2 19

= (15*17+0*21+24*2 15*17+0*18+24*2
15*5+0*21+24*19) mod 26
= (303 303 531) mod 26
= (17 17 11)
= (R R L)

Encrypting mor
( ) mod 26
K 11 K 12 K 13
(c1 c2 c3) = (p1 p2 p3) K 21 K 22 K 23
K 31 K 32 K 33

( ) mod 26
17 17 5
(c1 c2 c3) = (12 14 17) 21 18 21
2 2 19

= (12*17+14*21+17*2 12*17+14*18+17*2
12*5+14*21+17*19) mod 26
= (532 490 677) mod 26
= (12 22 1)
= (M W B)

Encrypting emo

( ) mod 26
K 11 K 12 K 13
(c1 c2 c3) = (p1 p2 p3) K 21 K 22 K 23
K 31 K 32 K 33

( ) mod 26
17 17 5
(c1 c2 c3) = (4 12 14) 21 18 21
2 2 19

= (4*17+12*21+14*2 4*17+12*18+14*2
4*5+12*21+14*19) mod 26
= (348 312 538) mod 26
= (10 0 18)
= (K A S)
Encrypting ney

( ) mod 26
K 11 K 12 K 13
(c1 c2 c3) = (p1 p2 p3) K 21 K 22 K 23
K 31 K 32 K 33

( ) mod 26
17 17 5
(c1 c2 c3) = (13 4 24) 21 18 21
2 2 19

= (13*17+4*21+24*2 13*17+4*18+24*2
13*5+4*21+24*19) mod 26
= (348 312 538) mod 26
= (15 3 7)
= (P D H)
Plaintext: pay more money
Ciphertext: RRLMWBKASPDH

HILL CIPHER:

2.DECRYPTION:
The Hill Algorithm for decryption:
This can be expressed as,
P= D (K, C)= C× K mod 26(K=key, C=ciphertext, P=plaintext)
−1

1
−1
k =
DET K
×ADJ K

Converting ciphertext into plaintext of above example


“RRLMWBKASPDH”

( ) mod 26
14 25 7
1
K
−1
= 23
7 1 8
6 0 1

( ) mod 26
14 25 7
K
−1
= 17 7 1 8
6 0 1

( ) mod 26
238 425 119
K
−1
= 119 17 136
102 0 17

( )
4 9 15
K
−1
= 15 17 6
24 0 17
P = C× K
−1
mod 26

R R L M W B K A S P D H
17 17 11 12 22 1 10 0 18 15 3 7

Decrypting:

(
) mod 26
4 9 15
(P1 P2 P3) = (R R L) 15 17 6
24 0 17

(C1 C2 C3) = (17 17 14)( ) mod 26


4 9 15
15 17 6
24 0 17

= (17*4+17*15+11*24 17*9+17*17+11*0
17*15+17*6+11*17) mod 26
= (587 442 544) mod 26
= (15 0 4)
= (p a y)

CT R R L M W B K A S P D H
PT p a y m o r e m o n e y

You might also like