0% found this document useful (0 votes)
26 views

Implementation and Analysis of Various Public Key Algorithms

The document discusses implementing and analyzing various public key cryptographic algorithms like RSA, modified RSA, and Elliptic Curve Cryptography (ECC). It reviews related work on implementing RSA and ECC. The paper then proposes to implement RSA, modified RSA, and ECC to compare their encryption and decryption speeds on different processor configurations.

Uploaded by

chala
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Implementation and Analysis of Various Public Key Algorithms

The document discusses implementing and analyzing various public key cryptographic algorithms like RSA, modified RSA, and Elliptic Curve Cryptography (ECC). It reviews related work on implementing RSA and ECC. The paper then proposes to implement RSA, modified RSA, and ECC to compare their encryption and decryption speeds on different processor configurations.

Uploaded by

chala
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/341735789

Implementation and Analysis of Various Public Key Cryptographic Algorithms

Article  in  International Journal of Pure and Applied Mathematics · April 2018

CITATIONS READS

0 125

3 authors:

Ida Seraphim Fancy Chelladurai


SRM Institute of Science and Technology SRM Institute of Science and Technology
20 PUBLICATIONS   22 CITATIONS    12 PUBLICATIONS   66 CITATIONS   

SEE PROFILE SEE PROFILE

Sowmiya Balasubramanian
SRM Institute of Science and Technology
14 PUBLICATIONS   3 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Intrusion detection system View project

IMPLEMENTATION AND ANALYSIS OF VARIOUS PUBLIC KEY CRYPTOGRAPHIC ALGORITHMS View project

All content following this page was uploaded by Fancy Chelladurai on 16 July 2020.

The user has requested enhancement of the downloaded file.


International Journal of Pure and Applied Mathematics
Volume 119 No. 12 2018, 2021-2032
ISSN: 1314-3395 (on-line version)
url: http://www.ijpam.eu
Special Issue
ijpam.eu

IMPLEMENTATION AND ANALYSIS OF VARIOUS PUBLIC KEY


CRYPTOGRAPHIC ALGORITHMS

Fancy.C1, Ida Serphim.B2, Sowmiya.B3


1,2,3Assistant Professor, SRM Institute of Science and Technology
[email protected]

Abstract

Public key cryptography plays a major role in the security field. It makes use
of two keys, public key, a private key, and a few operations are performed with the
keys to determine the cipher value and then to recover the original value
respectively. Popular public key cryptographic algorithms include RSA (Rivest-
Shamir-Adleman) and ECC(Elliptic curve cryptography). Elliptic Curve
Cryptography has recently gained a lot of interest and attention in security
industry. Hence it is proposed to implement the concept of ECC, which is compared
with a modified version of RSA algorithm to find out which one is better promise
for a faster and a more secured method of encryption and decryption. Since to meet
the security requirements, the power of processor is also a notable issue.

Keywords: Asymmetric key encryption, RSA, Elliptic Curve Cryptography.

1. Introduction

Public-key cryptography [1] includes the usage of two keys which are termed
as private and public. Public key is exposed to everyone. It is useful for encrypting
messages, and verifying signatures. On the other hand, the private key is chosen
by the recipient themselves, which is not shared. It is useful for decrypting
messages, and creating signatures. The concept can also be called as asymmetric
key cryptography because those who encrypt messages or verify signatures cannot
decrypt messages or create signatures. Public key schemes can be used for
maintaining secrecy or authentication, or both. Public key applications can be
classified under three categories: i)Providing Secrecy through encryption and
decryption, ii) Achieving authentication with the help of digital signatures, iii)
Exchange of session keys.

In this paper it is proposed to utilize the features of Public key cryptographic


algorithms and to expose the possibility of achieving secrecy by trying encryption of
sample value and decryption of the cipher equivalent of the same value. The

2021
International Journal of Pure and Applied Mathematics Special Issue

related implementation in the field of public key cryptography is analyzed and


summarized in the next section. After the implementation of the three algorithms,
RSA, modified RSA and ECC algorithm the time taken for performing encryption
and decryption is analyzed. The three algorithms are then executed in different
PCs with varying processor configurations such as Intel i3, i5 and i7. The results
are depicted in a graph.

