See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/350640240
Applications of Matrices to Cryptography
Research · April 2021
DOI: 10.13140/RG.2.2.30050.04806
CITATIONS READS
0 1,790
1 author:
Erick Wanjohi
University of Eastern Africa, Baraton
2 PUBLICATIONS 0 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Matrix and its applications View project
All content following this page was uploaded by Erick Wanjohi on 05 April 2021.
The user has requested enhancement of the downloaded file.
Applications of Matrices to Cryptography
A Research Paper Written in Fulfillment of The Requirements of The Course
MATH 499: Mathematics Project
University of Eastern Africa Baraton
April, 2021
Declaration
Declaration by candidate
I Erick Wanjohi, I declare that this research paper is my original work and it has not been submitted for
the requirement of a class by any other person.
Candidate: SWANMA1813 Sign ____________________ Date _________________
Erick Wanjohi Maina
Approval by the supervisor
This research paper entitled ‘’ APPLICATION OF MATRICES TO CRYPTOGRAPHY’’ was submitted
with the approval as a class supervisor for the course MATH 499: Mathematics Project.
Name: Dr. Zachary Kayiita Sign _______________________ Date ______________________
i
Acknowledgement
My deepest gratitude and thanks to Dr. Zachary Kayiita, for guiding and correcting my project with
attention and care. He has taken pain to go through this project and made necessary corrections as and
when needed.
I also thank my friend Mr. Samuel Mwangi, who allowed me to use his laptop when mine failed in the
course of this project.
I also extend my heartfelt thanks to the family of Mr. Grishon Maina, for their continued prayers and
support, without whom this project would have been a distant reality.
God bless you all
ii
Dedication
This work is dedicated to my family members, without their caring, and support it would not have been
possible, and to my parents, who passed on a love of reading and respect for education. They, who taught
me that the best kind of knowledge to have is that which is learned for its own sake, and that even the
largest task can be accomplished if it is done one step at a time.
iii
Table of Contents
Declaration ..................................................................................................................................................... i
Acknowledgement ........................................................................................................................................ ii
Abstract ......................................................................................................................................................... v
CHAPTER ONE ........................................................................................................................................... 1
1.1 Background information ..................................................................................................................... 1
1.2 Statement of problem .......................................................................................................................... 3
1.3 Objectives ........................................................................................................................................... 4
1.3.1 General objective .................................................................................................................. 4
1.3.2 Specific objectives ....................................................................................................................... 4
1.4 Research methodology ........................................................................................................................ 4
1.5 Justification ......................................................................................................................................... 5
1.6 Significance of study........................................................................................................................... 5
1.7 Definition of terms .............................................................................................................................. 5
CHAPTER TWO .......................................................................................................................................... 6
2.0 Literature review ..................................................................................................................................... 6
2.1 Introduction ......................................................................................................................................... 6
CHAPTER THREE .................................................................................................................................... 11
3.1 Findings and illustration ................................................................................................................... 11
CHAPTER FOUR ....................................................................................................................................... 19
Conclusion .............................................................................................................................................. 19
Recommendation .................................................................................................................................... 19
Reference List ............................................................................................................................................. 20
iv
Abstract
Cryptography is a discipline of encoding and decoding messages. Cryptography is used frequently in
people’s daily lives to keep sensitive information, such as credit card information. This research study
inspects matrices and its real-life application in cryptography. The focus of this project is to investigate
how to generate keys in order to encrypt words using Hill ciphers. Diffie-Helman mechanism will also be
looked in this project. The effectiveness of the encryptions studied and more secure means of encryption
will be presented by use of matrix.
v
CHAPTER ONE
1.1 Background information
Communication networks like wireless, wired and optical are able to carry huge amounts of data and thus
privacy of information and security of the network are of the utmost concern because a good part of the
information may be very sensitive or confidential [1]. Confidentiality of information has been accorded
prime importance with the explosive growth of the internet, which has touched most people’s lives.
Cryptography has been a confidential way of exchanging information. This chapter will give an insight of
linear algebra which is considered as a mother of matrices, it will also outline objectives of this research,
statement of the problem, scope of study, significance of doing this research and it will give a definition
of few terms. In order to clarify the history of matrices and its applications the influence of matrices in
mathematical world is spread wide because it provides an important base to many of principles and
practices. It is very important to define matrix. Matrix it is a Latin word for womb. Matrix can be defined
as an orderly arrangement of some number or symbols in certain rows and columns enclosed by some
brackets, subscribe by magnitude of its order and denominated by some capital letters [2].
In origin of mathematical matrices, it lies with the study of simultaneous linear equations. About
4000years ago the Babylonians knew how to solve a system of equations in two unknowns (a
2× 2 𝑠𝑦𝑠𝑡𝑒𝑚) in their famous nine chapters of the mathematical art (200bc) the chine’s solved 3×3
system by working solely with their numerical coefficients. This gave the first known example of the use
of matrix methods to solve simultaneous equations [5].
The modern study of system of linear equation can be said to have originated with Leibniz who in 1693
invented the notion of a determinant for this purpose but his investigation remained unknown at time. In
18th century the study of linear equation was usually subsumed under that of determinants. In connection
the invention the method of least squares (published in a paper in 1811 dealing with the determination of
the orbit of an asteroid), Gauss introduced a systematic procedure now could gauss elimination method.
This is also a use of matrix-like arrangements for solving simultaneous equation [15].
1
This project seeks to give an overview of the history of matrices and its applications touching on the
various topics used in concordance with it. The emergence of the subject came from determinants studied
by the founder of calculus, Leibnitz in the late 17thcentury langrage multipliers. (Darwking) more than 50
years later, crammer presented this idea of solving n×n system of linear equations based on determinants
but did not provided any proofs.
As stated earlier, Gauss –elimination method was based on solving linear equations themselves initially,
but did not have as much as much to do with matrices .in order for matrix algebra to develop a proper
notation of describing the process was necessary. Importantly to this process was the definition of matrix
multiplication. The introduction of matrix notation and invention of word matrix were motivated by
attempts to develop the right algebraic language for studying determinants. Sylvester introduced the term
matrix the Latin word for womb as a name for array numbers. He used word womb, because see linear
algebra has become more relevant since the emergence of calculus even though it’s fundamental equation
of 𝑎𝑥 + 𝑏 = 0 dates back centuries.
Euler brought to ignite the idea that a system of equation does not necessarily have to have a solution. He
recognized the need of conditions to be placed upon known variables in order to get a solution. The initial
work up until this period mainly dealt with a concept of unique solutions and square matrices where the
number of equations matched the number of unknowns. In 19th century Gauss introduced a procedure to
be used for solving a system of linear equations. His work mainly dealt with linear equations of different
numbers and variables. This method was known as Gaussian elimination method which involves concept
of combining, swapping or multiplying with each other in order to eliminate variables from certain
equation. Then used backs substitution to find the remaining unknown variables. Tucker (1993) reviewed
a matrix as a generator of determinants [15].
2
Arthur Cayley (1885) came up with matrix multiplication or matrix algebra. He defined matrix
multiplication as the matrix of coefficients for the composite transformation T2T1I in the product of the
matrix T2 times the matrix of T1. Cayley’s work of matrix multiplication gave birth to Cayley Hamilton
theorem which simply states that square matrices satisfy matrices at the end of the 19thcentury were
heavily connected with physics and for mathematicians more attention was given to vectors.
With advancement of Cayley, Gauss, Leibnitz, Euler, and other determinants and linear algebra moved
forward more quickly and more effective. With regardless of technology Gaussian elimination still proves
the best way known to solve a system of linear equations. This project most of the linear equations will be
solved using Gaussian elimination method. Matrices have influenced mathematical world because it
provides an important base to many of the principles and practices. Some of the applications of matrices
include to find least-square best fit lines to predict future outcomes or trends, and to encode and decode
messages what we call cryptography. Matrices are also broadly applied in solving questions of energy in
quantum mechanics. With all these practical applications matrices have spread and advanced. For sure
technology continues to push the use further but the history of matrices and its applications continue to
provide the foundation. Even though every few years companies update their text books the fundamentals
stay the same [7].
1.2 Statement of problem
Due to great need of security for passing sensitive data from one individual to another or from one
association to another through electronic technology, there is requirement for cryptography as an answer
to this issue. Due to a big problem of plain text attack this research will try to solve this problem by
employing use of Diffie-Hellman mechanism.
3
1.3 Objectives
1.3.1 General objective
The general objective of this research is to determine applications of matrices in cryptography.
1.3.2 Specific objectives
I. To show ways at which the sensitive information can be passed across mathematically
II. To apply matrices in cryptography models
III. To generate secret key using Diffie-Hellman mechanism
1.4 Research methodology
This chapter provides the research methodology to be applied in this study, sources of data and computer
software to be used in computation of matrices.
Sources of data for this research methodology will be from books, articles, journals and oral lecture
history. This research will mainly use MATLAB computer software in solving matrices.
MATLAB stands for matrix laboratory which can be defined as an interactive computing system designed
for easy computations of various matrix-based scientific and engineering problems.[9]
Out of the literature discussed above the main problem facing application of matrices in cryptography is
plain text attack, this research paper will try to solve this problem by employing the use of the Diffie-
Hellman mechanism which is used in generating a secret key based on modular exponentiation. Diffie-
Hellman mechanism is a specific method of securely exchanging cryptographic keys over public channel.
This research is going to examine a method of encryption that uses matrix multiplication and matrix
inverse. The steps to be used will:
I. Convert alphanumeric message to numbers
II. Generate a matrix from this numbers
III. Multiply this matrix with a secret key square matrix which in our case will be generated by use of
Diffie-Hellman mechanism which has an inverse
IV. To decode the encoded
4
V. message you multiply decoded message with the inverse of secret key
In summary this research will mainly deal with multiplication of matrices and generation of a secret key
using an improved Diffie-Hellman mechanism.
1.5 Justification
With the increasingly rise of cipher text cracking, it is important to employ the use of the Diffie-Hellman
mechanism to generate a secret key to encrypt messages safely.
1.6 Significance of study
The study sought to determine applications of matrices in cryptography. This study would be significant
to other researchers because of the research findings of this study will benefit researchers with literature
review to expand their research into application of matrices. It helps address and provide background
information for scholars who would want to carry further research in this area.
1.7 Definition of terms
Matrix: A matrix may define as an orderly arrangement of some number or symbols in certain rows and
columns enclosed by some brackets, subscribe by the magnitude of its order and denominated by some
capital letter.
Cryptography: cryptography is associated with the process of converting ordinary plain text into
unintelligible text and vice versa. It is a method of storing and transmitting data in a particular form so
that only those for whom it is intended can read and process it.
Secret key: it is a piece of information that is used to encrypt and decrypt messages in a symmetric.
Order of the matrix: is defined as the number of rows and columns.
Decoding: This is conversion of a coded message into intelligible language.
Encoding: This is the process of converting data from one form to another.
5
CHAPTER TWO
2.0 Literature review
2.1 Introduction
This chapter gives an insight into the literature by other scholars and researchers on the aspect of
applications of matrices. It reviews literature that is related to the specific and general objectives of the
research. It specifically covers the past studies /main review where it discusses literature related to the
specific objectives of study. It also presents literature on critical review of major issues, summary and
gaps to filled.
According to [4] use of matrix multiplication Hill Cipher acts on groups of letters, where plaintext is
divided into groups of letters of a fixed size, and each group is transformed into different group of letters.
Hiller cipher applies matrices to cryptography. Ciphers are methods for transforming a secret message
called plaintext into a particular form so that only those for whom it is intended and know the key can
read and process it. A common way to send coded messages is to assign numerical values from 1-26 to
the alphabet and send a message to a string of integers. The problem with this is that these codes are
easily broken using an analysis of frequency of numbers that appears in the coded messages.
The mathematical operation is given by: 𝑚𝑜𝑑 26 (𝐴𝐵) =
𝐶 𝑤ℎ𝑒𝑟𝑒 𝐵 𝑖𝑠 𝑡ℎ𝑒 𝑚𝑒𝑠𝑠𝑎𝑔𝑒 , 𝐴 𝑖𝑠 𝑡ℎ𝑒 𝑒𝑛𝑐𝑜𝑑𝑖𝑛𝑔 𝑚𝑎𝑡𝑟𝑖𝑥 𝑎𝑛𝑑 𝐶 𝑖𝑠 𝑡ℎ𝑒 𝑒𝑛𝑐𝑟𝑦𝑝𝑡𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥
On receiver side for the user to get the original message the following operation is used
𝐵 = 𝐴−1 𝐶
Map reduce and MPI are parallel and distributed computing systems with high-performance that spread
out a single application over many multi-core and multi-processor computers to rapidly complete the task.
U First method: sequential is accessed code by a single thread i.e., single thread can only do code in a
specific order, hence it is being sequential.
6
Second method is a library of routines that can be used to create parallel programs in C, C++ and fortrn77
using commonly available operating system services to create parallel processes and exchange
information among these processes. MPI is a standardized means of exchanging messages among
multiple computers running in a parallel program across a distributed memory to improve scalability,
performance, multi-core and cluster support, and interoperation with other applications.
According to [5] elliptic curves are fundamental objects in a large part of mathematics and seems to be
interesting because their study involves several fields of mathematics. It states that in 1985 Neal Koblitz
and victor miller independently proposed using groups of points on an elliptic curve system have over
systems based on multiplicative group of finite fields is the absence of the sub-exponential time algorithm
that could find discrete logarithms in these groups. In this research it stated that properties of invertible
matrices combined with elliptic curve so as to provide a novel mapping method for encrypting / process.
In this algorithm the original message is transformed by using mapping method and coded with non-
singular matrix. Then the result of decryption process is to put in matrix form to be decoded by the
recipient by using the inverse of matrix.
A review on cryptography with elliptic curve was concerned with a restricted form of elliptic curve that is
defined over a finite field noted Fp. One particular interest for cryptography is what is referred to as the
elliptic group mod p where p is a prime number. This is defined as follows
4𝛼 3 + 27𝛽2 (𝑚𝑜𝑑 𝑝) ≠ 𝑜 … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … . (1)
Ep (α, β) denotes the elliptic group mod p whose elements (x, y) are pairs of non-negative integers less
than p satisfying:
𝑦 2 = (𝑥 3 + 𝛼𝑥 + 𝛽)𝑚𝑜𝑑 𝑝 … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … . . (2)
7
This paper used Elgamal cryptosystem approach in encryption/ decryption using elliptic curves. It further
describes what an Egamal cryptosystem is by giving out the procedure;
I. Encode the plaintext message m to be sent as an x-y point pm
II. Point pm is encrypted as a cipher text and subsequently decrypted
One of the examples looked on this research was communication between Alice and Bob. Suppose here
that we have some elliptic curve E defined over a finite field Fp and that E and a point p∈ 𝐸 are publicly
known as the embedding system m𝑚 → 𝑝𝑚 which imbed plain text on elliptic curve E then when Alice
wants to communicate secretly with Bob they proceed as follows;
I. Bob chooses a random integer a and publishes the point aP (remains secret)
II. Alice chooses her own random integer I and sends the pair of points , (𝑃𝑖 + 𝐼(𝑎𝑃)) to Bob
(remains secret)
III. To decrypt message Bob calculate a(Ip) from the first part of the pair, then subtracts it from the
second part to obtain,𝑃𝑖 𝐼(𝑎𝑝) − 𝑎(𝐼𝑝) = 𝑝𝑖 + 𝐼𝑎𝑝 = 𝑝𝑖 and then reverse the embedding to get
back the message.
This method both sender and receiver of message requires to know the following:
I. E(Fp): the set of points on elliptic curve
II. P: base point with order N
III. C: the sets of all alphabets and punctuation marks
IV. S: the set of mapping point generated by the proposal algorithm
V. A: the encoded matrix
VI. A-1: Matrix inverse of A mapping is defined as 𝐹: 𝐶 ⟶ 𝑆
8
Mapping methodology is as follows:
Step I: transform the alphanumeric characters into points on elliptic curve
⌊(𝑝1 (𝑥1 , 𝑦1 ), 𝑝2 (𝑥2 , 𝑦2 ), 𝑝3 (𝑥3 , 𝑦3 ) … … … … … … 𝑝𝑛 (𝑥𝑛 , 𝑦𝑛 ) ⌋
We consider m the original message of length n. if n is not divided by 3, then the points have been
padded with Ω which represents space
Step II: create the matrix of 3×r with entry points in step 1
𝑝1 𝑝2 𝑝3 … … 𝑝𝑟
𝑚 = [𝑝𝑟+1 𝑝𝑟+2 𝑝𝑟+3 … … 𝑝𝑠 ]
𝑝𝑠+1 𝑝𝑠+2 𝑝𝑠+3 … … . 𝑝𝑛
With r=n/3 and s =2n/3
Step III: choosing a nonsingular matrix of 3×3 such that |𝐴| = ±1 then using addition and doubling of
points to compute: 𝑄 = 𝐴𝑀 with
𝑎11 𝑎12 𝑎13
A= [𝑎21 𝑎22 𝑎23 ]
𝑎31 𝑎32 𝑎33
Step IV: the result set of point is 𝑠 = [𝑄1 (𝑥1 , 𝑦1 ), 𝑄2 (𝑥2 , 𝑦2 ) … … … … 𝑄𝑛 (𝑥𝑛 , 𝑦𝑛 )]
This message can be retrieved from the encoded data using the elliptic curve decryption techniques and
the universe of matrix.
According to [3] many cryptosystems were designed to prevent data from unauthorized access, and some
are relatively not secure enough. This paper states Hill cipher algorithm as the most efficient
cryptosystems. This study provided a solution for the problem of non-invertible matrix by modifying the
way of dealing with key matrix, and make all matrices moreover, it solved the known of pair and cipher
text problem by generating new key matrix for each encrypted block of plaintext, using SHA-512. This
paper also gives the techniques to overcome all Hill Cipher problems.
9
First technique is to solve the problem of non-invertible matrices which enables us to use the second
method. This study classifies encryption system into two main categories i.e., Symmetric and
asymmetric. Symmetric encryption /secret key/ single key, uses the same key that sender uses to encrypt
the data and to decrypt it by receiver on the other side. In a symmetric encryption a safe way must be
used to move a secret key. Asymmetric encryption method is slow and complicated in nature. This paper
defined Hiller cipher as application of modular linear algebra to cryptology. Hill cipher was invented by
Lester S. Hill in 1929. His idea was matrices multiplications in which every character or group of
characters in the plaintext is substituted by a character or a group of characters in the cipher text, and
assigned to a numerical value. The encryption and decryption model are:
𝑐 = 𝑘 × 𝑥𝑚𝑜𝑑 𝑝
Where c=cipher text x=plain text k= key matrix p=is the modular value
𝑥 = 𝑘 × 𝑐 𝑚𝑜𝑑 𝑝
The problems with Hill cipher are:
I. none invertible matrices, since the encrypted text can’t be decrypted
II. Plaintext attack due to that Hill cipher linear nature; the cryptosystem can be broken through the
known plaintext attack.
10
CHAPTER THREE
3.1 Findings and illustration
According to [11] alphanumeric message is been encrypted using matrix by using the following
procedures;
I. Convert alphanumeric message to numbers
II. Generate a matrix from this numbers
III. Generate a secret key
IV. Use a secret key to decode the message
V. To decode the encoded message multiply decoded message by inverse of secret key.
Procedure I. Convert alphanumeric message to number.
Every alphabetic letter is assigned a number. In this section we will use the correspondence shown below,
where letters A to Z corresponds to numbers 1 to 20, a space is represented by number 27, and
punctuation is ignored.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z SPACE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Procedure II. Generate matrix from the numbers.
Since the generated matrix will be multiplied by the secret key it must have the following
property. Let A and B be two matrices denoted by AB for matrix multiplication the number of
columns in the first matrix must be equal to the rows in the second matrix i.e., if A is m×n and B
is an n×p matrix then C=AB which is defined by m×p matrix.[2]
Procedure III. Generate secret key
11
According to [13] a secret key it is a single key needed to encrypt and decrypt messages where it
is shared secretly between two communicating parties. A biggest problem is that this secret key
must be communicated through external mechanism separate from the communication channel
over which the encrypted text follows. With this secret message it is easy to decrypt the encoded
message. Due to need of secrecy this research employs the use of Diffie-Helman key exchange
which establishes a shared secret. The Diffie –Helman key algorithm solves the following; Erick
and Mary want to share a secret key for use in a symmetric cipher, but their only means of
communication is insecure. Diffie–Helman key exchange provides a solution to this. It follows
the following steps;
I. Step I Erick and Mary to agree on a prime number p and a nonzero integer g which is
called generator. This values p and g are made public and can be shared via mails.
II. Step II for Erick to pick a secret integer ‘a’ that he does not reveal to anyone, while at
the same time Mary picks an integer ‘b’ that she keeps secret
Mary and Erick compute the following,
𝐴 ≡ 𝑔𝑎 𝑚𝑜𝑑 𝑝 ( 𝑒𝑟𝑖𝑐𝑘) 𝐵 ≡ 𝑔𝑏 𝑚𝑜𝑑 𝑝 (𝑚𝑎𝑟𝑦)
III. Step III. They later exchange A and B i.e., Erick sends A to Mary and Mary sends B to
Erick, since these numbers are sent through mails they cannot be considered as secret
because it can be cracked by hacker who is a third party.
IV. Step IV. Finally, Erick and Mary again use their secret integers to compute
𝑘 ≡ 𝐵𝑎 𝑚𝑜𝑑 𝑝 ( 𝑒𝑟𝑖𝑐𝑘 ) 𝑘 ≡ 𝐴𝑏 𝑚𝑜𝑑 𝑝 (𝑚𝑎𝑟𝑦)
The resulting figure k is common to Erick and Mary and it is considered to be secret
key. Generated key must be invertible.
12
Procedure IV. Since the generated key is secret it can be used to encode the message been sent via public
device to the recipient encoding of the message is done by multiplying the matrix message by the secret
key.
Procedure V. Since the recipient has the secret key, he/she can use the inverse of secret key to decode the
encrypted message. Based on the knowledge in algebra we know that if given two matrix A and B matrix
multiplication is given by;
𝐴. 𝐵 = 𝐶
𝐴 = 𝐶. 𝐵−1
Illustrations
First illustration
Erick and Mary wanted to exchange ATM number through mail but they are worried that there could be a
third-party hacker by the name Denis. So, they choose to use matrices in exchanging ATM number.
ATM number 5314 9402 3890 4384
They had to agree on the secret key to use, the problem was that they were far to each other so the only
means they can use to share the secret key is via public transport. Due to sensitivity of the information, it
was required that this secret key should be shared securely as possible.
13
They both know p=23 and g generator =11
Erick Mary
a=6 A= 116 mod 23= 9 b=5 B= 115 mod23= 5
K=56 mod 23=8 k=95 mod 23= 8 K=8
a=3 A=113 mod 23=20 b=4 B=114 mod 23= 13
K=12
k=133 mod 23= 12 k=204 mod 23= 12
a=2 A=112 mod 23= 6 b=1 B= 11 mod 23=11
K=6
2
k=11 mod 23=6 k=6 mod 23=6
a=2 A= 112 mod 23= 6 b=5 B=115 mod 23=5
K=2
k=52 mod 23= 2 k=65 mod 23= 2
a=3 A=113 mod 23=20 b= 8 B=118 mod 23=8
K=6
3 8
K=8 mod 23 =6 k= 20 mod 23= 6
a=7 A= 117 mod 23= 7 b= 10 B=117 mod 23=2
K=13
k= 27 mod 23= 13 k= 710 mod 23=13
a=3 A= 113 mod 23= 20 b= 6 B=116 mod 23 =9
K=16
k= 93 mod 23 = 16 k= 206 mod 23 = 16
14
a=7 A= 117 mod 23= 7 b= 8 B= 118 mod 23= 8
k= 87 mod 23 = 12 k= 78 mod 23 = 12 K=12
a=0 A = 110 mod 23= 1 b= 2 B= 112 mod 23= 6
k= 60 mod 23= 1 k= 12 mod 23= 1
K=1
a= 4 A= 114 mod 23= 13 b= 3 B= 113 mod 23 = 20
k= 204 mod 23= 12 k= 133 mod 23= 12
K=12
a=10 A= 1110 mod 23= 2 b= 8 B= 118 mod 23= 8
k= 810 mod 23= 3 k= 28 mod 23= 3 K=3
a=7 A= 117 mod 23 =7 b=3 B= 113 mod 23= 20
k= 203 mod 23= 21 k= 73 mod 23= 21 K=21
a= 3 A= 113 mod 23= 20 b= 2 B= 112 mod 23= 6
k= 63 mod 23= 9 k= 202 mod 23= 9 K=9
a=8 A= 118 mod 23= 8 b= 9 B= 119 mod 23= 19
k= 198 mod 23= 9 k= 89 mod 23= 9
K=9
12 7
a= 12 A= 11 mod 23= 12 b= 7 B= 11 mod 23= 7
k= 712 mod 23= 16 k= 127 mod 23= 16
K=16
a= 8 A= 118 mod 23= 8 b= 6 B= 116 mod 23= 9
k= 98 mod 23= 13 k= 86 mod 23= 13 K=13
15
Hence the generated secret key via secure method of sharing key is
8 6 1 9
12 13 12 9
𝐴=[ ]
6 16 3 16
2 12 21 13
3/34 1/17 −1/17 −1/34
−138/667 61/697 75/697 −39/697
𝐴−1 =[ ]
23/7667 106/7667 −361/7667 355/7667
1260/7667 −860/7667 −109/7667 447/7667
5 9 3 4
3 4 6 3
𝑀=[ ]
1 0 9 8
4 2 0 4
𝐴𝑀 = 𝑋 𝑡𝑜 𝑒𝑛𝑐𝑜𝑑𝑒 𝑚𝑎𝑟𝑖𝑥 𝑚 𝑤𝑖𝑡ℎ 𝑠𝑒𝑐𝑟𝑒𝑡 𝑘𝑒𝑦 𝐴
𝐴−1 𝑋 = 𝑀 𝑡𝑜 𝑑𝑒𝑐𝑜𝑑𝑒 𝑡ℎ𝑒 𝑒𝑛𝑐𝑜𝑑𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥 𝑥
Where A= secret key
M= information to be encoded X= encoded matrix
The next step is to encode matrix M9
8 6 1 9 5 9 3 4 95 114 69 94
12 13 12 9 3 4 6 3 147 178 222 219
𝑋= [ ]×[ ]=[ ]
6 16 3 16 1 0 9 8 145 150 141 160
2 12 21 13 4 2 0 4 119 92 267 264
The encoded message is sent to Mary through public transport. So as Mary to get the intended message
she is required to decode the message sent by Erick by multiplying the encoded message with an inverse
of A.
16
3 1 1 1
− −
34 17 17 34
138 61 75 39 95 114 69 94 5 9 3 4
− −
667 697 697 697 147 178 222 219 3 4 6 3
𝑀= ×[ ]=[ ]
23 106 361 355 145 150 141 160 1 0 9 8
− 119 92 267 264 4 2 0 4
7667 7667 7667 7667
1260 860 109 447
[ 7667 − 7667 − 7667 7667 ]
After multiplying the encrypted message with an inverse, Mary was able to get the exact ATM number in
secured manner. Denis the third-party hacker cannot hack the information sent to Mary due that he
doesn’t know the secret key.
Second illustration
In war between Kenyan military and Alshabab. In obvious way Kenyan military group themselves into
troops. One troop can wish to send a message to another troop in a secured manner. Let say the intended
message is ATTACK IS TONIGHT.
ATTACK IS TONIGHT is converted to numbers as;
1 20 20 13 11 27 9 19 27 20 15 14 9 7 8 20
The agreed secret key was
3 10 20
𝐴 = [20 9 17]
9 4 17
17 6 2
−
327 109 327
187 43 349
𝐴−1 = −
1635 545 1635
1 26 173
[ 1635 −
545 1635 ]
17
3 10 20 1 1 27 27 14 8 603 253 351 581 272 224
𝑋 = [20 9 17] × [20 3 9 20 9 20] = [540 234 774 975 480 340]
9 4 17 20 11 9 15 7 0 429 208 432 578 281 152
Encoded message X can be decoded by multiplying it with inverse of a secret key.
17 6 2
−
327 109 327
187 43 349 603 253 351 581 272 224 1 1 27 27 14 8
− × [540 234 774 975 480 340] = [20 3 9 20 9 20]
1635 545 1635 429 208 432 578 281 152 20 11 9 15 7 0
1 26 173
[ 1635 −
545 1635 ]
The resulting matrix is then converted into alphanumeric form so that the second troop can get the
intended message.
𝑨 𝑨 𝑠𝑝𝑎𝑐𝑒 𝑠𝑝𝑎𝑐𝑒 𝑵 𝑯
[𝑻 𝑪 𝑰 𝑻 𝑰 𝑻 ]
𝑻 𝑲 𝑺 𝑶 𝑮 𝑠𝑝𝑎𝑐𝑒
ATTACK IS TONIGHT
18
CHAPTER FOUR
Conclusion
With the increase of insecurity in passing sensitive data from one person to the other, application of
matrices in cryptography can be used in passing data in a secured manner. This study employed use of
Diffie-Helman mechanism which improvised ways in which secret key can be transported using public
transport.
Recommendation
Future research studies should use advanced cryptography techniques like Data Encryption Standard
(DES), blow fish, two fish and Rivest-Shamir-Ad leman (RSA). This will help in minimizing cybercrime
more so in hacking of sensitive information passed between two parties.
19
Reference List
[1]. Andrew S. Tannebaum Computer Networks second edition Prentice Hall, (2003)
[2]. Householder, Alston the Theory of matrices in numerical analysis New York, (1975)
[3]. Farajallah, M., & Hamamreh, R. Self-generating multi keys cryptosystem model for noninvertible
matrices based on hill cipher Algorithm. Proceedings of the 2009 International Conference on Security
Management, SAM 2009. (2009 July)
[4]. Chattaroy, S. K., Majhi, J., & Rath, G. S. Encryption by Hill cipher and by a novel method using
Chinese remainder theorem in Galois field. International Journal of Signal and Imaging Systems
Engineering, 6(1), 38-45, (2013).
[5]. Amounas, F., & El Kinani, E. H Fast mapping method based on matrix approach for elliptic curve
cryptography. International Journal of Information & Network Security (IJINS), 1(2). (2012).
[6]. Meyer, C. D Matrix analysis and applied linear algebra (Vol. 71). Siam, (2000).
[7]. Margenau, Henry; Murphy, George Moseley. The Mathematics of Physics and Chemistry. Princeton: Van
Nostrand (1996)
[8]. Boyer C.B A history of mathematics New York Willey, (1989)
[9]. Gilat Amos MATLAB: An introduction with applications second edition John Wiley and Sons
[10]. Atkinson, Kendal A. An introduction to numerical analysis second edition New York, (1998)
[11] Elder, Timo hanke An introduction to cryptography, (2018)
[12] Horn, Roger A, (1991) Topics in matrix analysis Cambridge university
[13] Mathew Copeland, Joergan Grahn (1999) the GNU privacy handbook
20
View publication stats