An Elgamal Encryption Scheme of Fibonacci Q-Matrix and Finite State Machine

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Journal of Applied Computer Science & Mathematics, no.

20 (9) /2015, Suceava

An Elgamal Encryption Scheme of Fibonacci Q-Matrix


and Finite State Machine
B. Ravi Kumar1 A. Chandra Sekhar2 G. Appala Naidu3
1
Department of Mathematics, GIT, GITAM University, Visakhapatnam, INDIA
ravikumarbrk6@gitam.edu
2
Department of Mathematics, GIT, GITAM University, Visakhapatnam, INDIA
acs@gitam.edu
3
Department of Mathematics, Andhra University, Visakhapatnam, INDIA
gan.maths@gmail.com

Abstract- Cryptography is the science of writing messages in The Fibonacci theory of numbers [8][9][10][11][12]
unknown form using mathematical models. In Cryptography, ascertained the possibility of new applications for scientific
several ciphers were introduced for the encryption schemes. results as seen in the last few decades.
Recent research focusing on designing various mathematical The following (2X2) square matrix was received in [10]
models in such a way that tracing the inverse of the designed [13]:
mathematical models is infeasible for the eve droppers. In the
present work, the ELGamal encryption scheme is executed
1 1 
using the generator of a cyclic group formed by the points on Q    (1)
choosing elliptic curve, finite state machines and key matrices 1 0 
obtained from the Fibonacci sequences. The nth power of the Q-matrix was proven [10] [14]:
Keywords : ElGamal, Fibonacci sequence, Finite state F Fn 
machine, encryption, decryption. Q n   n 1 , (2)
 Fn Fn 1 
I. I NTRODUCTION Where n  0,1,2,................Fn1 , Fn , Fn1 are the
Fibonacci numbers.
Victor Miller and Neal Koblitz first proposed Elliptic curve The recurrence relation:
cryptography, in the year 1985. Elliptic curve cryptography is Fn1  Fn  Fn1 (3)
not a new technology and has proven its security by standing
with a generation of attacks. In the recent years, as the With the initial conditions are: F1  F2  1 (4)
wireless industry has grown, the numerous companies have The determinant Q-matrix in (2) can be proved coinciding
adopted Elliptic curve cryptography as an innovative security with Cassini formula using (3) and (4).
DetQ n  Fn 1 Fn 1  Fn  (1) n
2
technology. Elliptic curve employs a relatively short (5)
encryption key and the short key is faster and requires less
Consider the multiplicative group M2 the set of all 2 2
compelling power than the other first-generation encryption,
Matrices over the set of all real numbers.
public key algorithm a ‘160’-bit Elliptic curve
If n=1, equation (6) reduced as
cryptography, encryption key provides the same security as
 0 1
‘1024’-bit RSA encryption key [1] [2] [3] [4] . Q1    (7)
The equations of the elliptic curves take the following  1 1
form, known as Weierstrass equation [6]: The extension to the above matrix is as follows [14]:
y 2  gxy  hy  x 3  ix 2  jx  k , where g, h, i, j, k are real  Fn 1 Fn 0 
numbers and x, y take on values in the real numbers. The   (8)
Q2   Fn Fn 1 0 
n

equation of the elliptic curve is of the form: y 2  x 3  gx  h,  0


 0 1 
where x, y, g, h belongs to R. And also include a single
element denoted by O is called the point at infinity or the
zero point. This equation also has to satisfy the discriminant B. Finite State Machine
  4 g 3  27 h 2 is not equal to zero [ 4][5][6][7 ]. Automata theory is a key to software for verifying systems
of all types that have a finite number of distinct states, such
A. Fibonacci Q-matrix as communication protocols or protocol for secure exchange
of information.

13
Computer Science Section

PB  K B  C. Now ‘A’ wants send the message M to B. For


this purpose A chooses a random integer ‘n’ now A encrypts
M as CTm  {nC , M  nPB } and sends to B. Then ‘B’ decrypts
the CTm as
M  nPB  K B (nC )  M  n( K BC )  K B (Cn )  M [17 ] [18].

II. PROPOSED ALGORITHM

Alice wants to send the message to Bob using elliptic curve