Nomenclatures

Cm/C Cipher Text

d Decryption key

e Encryption key

G Base point

nA, nB Private keys in ECC

p Field value

PR Private key

PU Public key

PA, PB Public keys in ECC

Pm/M Plain Text/ Original Message

ø(n) Euler's Totient function

Abbreviations

AES Advanced Encryption Standard

DDR Double Data Rate

ECC Elliptic Curve Cryptography

2022
International Journal of Pure and Applied Mathematics Special Issue

ECD Elliptic Curve Diffie-Hellman key Exchange


HE

RSA Rivest-Shamir-Adleman

SHA Secure Hash Algorithm

TLS Transport Layer Security

The following Figs.1 shows the overview of Public key cryptographic algorithm.

Fig. 1. Public key cryptography

2. Literature Review

Several authors have worked on RSA and Elliptic Curve Cryptography


implementation. We have made study on several papers. We are giving a brief
summary of them in the following sections.

2.1.RSA Algorithm

The author Xin Zhou[1], implemented the RSA public key algorithm. He coded the
algorithm using .NET platform and C++ class libraries. They stated the
mathematical complexities of the classical RSA algorithm and explained how it is
important in security of various domains.

The author Yunfei Li[2], focussed on improving the computational speed of RSA
decryption. He reduced the modules and private exponents by the modular
exponentiation. He utilized a new variant that includes both Multiprime RSA and
RSA-S2 system. The variant can also be easily implemented in parallel. Thus it got
higher processing speed.

2023
International Journal of Pure and Applied Mathematics Special Issue

2.2. Modified RSA Algorithm

The author Thangavel[3] focussed on enhancing the classical RSA algorithm. The
proposed algorithm used included two more prime numbers in the conventional
RSA algorithm, so that the complexity of the existing algorithm is increased.
Hence, the algorithm is stronger to break. The public value n is calculated by
multiplying two of the selected prime numbers, but the key value (N) for
Encryption and Decryption are calculated by multiplying all the selected four
prime numbers. Hence, only with the knowledge of n, it is not possible to find the
keys used for Encryption and Decryption. Thus the system becomes more secure.

In paper [4], the author Aswathi implanted Montgomery multiplier algorithm in


both RSA and ECC algorithms. On analysis, she noticed that the area used and the
delay values are reduced considerably. She used Edward curve transformations
that provided efficient computation of the point addition and point doubling
operations in ECC. The simulation of the modified Montgomery algorithm showed
significant improvement in speed and power.

The author Balram[5], proposed a new algorithm based on Jordan-Totient function.


It makes use of dual modulus based double encryption and decryption. Dual
modulus decomposes the values into several factors, thus improving the
complexity. Then Jordan function increases the size of the private key. These two
unique features of the proposed algorithm helped to improve the security of RSA
algorithm. The proposed algorithm working is slower than classical RSA algorithm,
but it is more secure.

2.3. Elliptic Curve Cryptography(ECC) Algorithm

The author Dolendro Singh[6] explains clearly about the implementation of Elliptic
Curve Cryptography algorithm. The conversion of plain text to elliptic curve
coordinates is also explained with example. Initially, the corresponding ASCII
values for the plain text alphabets is identified. Then they are partitioned into
groups according to a given group size. It is converted into big integer values with
base 65536. The single pair is sent as input to the encryption algorithm and the
corresponding cipher is achieved.

In the paper[7], the plain text characters are mapped to coordinate points by the
non-singular matrix method. They processed the coordinate points using the
ElGamal scheme and the cipher values are obtained. When the receiver gets the
cipher value, a product of that value with the inverse of non-singular matrix is

2024
International Journal of Pure and Applied Mathematics Special Issue

calculated. Then the ElGamal decryption technique is used to retrieve the plain
text. The modified ECC algorithm improved security and message confidentiality.

The author Moncef Amara[8], focussed on the competence of ECC on network


security. The scalar multiplication k. P is identified to be the powerful parts of
ECC, where k is a secret positive value and P is any coordinate on the elliptic
curve. On increasing the key length, the Elliptic Curve Discrete Logarithm
Problem(ECDLP) also becomes harder. Because, the ECDLP is also called the
inverse of ECC.

