Post on 16-May-2020
1
ENCRYPTION AND DECRYPTION SCHEME INVOLVING
FINITE STATE MACHINE AND LU DECOMPOSITION By
Ayush Mittal, Dr. Ravindra Kumar Gupta
Department of Computer Science & Engineering
S. R. K. University, Bhopal, (M.P.), India
sss.math@yahoo.co.in, ravindra_p84@rediffmail.com
Abstract:
Objectives: The aim of this study is to introduce a new encryption and decryption
scheme involving finite state machine and LU decomposition method.
Methods/Statistical analysis: The designed encryption scheme using finite state
machine and LU decomposition method maintained the secrecy of data for secure
communication. In this proposed technique we also used lower and upper
triangular matrices, which is obtain from square matrix by decomposition. Under
modulation of prime number, the key will be lower triangular matrix in
encryption process, while in decryption process the key will be upper triangular
matrix.
Findings: Due to the chosen finite state machine alongwith different encryption
and decryption key which is generated from randomly chosen a non-singular
square matrix, it is very difficult to extract the original information. Brute force
attack is also difficult because of the size of key.
Application/Improvements: The technique is useful in areas where sensitive
information is to be transferred like banking, military services. If the private key
has got into third party hands, the damage can be huge. To overcome this, the
proposed algorithm used finite state machine and LU decomposition for
encrypting the messages which will provide different keys for encrypting different
data blocks.
Keywords: Encryption, Decryption, Finite State Machine and LU decomposition.
1. INTRODUCTION:
There are two important factors in cryptography, encryption and
decryption. To secure the information both the techniques are mainly used. To
convert plain text into cipher text we used encryption method. The reverse
process of encryption is known as decryption i.e. conversion of cipher text into
plain text. Cryptographer is a person who did practice of encryption and
decryption. When user has a certain piece of secret knowledge then information is
determined. Key is known as secret knowledge, which is send to the receiver.
Changing of information from one form to another form in a secure
manner is known as encryption process in cryptography. Thus this change type of
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1270
2
information can't read by unauthorized people, so cipher text is the value of
encryption. A data which is stored in a computer system or transmitted via
internet confidentiality is the purpose of encryption. The major part in an
encryption is the encryption key. There are two types of key, public and private
key. In encryption and decryption process both two keys are mainly used. Public
key is available for everyone, but private key must be kept as secret. The strength
of encryption is directly related to key size. Thus breaking of encrypted data is so
difficult when key size is increased.
When encrypted text is converted into a text that we or our computer are
able to read and understand, then this process is called decryption. Decryption
describes a process in which data is un-encrypted manually or using the proper
codes or keys. Without knowing the secret key it is very difficult to decrypt the
data. We will get the original text after decryption [1]
.
Application of automaton theory having a wide range in the field of
cryptography. In automata theory, a deterministic finite automaton (DFA) is a
branch of theoretical computer science, which is also known as deterministic
finite state machine. A unique computation is produced by finite state machine for
each input string. Uniqueness of the computation an deterministic having same
meaning. A mathematical model of a system is known as finite automaton with
discrete inputs and outputs. When finite automata allows 0, 1 or more transitions
from a state on the same input symbol then it is called non-deterministic finite
automata. If S is the finite non-empty set of states, then a state or element of S is
the outcome for deterministic automata, while in the case of non-deterministic
automata outcome is the subset of S. Thus a behavior model which composed a
finite number of states and transition between them is known as finite state
machine. To encrypt the data as well as maintain secrecy of the data, finite state
machine is used recently in cryptography.
Finite State Machine:
A finite state machine is also known as a mathematical model of
computation which is used to design both sequential logic circuit and computer
program [2]
. Finite state machine is also an abstract machine and one of the finite
states it can be reside. At a time it can be reside in one state only. A state in which
machine can reside at any given time is called current state. Transition is a
process in which machine can change from one state to another state and it is
initiated by triggering event or condition.
A finite machine F having 6-tuple (R, In, Ou, h, x, t0), where
1. R is a finite set of states (t0, t1, t2, …) whose elements are called state of
machine.
2. t0 is a special element of R referred to as the initial state of the machine.
3. In = {i1, i2, …} is a finite set of input letters.
4. Ou = {o1, o2, …} is a finite set of output letters.
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1271
3
5. h is a function from R In to R called the transition function.
6. x is a function from R to Ou called the output function.
A finite state machine is resided in one of its states at any instant.
According to the transition function the machine will go to another state after
receiving an input symbol. According to the output function, machine produces an
output at each state. Machine is resided in the initial state t0 at very beginning.
There are two types of Finite state machines as follows:
1. Moore machine
2. Mealy Machine
When outputs depended on only the present state then machine is called
Moore machine. On other hand a finite state machine is called Mealy machine
when output depends on the present state as well as the present input. We used
Mealy machine in this paper.
Decomposition method:
In this method a matrix can be expressed as the product of a lower
triangular matrix and an upper triangular matrix where all the principal minors of
the matrix are non-singular [3]
.
Consider a matrix A of order n can be expressed as product of two
triangular matrices, one is lower triangular and another is upper triangular, then
[
] [
] [
]
where [
] and [
]
There are three types of decomposition method viz. Doolittle, Crout and
Cholesky. In this paper we will used Doolittle method. In Doolittle method to
simplify the calculations we choose ( ) = (1, 1,..., 1), therefore
[
] [
] [
]
where [
] and [
]
2. LITERATURE REVIEW:
For encrypting and hiding the data using finite state machines various
researchers [4-6]
are developed an innovative technique. To maintain secrecy of the
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1272
4
message they also used Fourier sine and cosine transformation, Fibonacci series
and other tools.
3. METHODOLOGY:
In this paper we propose to develop a new cryptographic scheme
involving finite state machine and LU decomposition method following on the
lines of [4-6]
and various researchers. On the other hand, under modulation of
prime number, to encrypt the message we use lower triangular matrix at each
stage and for decrypting the cipher text we use upper triangular matrix at each
stage. Proposed algorithm is based on LU decomposition method of a matrix as
secret key and chosen finite state machine.
On the other hand for double security system we consider n consecutive
plaintext letters and n cipher text letters substitute’s for them. n determine the
substitution, where n is a positive integer. The idea is, in one plaintext element for
n alphabetic characters take m linear combinations and produce n × n constant
matrix C. In this technique we generate the key matrix using LU Decomposition
method A = LU and g.c.d ((det A)mod p, p) = 1. Therefore constant matrix C =
APT ⟹ C = (LU)PT. We use LCT = C ⟹ CT = L−1
C for encryption process and
UPT = CT ⟹ PT = U−1
CT for decryption process, where PT is plain text and CT is
cipher text.
Secrecy is maintained by secret key, private key and Finite state machine.
It is very challenging to break the cipher text without chosen finite state machine
and proper key. In the input sequence the number of elements must be maximum
to avoid the cipher attacks.
4. ALGORITHM:
For substitution, we use the following conversion table for
alphabets/symbols.
Table I
alphabet/
symbol
numerical
value
alphabet/
symbol
numerical
value A 1 P 16
B 2 Q 17
C 3 R 18
D 4 S 19
E 5 T 20
F 6 U 21
G 7 V 22
H 8 W 23
I 9 X 24
J 10 Y 25
K 11 Z 26
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1273
5
L 12 Space 27
M 13 # 28
N 14 @ 0
O 15
Encryption:
1. Take the plain text and using Table I (for which sender and receiver are
agreed) to convert each alphabet of plain text into their corresponding
numeric value. After then plain text is divided into n number of texts. A
plain text matrix is created by arranging the text into a square matrix of
order n, n > 0.
2. After adding all the elements of plain text matrix, convert them into binary
form. This binary form is called secrete key and input also.
3. Consider a Finite state machine. For this in this paper we choose Mealy
machine. Under residue mod p (for which sender and receiver are agreed),
obtained the output from Finite state machine.
4. As key matrix choose a non-singular matrix.
5. Using the following formula, calculate the cipher text matrix at each stage
for all plain text matrix:
Pi = P (= Xi) + [output at ith
state] In n, i = 1, 2, 3, …..;
Ci = APi (mod p);
Xi = L−1
Ci (mod p),
where P is the chosen plain text, Pi is the plain text at ith
stage, Ci is the
constant matrix at ith
stage, Xi is the cipher text at ith
stage, I is identity
matrix of order n and L is the lower triangular matrix as encryption key.
6. Using Table I, numeric value of each element of last cipher text matrix is
converted into corresponding alphabet. Finally, this cipher text is send to
the receiver.
Decryption:
1. Finite state machine, Decryption key, Secret key and Cipher text are
received by receiver.
2. Using Table I, each alphabets/symbols of the cipher text are converted into
corresponding numeric value. After then following formula is applied:
Pi = U−1
Xi (mod p)
Xi = Pi − [output at ith
state] In n, i = 1, 2, 3, …..;
where Pi is the plain text at ith
stage, Xi is the cipher text at ith
stage, I is
identity matrix of order n and U is the upper triangular matrix as
decryption key.
3. The original message will be obtain finally.
Illustration:
Encryption Steps:
1. Choose the plain text message as ENCRYPT MESSAGE.
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1274
6
2. Using above given Table 1, chosen plain text is converted into corresponding
numerical values as follows:
[
]
3. Add all elements of plain text P, we get 224. Convert it into binary form, which
gives 224 = (11100000)2. Choose 11100000 as secret key.
4. Now we define a Mealy machine as follows for input key 11100000 with
output under residue mod 4 (say):
Sl.No. Input Previous
State
Present
State
Output Cipher matrix
1 1 q0 q1 1
[
]
2 1 q1 q2 3
[
]
3 1 q2 q3 3
[
]
4 0 q3 q1 2
[
]
5 0 q1 q0 0
[
]
6 0 q0 q2 0
[
]
7 0 q2 q0 0
[
]
8 0 q0 q0 0
[
]
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1275
7
5. Consider a non-singular matrix A of order 4 4 as the key matrix given by
[
]
Let A = LU
where
[
] [
] [
]
For LU decomposition of a matrix in Dolittle's method we choose
( ) = (1, 1, 1, 1), therefore Therefore
[
] [
] [
]
Hence
[
]
[
]
After equating the corresponding elements in above equation, we get Therefore after simplification, we get
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1276
8
Hence
[
] [
] [
]
6. Now calculate
Pi = P (= Xi) + [output at ith
state] I4 4, i = 1, 2, 3, 4, 5, 6, 7, 8;
Ci = APi (mod 29);
Xi = L−1
Ci (mod 29),
where P is the chosen plain text, Pi is the plain text at ith
stage, Ci is the constant
matrix at ith
stage, Xi is the cipher text at ith
stage and I is identity matrix of order
4. Therefore
(i) P1 = P + [output at 1st state] I4 4
= [
] [
]= [
]
and C1 = AP1(mod 29)
= [
] [
] (mod 29)
= [
]
So X1 = L−1
C1(mod 29)
= [
] [
](mod 29)
= [
]
(ii) P2 = P(= X1) + [output at 2nd
state] I4 4
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1277
9
= [
] [
]= [
]
and C2 = AP2(mod 29)
= [
] [
] (mod 29)
= [
]
So X2 = L−1
C2(mod 29)
= [
] [
](mod 29)
= [
]
(iii) P3 = P(= X2) + [output at 3rd
state] I4 4
= [
] [
]= [
]
and C3 = AP3(mod 29)
= [
] [
] (mod 29)
= [
]
So X3 = L−1
C3(mod 29)
= [
] [
](mod 29)
= [
]
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1278
10
(iv) P4 = P(= X3) + [output at 4th
state] I4 4
= [
] [
]= [
]
and C4 = AP4(mod 29)
= [
] [
] (mod 29)
= [
]
So X4 = L−1
C4(mod 29)
= [
] [
](mod 29)
= [
]
(v) P5 = P(= X4) + [output at 5th
state] I4 4
= [
]
and C5 = AP5(mod 29)
= [
] [
] (mod 29)
= [
]
So X5 = L−1
C5(mod 29)
= [
] [
](mod 29)
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1279
11
= [
]
(vi) P6 = P(= X5) + [output at 6th
state] I4 4
= [
]
and C6 = AP6(mod 29)
= [
] [
] (mod 29)
= [
]
So X6 = L−1
C6(mod 29)
= [
] [
](mod 29)
= [
]
(vii) P7 = P(= X6) + [output at 7th
state] I4 4
= [
]
and C7 = AP7(mod 29)
= [
] [
] (mod 29)
= [
]
So X7 = L−1
C7(mod 29)
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1280
12
= [
] [
](mod 29)
= [
]
(viii) P8 = P(= X7) + [output at 8th
state] I4 4
= [
]
and C8 = AP8(mod 29)
= [
] [
] (mod 29)
= [
]
So X8 = L−1
C8(mod 29)
= [
] [
](mod 29)
= [
]
Therefore cipher text is
C@ZYRCLGKMYRXWDD
Decryption Steps:
1. Take cipher text C@ZYRCLGKMYRXWDD.
2. Using Table 1, find corresponding numerical values of the above cipher text.
After arranging these numerical values into a matrix of order 4, we get as follows:
[
] X8 (say)
3. Now calculate
Pi = U−1
Xi (mod 29)
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1281
13
Xi = Pi − [output at ith
state] I4 4, i = 1, 2, 3, 4, 5, 6, 7, 8;
where Pi is the plain text at ith
stage, Xi is the cipher text at ith
stage, I is
identity matrix of order n and U is the upper triangular matrix as
decryption key.
(i) P8 = U−1
X8 (mod 29)
= [
] [
] (mod 29)
= [
]
X7 = P8 − [output at 8th
state] I4 4
X7 = [
]
(ii) P7 = U−1
X7 (mod 29)
= [
] [
] (mod 29)
= [
]
X6 = P7 − [output at 7th
state] I4 4
= [
]
(iii) P6 = U−1
X6 (mod 29)
= [
] [
] (mod 29)
= [
]
X5 = P6 − [output at 6th
state] I4 4
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1282
14
= [
]
(iv) P5 = U−1
X5 (mod 29)
= [
] [
] (mod 29)
= [
]
X4 = P5 − [output at 5th
state] I4 4
= [
]
(v) P4 = U−1
X4 (mod 29)
= [
] [
] (mod 29)
= [
]
X3 = P4 − [output at 4th
state] I4 4
= [
]
(vi) P3 = U−1
X3 (mod 29)
= [
] [
] (mod 29)
= [
]
X2 = P3 − [output at 3rd
state] I4 4
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1283
15
= [
]
(vii) P2 = U−1
X2 (mod 29)
= [
] [
] (mod 29)
= [
]
X1 = P2 − [output at 2nd
state] I4 4
= [
]
(viii) P1 = U−1
X1 (mod 29)
= [
] [
] (mod 29)
= [
]
P = P1 − [output at 1st state] I4 4
= [
]
4. Using Table I, the numeric values of each element of above matrix are
converted into corresponding alphabet/symbol. Finally we obtain original plain
text as given below:
ENCRYPT MESSAGE
5. RESULT AND DISCUSSION:
To encrypt and decrypt the message there is no single algorithm is
sufficient to fulfill the purpose. Therefore to remove the deficiency and finding
better solution a number of researchers are working in the field of cryptography.
In this paper we develop a new algorithm which involves finite state machine and
LU decomposition of a square matrix. In LU decomposition method we used
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1284
16
lower triangular matrix as encryption key and upper triangular matrix as
decryption key.
By virtue of chosen finite state machine alongwith different encryption
and decryption key which is generated from randomly chosen a non-singular
square matrix, extraction of original information is very difficult. Due to the size
of key, brute force attack is also difficult.
6. CONCLUSION:
There are various advantages and disadvantages of an algorithm. Since our
algorithm is developed by finite state machine and LU decomposition of a square
matrix, therefore our system proposed a good strategy. To encrypt and decrypt the
messages, symmetric key generation is highly secure due to the decomposition of
the matrix into lower and upper triangle matrices. In the proposed algorithm, for
encryption process the lower triangle matrix is used, while for decryption process
upper triangle matrix is used over residue modulo prime number, therefore for
plaintext attack and cipher text attack the proposed cryptosystem get better
protection.
Hence, our system also proposed a new encryption algorithm, which
provides enough security. Due to chosen finite state machine, secret key, different
operations on matrices and LU decomposition, four levels of security are
maintained. However, algorithm is also known, extraction of original information
from cipher text is fairly tough.
REFERENCES
1. Stallings W.: Cryptography and Network Security: Principles and
Practices, Prentice Hall, 2002.
2. John Hopcroft, Jeffrey Ullman: Introduction to Automata Theory,
Languages, and Computation, Addison-Wesley, 2001.
3. Strang Gilbert: Introduction to Linear Algebra, Wellesley-Cambridge
Press, Fifth Edition, 2016.
4. G. Karudaiyar, S.Karthikeyan and B. Sainath3: Encryption and Decryption
Scheme by Using Finite State Machine, Biosciences Biotechnology
Research ASIA, Vol. 11(3), 2014, pp. 1861-1865.
5. Ray Prasanta Kumar, Dila Gopal Krishna, and Patel Bijan Kumar:
Application of Some Recurrence Relations to Cryptography using Finite
State Machine, International Journal of Computer Science and Electronics
Engineering, Vol. 2(4), 2014, pp. 220-223.
6. Sirivaram Srilakshmi: New Encryption Scheme Using Fourier Sine and
Cosine Transforms and Finite State Machine, International Journal of
Advanced Research in Computer Science, Vol. 8, No. 6, July 2017, pp.
153-155.
Journal of Xi'an University of Architecture & Technology
Volume XII, Issue II, 2020
Issn No : 1006-7930
Page No: 1285