ElGamal encryption by using Moore machine. Alice chooses
Fig.1 Moore machine with residue mod 4 the elliptic curve y 2  x 3  gx  h over the field z p .
Choose the point G on the elliptic curve.
Finite state machines (FSM), also known as finite state Alice selects a private key ‘a’ and generates the public key
automaton (FSA), at their simplest, are models of the A = ‘aG’ and Bob selects a private key ‘b’ and generates the
behaviors of a system or a complex object, with a limited public key B = ‘bG’.
number of defined conditions or modes, where mode
transitions change in circumstance [15] [16]. A. Encryption
A deterministic finite automation (DFA) is a quintuple
M  (Q, , q0 ,  , F ), where Step 1: Alice chooses a random integer k, and keeps it
 Q is a finite set of states. secret.
Step 2: Compute k G.
  is a finite set of input symbols. Step 3: Alice selects the Bob’s public key B  bG.
 q0 is the start state indicated by an arrow  . Step 4: Compute kB  k (bG )  l.
  is a transition function  : Q    Q i.e., Step 5: Compute aB  a(bG)  m.
 ( q 0 , a )  q i  Q. Step 6: Alice wants to send the message qi to Bob.
 F  Q is a finite set of final states. Step 7: Alice wants to convert the message into the points
Generally, the input symbols of being either letters or on the elliptic curve. She chooses a point P, which is a
digits. i.e., and is the set of strings formed out of Sometimes generator of the elliptic curve. By using ASCII characters of
we refer strings as languages also. We say that a string x is upper case letter into the points on the elliptic curve.
accepted by a DFA if the set of languages accepted by a DFA Let A  {1P,2P,3P................255P}
‘M’ is denoted by L (M). In a DFA, there will be only one B  {set of all ASCII characters}
transition out of each state on the same input symbol. The Alice defines one to one correspondence f : A  B by
nondeterministic finite automation (NDFA) is also a
mathematical model where are as in DFA except is a f (n p) = x n , where n=1,2………255 and
transition function. {x1 , x 2 , x3 ,...........x 255 } are the ASCII characters.
In NDFA there may be Moore machine is a sixtuple Step 8: To create 3 3 matrix with entries are the points
M  (Q, ,  , ,  , q 0 ) where Q, ,  , q 0 are as before and  is on the elliptic curve.
a output function and  is the set of output symbols. In a  a1 a 2 a3   a10 a11 a12 
   
More machine the output depend on the transition [15]. m1   a 4 a5 a6  m2   a13 a14 a15 
Transition table, as well as a transition diagram can also a a a  a 
 7 8 9  16 a17 a18 
represent Moore machine. In this paper, consider Moore
and so on more mi obtained depending upon the length of
machine, which calculates residue mod 4 [20] [22].
the message.
Step 9: Alice selects m, where‘s’ is the x-coordinate of
C. The ElGamal Cryptosystem
‘m’ and the binary value‘s’ is secret key.
Two communicating parties ‘A’ and ‘B’ initially agree Step 10: Alice define Moore machine with input is secret
upon the Elliptic curve E p ( x, y ) and p is sufficiently large key. Then she defines Fibonacci Q p n  matrix where p=2 and
prime number and (x,y) is the point on the Elliptic curve. For n  output  1, then Q p reduces to classical Q-matrix.
secure communication over insecure channels both A and B  Fn 1 Fn 0 
 
Q2   Fn Fn 1 0 , n  0,1,2.......... .
fix a point C(x1,y1). A initially selects the private key ‘KA’ n
and generates the public key PA  K A  C. Next ‘B’ selects
 0 0 1 
the private key KB and generates the public key 

14
Journal of Applied Computer Science & Mathematics, no. 20 (9) /2015, Suceava

Step 11: Compute  Fn 1  Fn 0 


q j 1  q j  ( fibonacci recurrence matrix ) n , where, Q  n  1  
n 
 Fn 1 Fn 1 0 .