The paper[9] on Elliptic curve cryptography in Java written by Leonidas described


the way of implementing the ECC algorithms by digital signatures, encryption-
decryption and key exchange. The author explained the possible hints for Java
implementation. He gave a clear idea of the elliptic curves, point addition and
other properties. He also listed various methods which are present in Java's Big
Integer object to support the ECC implementation. Thus the paper gave a clear
idea for implementing ECDH, ECDSA etc.

The author V Gayoso Martinez[10] clearly explained about the java implementation
issues for elliptic curve cryptography. He concluded that the cryptographic
capabilities are installed in J2SE, J2EE platforms as well as in Java cards. He
added that it is also needed in Java cards to include some more methods for
performing ECDSA and ECDH operations. High quality java implementations are
provided by Bouncy Castle, IAIK and can be used as open source in non-
commercial applications.

The author Reza Azarderakhsh[11] introduced a new technique for point addition of
ECC. It makes use of affine coordinates that works efficiently by utilizing less
number of registers. He proposed exceptionally tiny processor framework for the
working of point multiplication operation. He named it as crypto-processor. It is
then evaluated on three parameters. The parameters are area, performance and
power consumption. Based on the results it is confirmed, the proposed work is
more suitable for tremendously- controlled and protected location.

3. Implementation

All the three algorithms namely RSA, modified RSA and Elliptic curve
cryptography are implemented in C++ programming language. The
experimentation is performed in various systems whose basic configurations are
given in the below table:

2025
International Journal of Pure and Applied Mathematics Special Issue

Table 1. Testing processor's Specifications

Processor Type Clock Speed Cache Cores/Threads Memory Type


Intel i7 3.6 GHz 8 MB 4/8 DDR4-2400, DDR3L-1600
Intel i5 2.4 GHz 6 MB 4/4 DDR4-2400, DDR3L-1600
Intel i3 3.40 GHz 4 MB 2/4 DDR4-2400, DDR3L-1600

3.1. RSA Algorithm[1]

The RSA algorithm works as follows.

Key Generation:

• Large primes values (p,q) are selected at random.


• Compute the value n=p.q , and its totient function ø(n),
∅(𝑛) = (𝑝 − 1) ∗ (𝑞 − 1) (1)
• For encryption, select any random key which satisfies the condition,
1<e<ø(n) and gcd(e,ø(n))=1
• The private key(d) for decryption is obtained by solving the equation, e.d=1
mod ø(n) and 0≤d≤n
• The public key for encryption [To be shared]: PU={e,n}
• The private key for decryption [It is kept covert]: PR={d,n}
Encryption:

• Consider the sender's message M


• Public key of recipient PU={e,n} is obtained
• Sender computes:
𝐶 = 𝑀𝑒 𝑚𝑜𝑑 𝑛 , where 0≤M<n
(2)
Decryption:

• Receiver uses their private key PR={d,n}


• Obtains message by computing:
𝑀 = 𝐶 𝑑 𝑚𝑜𝑑 𝑛 (3)

3.2. Modified RSA Algorithm[12]

The modified RSA works on the following series of algorithm.

Key Generation:

• Two large primes(p,q) and two more random numbers(x,y) are selected.
• Obtain z1 and z2 by computing
𝑧1 = 𝑥 ∗ 𝑦 ∗ 𝑎 ∗ 𝑏 (4)

2026
International Journal of Pure and Applied Mathematics Special Issue

𝑧2 = 𝑥 ∗ 𝑦 (5)
• Compute
∅(𝑧) = (𝑥 − 1) ∗ (𝑦 − 1) ∗ (𝑎 − 1) ∗ (𝑏 − 1) (6)
• Select the public encryption key by the condition, 1<e<ø(z) and gcd(e,ø(z))=1
• Key to perform decryption (d) is calculated by, e.d=1 mod ø(z) and 0≤d≤n
• The public key is shared: PU={e,z1}
• The private key is kept undisclosed: PR={d,z2}
Encryption:

• Let M be the sender's message.


• Cipher text is obtained by the formula:
𝐶 = 𝑀𝑒 𝑚𝑜𝑑 𝑧1 (7)
Decryption:

• Receiver uses their private key PR={d,n} and retrieves the plain text by
computing:
𝑀 = 𝐶 𝑑 𝑚𝑜𝑑 𝑧2 (8)

3.3. Elliptic Curve Cryptography(ECC) Algorithm[13]

The elliptic curves cryptography basically revolves around elliptic curves which are
defined over a finite fields. The Weierstrass equation of an elliptic curve is given
by,

y 2 = x 3 + ax + b where 4a3 + 27b2 ≠ 0[13] (9)

Fig 2: Elliptic curve

The following are the sample sites which uses the ECC :

Amazon.com (TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 128 bit


keys,TLS 1.2)

Facebook.com(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 128 bit


keys,TLS 1.2)

Irctc.co.in(TLS_RSA_WITH_AES_256_CBC_SHA, 256 bit keys ,TLS 1.2)

2027
International Journal of Pure and Applied Mathematics Special Issue

One of the most popular elliptic curve in use today and also provided by recognized
standard bodies is X25519:Eg: whatsapp

In 1999, NIST recommended the following elliptic curves. Particularly, FIPS 186-3
has 10 suggested finite fields:
There are two fields possible.i)Prime field and ii)Binary field.

• Prime fields is available for certain varying sizes 192, 224, 256, 384, and
521[14] bits. An elliptic curve is possible for every Prime field.
• Binary fields for 163, 233, 283, 409, and 571. An elliptic curve and a koblitz
curve can be selected for

Thus NIST[15] recommends a total of 5 prime curves and 10 binary curves. The
curves were believed to provide best possible defense and performance
competence.
Encryption:

• Key sharing can be similar to Diffie-Hellman algorithm.

• An appropriate curve Ep(a,b) is selected based on need.

– The base point G=(x1,y1) is selected with order nG=O

• Private keys are selected by Users A and B respectively, nA<n, nB<n

• Next public keys PA and PB are calculated:

𝑃𝐴 = 𝑛𝐴 ∗ 𝐺 , 𝑃𝐵 = 𝑛𝐵 ∗ 𝐺 (10)
• compute shared key:

𝐾 = 𝑛𝐴 ∗ 𝑃𝐵 , 𝐾 = 𝑛𝐵 ∗ 𝑃𝐴 (11)

(12)
• Encryption of Plain Text Pm is done by the following formula:
𝐶𝑚 = {𝑘 ∗ 𝐺, 𝑃𝑚 + (𝑘 ∗ 𝑃𝑏 )}, 𝑘 𝑟𝑎𝑛𝑑𝑜𝑚 (13)

• Original message is obtained by decrypting Cm:


𝑃𝑚 + (𝑘 ∗ 𝑃𝑏 ) − 𝑛 ∗ 𝐵 ∗ (𝑘 ∗ 𝐺) = 𝑃𝑚 (14)

4. Results

The working of the three algorithms are analyzed based on the execution time
obtained on machines with different hardware specifications namely fourth
generation Intel i7, i5 and i3 processors. The results of the implementation are
explained below.

2028
International Journal of Pure and Applied Mathematics Special Issue

4.1. Cipher text only Attack

The meaning of Cipher Consider, the attacker tries to break the data knowing the
cipher text and the encryption algorithm been used. If the encryption is done by
elliptic curve cryptography, it is confirmed by research that attacker cannot reveal
the plain text easily.

4.2. Known Plaintext Attack

Consider, the cryptanalyst knows the cipher text, few plaintext and its
corresponding cipher text, and the algorithm used along with the secret key. Since
the private value k is a randomly generated number in ECC implementation, the
plaintext cannot be found out.

Hence the possible ways to attack RSA are:

– It is impossible to find the correct key by trial and error method even
if the size is known.

– The hackers will try to calculate ø(n), that is also difficult.

– Checking the decryption algorithm execution time.

– Knowing the properties of RSA, the hackers attack the cipher value.

4.3. Time Complexity

The time taken to execute the RSA, modified RSA and ECC algorithm is
experimented at various machines and the following comparison graphs are
obtained.

2029
International Journal of Pure and Applied Mathematics Special Issue