(1) 
2
where n = output of qj+1+1.  0 0 1 
The resultant sets of points are
Step 12: Bob applies the reverse process and by using the
R  {r1 ( x1 , y1 ), r2 ( x2 , y 2 ), r3 ( x3 , y3 )...........ri ( xi , yi )} conversion from given ASCII characters of upper case letters,
where i  1,2,3..... he can recover the message.
Step 12: Compute Ci  ri  l  m.
III. EXAMPLE
Step13: Now Alice sends the encrypted message (kG, C i)
to Bob.
Alice wants to send the message to Bob using elliptic curve
ElGamal encryption by using adjacency matrix. Alice
B. Decryption
chooses the elliptic curve y 2  x 3  4 over the field z 271 .
To recover the plain text ri from Ci Bob should do
Then the points on the elliptic curve are
following:
E={0,(1,57),(1,214),(2,2),(2,269),(5,11),(5,260),(6,36),(6,
Step 1: First Bob selects the Alice public key A = aG.
235),(7,135),(7,136),…..………..(264, 174), (269,114),
Step 2: Compute bA = b (aG) = m.
(269,157)}.
Step 3: Now Bob computes the inverse element of b (aG)
The number of points on the elliptic curve is 271 and the
is – b (aG).
prime number is 271. Therefore each point is a generator of
Step 4: Add –b(aG)to the second part of the message:
an elliptic curve E [18] [19][20][21][22].
ri  kbG  abG  abG = ri  kbG Choose the point G = (68,136) on the elliptic curve. Alice
Step 5: Multiply the Bob’s own private key ‘b’with the selects a private key ‘a’ = 6, and generates the public key
first part of the message kG, we get: kbG. A = ‘aG’ = 6(68,136) = (85, 199) and Bob selects a private
Step 6: Now Bob computes the inverse element of kbG is – key ‘b’ = 8, and generates the public key B = ‘bG’ =
kbG. 8(68,136) = (122 , 259).
Step7: Bob adds -kbG to the second part of the
message: ri  kbG  kbG  ri . A. Encryption
Step 8: After decryption, the obtained points are stored in
3  3 matrix. Step 1: Alice chooses a random integer k = 4, and keeps it
secret.
 q1 q 2 q3  Step 2: Compute kG = 4(68,136) = (250, 189).
 
S1   q 4 q5 q 6 ,............... Step 3: Alice using the Bob’s public key
q q q  B = bG = (122, 259).
 7 8 9
Step 4: Compute kB = k (bG) = 4 (122, 259) = (132,248).
Step 9: Bob selects m, where ‘s’ is the x-coordinate of m Step 5: Compute aB = a (bG) = 6 (122, 259) = (215,157) =
which is the secret key and the binary value‘s’ is input key. m.
Step 10: Bob chooses Moore machine with input is secret Step 6: Alice wants to send the message qi to Bob.
key ie‘s’. Then he defines Fibonacci Q p n  matrix where
Step 7: Alice wants to convert the message into the points
p=2 and n  output  1, then Q p reduces to classical Q- on the elliptic curve. She chooses a point P = (172,240)
which is the generator of the elliptic curve. By using ASCII
matrix.
characters, into the points on the elliptic curve.
 Fn 1 Fn 0
A  65(172,240)  (64,246),
  n  0,1,2.......... .
Q2   Fn
n
Fn 1 0 ,
 0 T  84(172,240)  (126,260),
 0 1 
T  84(172,240)  (126,260),
Step 11: Now Bob multiplies qi with private key (inverse
A  65(172,240)  (64,246),
of Fibonacci recurrence matrix):
C  67(172,240)  (179,51),
 a1 a 2 a3 
n   K  75(172,240)  (15,98),
S1  Q2   a 4 a5 a6 , I  73(172,240)  (183 , 38),
a a a 
 7 8 9 N  78(172,240)  (69,18),
 a10 a11 a12  G  71(172,240)  (54,268).
n  
S 2  Q2   a13 a14 a15 ,................
Then the points are
a a18 
 16 a17

15
Computer Science Section

T  {(64,246),(126,260),(126,260),(64,246),(179,51),  (64,246) (126,260) (126,260) 


 
(15,98),(183,38),(69,18),(54,268)} m1   (64,246) (179,51) (15,98) 
Step 8: To create 3 3 matrix with entries are the points  (183,38) (54,268) 
 (69,18)