Time Complexity of Algorithms


0.14
Algorithm Execution Time
0.12
0.1
0.08
ecc
0.06
modified rsa
0.04
0.02 rsa

0
1 2 3
Processor Type

Fig 3: Time complexity of various algorithms (1,2,3 refers to i3, i5, i7 processors
respectively)

5. Conclusion and Future Work

ECC is little more complex and requires a greater understanding of both


mathematics and a variety of elliptic curves, as the weak curves can be easily
compromised and data could be easily breached. From the above obtained results,
it is very clear that the ECC algorithm takes a comparatively large amount of time
than the RSA and modified RSA algorithms. Though, the RSA takes lesser
computational time, by research it is proven attacks are possible. Hence we suggest
the modified RSA algorithm can be considered when both security and speed are of
primary importance, as it is easy to implement and provides a great difficulty to
break. However, if the data security is of utmost importance, ECC should be used
along with certain strong curves. So it would be almost next to impossible to brute
force as the points over which the information exchange takes place would be
extremely hard to determine.

6. References

[1] Xin Zhou and Xiaofei Tang, Research and Implementation of RSA Algorithm for
Encryption and Decryption, IEEE, 2011.
[2] Yunfei Li; Qing Liu and Tong Li, Design and Implementation of an Improved
RSA Algorithm, , IEEE, 2010.

[3] M. Thangavel; P. Varalakshmi; Mukund Murrali and K. Nithya, An Enhanced


and Secured RSA Key Generation Scheme (ESRKGS), Elsevier, 2014.
[4] Aswathi Thomasa and Ebin M. Manuel, Embedment Of Montgomery Algorithm
On Elliptic Curve Cryptography Over RSA Public Key Cryptography, Elsevier,
2016.

2030
International Journal of Pure and Applied Mathematics Special Issue

[5] Balram Swamia; Ravindar Singh and Sanjay Choudhary, Dual Modulus RSA
based on Jordan-Totient function, Elsevier, 2015.

[6] Laiphrakpam Dolendro Singh and Khumanthem Manglem Singh,


Implementation of Text Encryption using Elliptic Curve Cryptography, , Elsevier,
Eleventh International Multi-Conference on Information Processing-(IMCIP),
2015.

[7] Balamurugan.R etal, Enhancing Security in Text Messages Using Matrix based
Mapping and ElGamal Method in Elliptic Curve Cryptography, IEEE, 2014.

[8] Moncef Amara and Amar Siad, Elliptic Curve Cryptography And Its
Applications, IEEE, 2011.

[9] Leonidas Deligiannidis, Elliptic Curve Cryptography in Java, IEEE, 2015.

[10] V Gayoso Martinez; C. Sanchez Avila and J. Espinosa Garcia, L. Hernd'ndez


Encinas, Elliptic Curve Cryptography: Java Implementation Issues, IEEE, 2005.

[11] Reza Azarderakhsh; Kimmo U. Järvinen and Mehran Mozaffari - Kermani,


Efficient Algorithm and Architecture for Elliptic Curve Cryptography for
Extremely Constrained Secure Applications, , IEEE Transactions On Circuits And
Systems—I: Regular Papers, Vol. 61, No. 4, April, 2014.

[12] Dhananjay Pugila; Harsh Chitrala; Salpesh Lunawat and P.M.Durai Raj
Vincent, An Efficient Encrpytion Algorithm Based On Public Key Cryptography,
International Journal of Engineering and Technology (IJET), 2013.

[13] N. Mazzocca; L. Romano; A. Cilardo and L. Coppolino, Elliptic Curve


Cryptography Engineering, IEEE, 2006.

[14] NIST, Recommendation for Key Management—Part 1: general, Special


Publication 800-57, August 2005.

[15] Brown, M.; Hankerson, D.; Lopez, J and Menezes, A. "Software


Implementation of the NIST Elliptic Curves Over Prime Fields". Topics in
Cryptology – CT-RSA 2001. Lecture Notes in Computer Science. 2020: 250–
265. doi:10.1007/3-540-45353-9_19. ISBN 978-3-540-41898-6, 2001.

2031
2032

View publication stats

You might also like