on the elliptic curve. Step 9: Alice selects m  ( 215,157 ), where s  215 and
the binary value of 215 is 11010111, which is input key.

TABLE 1
S. I/P Previous Preset O/P n= Secure key Cipher text
No. State State O/P+1 = ( Fib. recurence Matrix ) n

1 1 q0 q1 1 2
 5 8 0  (140,260) (73,226) (126,260) 
   
 8 13 0   (262,139) (108,10) (15,98) 
0 0 1  (109,244) (161,31) (54,268) 
   
2 1 q1 q3 3 4
 89 144 0   (140,260) (73,226) (126,260) 
   
144 233 0   (262,139) (108,10) (15,98) 
 0  (109,244) (161,31) (54,268) 
 0 1   
3 0 q3 q2 2 3
 21 34 0   (221,210) (5,260) (126,260) 
   
 34 55 0   (126,260) (6,36) (15,98) 
0  (51,226) (229,51) (54,268) 
 0 1   
4 1 q2 q1 1 2
5 8 0  (64,25) (119,211) (126,260) 
   
8 13 0   (55,178) (56,2) (15,98) 
0  (43,10) (65,141) (54,268) 
 0 1   
5 0 q1 q2 2 3
 21 34 0   (153,151) (88,101) (126,260) 
   
 34 55 0   (54,3) (209,240) (15,98) 
0  (157,268) (213,2) (54,268) 
 0 1  
6 1 q2 q1 1 2
5 8 0  (134,51) (28,57) (126,260) 
   
8 13 0   ( 71, 27 ) (182 ,258) (15,98) 
0  (107,173) (256,259) (54,268) 
 0 1   
7 1 q1 q3 3 4
 89 144 0   (163,71) (17,64) (126,260) 
   
144 233 0   (98,238) (157,3) (15,98) 
 0  (15,109) (93,5) (54,268) 
 0 1   
8 1 q3 q3 3 4  89 144 0   (150,222) (235,228) (126,260) 
   
144 233 0   (85,72) (149,98) (15,98) 
 0 0 1   (173,23) (54,268) 
  (5,260)

Then the points are


R  {(150,222), (235,228), (126,260), (85,72), (149,98), C 3  (126,260)  (132,248)  (215,157)  (209,240),
(15,98), (173,23)(5 ,260), (54,268) }. C 4  (85,72)  (132,248)  (215,157)  (242,57),
C 5  (149,98)  (132,248)  (215,157)  (76,228),
Step 11: Compute
Ci  ri  l  m. C 6  (15,98)  (132,248)  (215,157)  (88,101),
.
C 7  (173,23)  (132,248)  (215,157)  (163,71),
C1  (150,222)  (132,248)  (215,157)  (269,114),
C 2  (235,228)  (132,248)  (215,157)  (91,244), C8  (5,260)  (132,248)  (215,157)  (31,178),

16
Journal of Applied Computer Science & Mathematics, no. 20 (9) /2015, Suceava

C 9  (54,268)  (132,248)  (215,157)  (213,269), [7] An introduction to the theory of elliptic curves by Joseph
H.Silverman brown University and NTRU
Step12: Now Alice sends the encrypted message Cryptosystems2006.
consisting of pair of points [8] Vorobyov NN. Fibonacci numbers. Moscow: Nauka; 1978 [in
Russian].
{(250 , 189), (269,114) ), ((250 , 189) , (91,244) ), [9] Hoggat VE. Fibonacci and Lucas numbers. Palo Alto, CA:
Houghton- Mifflin; 1969.
((250 , 189) , (209,240) ), ((250 , 189) , (242,57), [10] S. Fibonacci and Lucas numbers and the golden section.
((250 , 189) , (76,228), ((250 , 189) , (88,101)), Theory and applications Ellis Horwood limited; 1989.
[11] Stakhov AP. Introduction into algorithmic measurement
((250 , 189) , (163,71), ((250 , 189) , (31,178)), theory. Moscow: Soviet Radio; 1977 [in Russian].
((250 , 189) , (213,269)} [12] A.P. Stakhov, “The ‘‘golden’’ matrices and a newkind of
cryptography”, Chaos, Solutions and Fractals 32 (2007)
to Bob. pp1138–1146.
[13] Stakhov AP. A generalization of the Fibonacci Q-matrix. Rep
B. Decryption Natl Acad Sci Ukraine1999 (9):46 9.9(9)46-49.
[14] K.R.Sudha, A. Chandra Sekhar, Prasad Reddy P VG D
Bob applies the reverse process and recovers the message “Cryptography Protection of Digital Signals using Some
Recurrence Relations” International Journal of Computer
“LIKE”. Science andNetwork Security,Vol.7 No.5, May 2007.
[15] Adesh K.Pandey reprint 2009, “An introduction to automata
IV. CONCLUSIONS theory and formal languages S.K.Karana & sons. New Delhi.
[16] Johan E.Hopcroft, Rajeev Motwin, Jeffrey D.Uiman.
In the proposed work, the plain text is converted to points “Introduction to automata theory, language, and computation”
on the elliptic curve by one to one correspondent and ASCII Vanstone 3 rd impression, 2007 CRC press, Dorling
characters. The secret key has generated using matrix Kindersley (India) Pvt.Ltd.
[17] T.ElGamal,“A public-key cryptosystem and a signature
obtained from the Fibonacci sequence. The encryption
scheme based on discrete logarithms ” IEEE Transactions on
process uses the finite state machines and the key generation Information Theory, onInformation Theory, 469-472, 1985.
process uses the ELGamal encryption taking security, [18] P.A.Jyotirmie, B.Ravi Kumar, A.Chandra Sekhar,S.Uma Devi
confidentiality and authenticity into consideration “A one to one Correspondence inelliptic curve cryptography”
InternationalJournal of Mathematical archive-4(3), 2013:300-
REFERENCES 304.
[19] http://www.certicom.com/index.php/ecc-tutorial.
[1] N.Koblitz. Elliptic curve Cryptosystems. Mathematics of [20] B.Ravi Kumar, A. Chandra Sekhar, G.Appala Naidu “An
computation, 48, 203-209, 1987. ElGamal Encryption Scheme of Adjacency Matrix and
[2] A textbook of Guide to elliptic curve cryptography by Darrel Finite Machines” COMPUSOFT, An international Journal of
Hancott Vanstone 1965. advanced computer technology, Volume 4, Issue 3, March
[3] N. Koblitz. Hyper Elliptic Cryptosystem. International Journal 2015, pages 1548-1554.
of Cryptography, 1,139-150,1989. [21] B.Ravi Kumar, A. Chandra Sekhar, G.Appala Naidu “A
[4] A Course in Number Theory and Cryptography. By Neal Novel ElGamal Encryption Scheme of Elliptic Curve
Koblitz, 1994. Cryptography” International Journal of Computer Trends and
[5] V. Miller. Uses of Elliptic Curves in Cryptography. In Technology, Volume 20, Number 2, Feb 2015, pages 70-73.
Advances in Cryptology (CRYPTO-1985). [22] B.Ravi Kumar, A. Chandra Sekhar, G.Appala Naidu “An
[6] A textbook of Cryptography and Network Security by William Elgamal Encryption of Finite State Machines and points on
Stallings, 2011. the Elliptic Curve” Journal of theoretical Physics &
Cryptography, Volume 9, July 2015, pages 1-5.

B.Ravi Kumar is presently working as Assistant Professor in the Department of Engineering Mathematics. He is pursuing his PhD
in number theory and Cryptography under the guidance of A.Chandra Sekhar.

A.Chandra Sekhar received his PhD degree in number theory from JNT University and M.Sc., degree with specialization in
algebraic number theory from Andhra University. He secured the prestigious K.NAGABUSHANAM memorial award in M.Sc., for
obtaining University first rank. He did his MPhil from Andhra University in 2000. He was with Gayatri Degree College during 1991 to
1995 and later joined GITAM Engineering College in 1995. Presently he is working as Professor & BOS Chairman of the Department
of Engineering College, Visakhapatnam, INDIA.

G.Appala Naidu is Professor Department Mathematics, College of science & Technology, Andhra University, Visakhapatnam,
INDIA. He works in the areas of fixed-point theory and number theory and Cryptography. He published papers in reputed journals of
national and international.

17

You might also like