RSA For N Intergers, 123
RSA For N Intergers, 123
http://www.scirp.org/journal/jcc
ISSN Online: 2327-5227
ISSN Print: 2327-5219
Muhammad Ariful Islam1, Md. Ashraful Islam1, Nazrul Islam1*, Boishakhi Shabnam2
1
Department of Information and Communication Technology (ICT), Mawlana Bhashani Science and Technology University,
Tangail, Bangladesh
2
Uttara University, Dhaka, Bangladesh
Keywords
RSA Algorithm, Encryption, Decryption, Cryptosystem, Security, Public Key,
Private Key
1. Introduction
Security refers to the process of keeping information confidential by protecting
it from unauthorized users. According to security goal, confidentiality means to
keep a data secured. It must be hidden from unauthorized access. Integrity pro-
poses prevention of modifications. Availability means data being available to
*Corresponding author in the paper.
authorized persons when needed the data. Confidentiality, integrity, and availa-
bility are three security goals [1]. Security goal can achieve using cryptography
which is a widely used method around the world.
Cryptography is a Greek word which means secret writing. It ensures secure
communication and prevents the public from reading private messages. The
cryptographic system is usually characterized by three main dimensions. They
are, the operations involved in the transformation of plain text to cipher text, the
number of secret keys used and the method of processing the plaintext [2].
Based on that property, cryptography is classified into two broad classifications.
One of them is symmetric key and another is asymmetric key. Symmetric key
cryptosystem uses the same key for encrypting and decrypting a message.
Asymmetric key cryptosystem uses two different keys, the Public key for en-
crypting the message and private key for decrypting the message.
The Public key cryptosystem is based on two related keys, one is a public key
and another is a private key. The sender generates a public key and encrypts the
message. Sender shares one key which is called a private key and receiver de-
crypts the message using that key. The encrypted message cannot be decrypted
by unwanted people, who know the public key only. In public key cryptography,
the private key is always link with mathematically to the public key. It is always
possible to attack public key system to generate a private key. This attack can be
opposed by creating problem to generate a private key from the public key. Some
public key algorithms designed such that deriving the private key from public key
need to factorize large number by the attacker. RSA is known for such type of al-
gorithm [3]. It takes two large prime number “p” and “q” and multiplies them to
get a big number “N”. The idea behind RSA is some mathematical operation
easier to do but the inverse is very difficult without any additional information.
This research presents a new modification of RSA algorithm which is Modified
RSA (MRSA) based on “n” distinct prime numbers with double encryption and
decryption process. The weakness of RSA algorithm is the use of two prime num-
bers, small encryption exponent and use the same key for encryption and signing.
This schema is based on “n” distinct prime numbers instead of two prime num-
bers which give an opportunity to select a big encryption exponent from large
product “N” to enhance the security. Numerous prime numbers and big encryp-
tion exponent increase the factoring time comparing to RSA algorithm. The
double encryption and decryption process make the algorithm stronger than RSA.
The rest of the paper is structured as follow. In Section 2, the proposed
scheme represents some related work. In Section 3, there is a discussion about
research methodology. The RSA algorithm and proposed model for RSA mod-
ification is described in Section 4 and 5. Section 6 represents implementation
and result. Conclusion and future work are discussed in Section 7.
2. Related Works
This section involves the work done by various researchers in the field of RSA
3. Research Methodology
A modify RSA algorithm is proposed using “n” distinct prime numbers. A pair of
a random number and their modular multiplicative inverse is used to increase the
security of the RSA algorithm. Key generation, encryption and decryption time of
Modified RSA (MRSA) algorithm to break the system is significantly higher. An
observation has been performed using JAVA programming language. Modified
RSA (MRSA) is implemented using JAVA Big Integer library functions for simu-
lation purpose [17]. It is possible for the user to enter a prime number or set the
bit length of prime numbers to generate automatically using the secure random
function. Big Integer library provides various functions such as modular arith-
metic, GCD calculation, primality testing, prime generation, bit manipulation
and some other operations. Various bit length prime numbers are generated by
using the prime generator function of Java Big Integer library to calculate key
generation, encryption and decryption time. The Modified RSA (MRSA) model
performs a comparison for key generation, encryption and decryption time be-
tween RSA and Modified RSA (MRSA) based on these calculated times for spe-
cific bit length.
4. RSA Cryptosystem
RSA is a public key algorithm based on the assumption that some mathematical
operation easier to do in one direction but the inverse is very difficult. The idea
behind RSA is that it is easier to multiply but difficult to factor the large number.
Multiplication can be computed in polynomial time whereas factoring time can
grow exponentially proportional to the size of the number.
RSA KEY GENERATION
RSA_key_gen()
Input:
Two prime numbers p and q
Output:
Public key exponent: {e, N}
Private Key exponent: {d, N}
Procedure:
N ← p∗q
(
X ← M e mod N )
RSA_Decryption()
Input:
Ciphertext message, X
Private key exponent: {d, N}
Output:
Decrypted plain text, Y
Procedure:
(
Y ← X d mod N )
5. Proposed Model
The proposed Modified RSA (MRSA) scheme focuses on mitigating the major
issues of RSA system. Most cases the major issue is, it is breakable because of
easily computation of keys based on “N”. Since it is the only product of two
prime numbers, “N” can be easily traceable [18]. Once the value of “N” is ob-
tained, a hacker can find the keys and break the system. The major modifications
which make the system efficient and secure are discussed in the below section.
MRSA KEY GENERATION
The proposed model involves “n” distinct prime numbers. In this paper, all
calculation and performance analysis is performed using four large prime num-
bers. The public and private key exponent consists of three components. “N” is
the product of four prime numbers “w”, “x”, “y”, and “z”. The public key expo-
nent consists of three components (e, f, N) where “e” and “f” are randomly taken.
It further adds more complexity along with the factoring of “N”. Since only the
value of “N” is kept as a public and private component, an attacker with the
knowledge of “N” cannot determine the value of four prime numbers which are
the basis for finding the value of “N” and subsequently “e” and “f”. The private
key exponent consists of three components (d, g, N). For security purpose, the
bit length of all four-chosen prime is of the same length as in case of traditional
RSA. The algorithm is presented below.
MRSA_key_gen()
Input:
Four prime numbers w, x, y, and z
Output:
Public key exponent: {e, f, N}
Private Key exponent: {d, g, N}
Procedure:
N ← w∗ x ∗ y ∗ z
( )
f
X ← M e mod N mod N
MRSA_Decryption()
Input:
Ciphertext message, X
Private key exponent: {d, g, N}
Output:
Decrypted plain text, Y
Procedure:
( )
d
Y ← X g mod N mod N
• Compute N = w ∗ x ∗ y ∗ z .
• N = 53 ∗ 41 ∗ 43 ∗ 47 = 4391633 .
• Compute Euler phi value of N
Φ(N ) = ( w − 1) ∗ ( x − 1) ∗ ( y − 1) ∗ ( z − 1)
Φ ( N )= ( 53 − 1) ∗ ( 41 − 1) ∗ ( 43 − 1) ∗ ( 47 − 1) = 4018560
For example, input primes of bit length 2048, encryption time in Modified RSA
(MRSA) is 21.9 ms and RSA takes 3.32 ms.
Figure 3 shows the decryption time comparison between RSA and proposed
Modified RSA (MRSA) scheme. It demonstrates the almost identical amount of
time consumed by RSA and Modified RSA (MRSA) for the lower bit length of
prime numbers. With the increase of bit length, the difference between curves
elevates rapidly. For example, input primes of bit length 4096, decryption time
in Modified RSA (MRSA) is 19,983.37 ms and original RSA takes 1116.24 ms
From the above graphs, it can be easily seen that encryption and decryption
times are higher than RSA. The increase in time is adaptable because it increases
the security to a great extent in the proposed Modified RSA (MRSA) method.
timing attack etc. [20]. The time needed to break an RSA system is equivalent to
the time needed for finding the prime numbers used.
This introduces the requirement of factoring the product “N”. Elliptic Curve
factorization Method (ECM) [18] and General Number Field Sieves (GNFS) [21]
is used commonly for factoring “N”. These are the fastest known factoring me-
thods. Even though an attacker can factorize “N” by using those methods but it
is still not sufficient enough in the computation of two arbitrary component “e”
and “f”. Above factorization technique can be used to find “w”, “x”, “y”, “z” but
“e” and “f” can only be found by an exhaustive brute force attack. In other
words,
Ωsystem = Ω w, x , y , z + Ω brute force
Here,
Ωsystem = Time needed to break the system
Ωw,x,y,z = Time needed to find w, x, y, z using GNFS or ECM
Ωbrute force = Time needed for brute force attack for finding e, f
The important observation is, Modified RSA (MRSA) involves four primes
“w”, “x”, “y”, “z” and two random numbers “e”, “f” for encryption whereas the
original RSA involves only two prime numbers “w”, “x” and only one random
number “e” for encryption. So, the time needed to break Modified RSA (MRSA)
algorithm will be greater than the time needed to break the original RSA at least
by a factor of 2. And this will make the proposed Modified RSA (MRSA) algo-
rithm more secure than the original RSA algorithm.
References
[1] Forouzan, B.A. (2010) Cryptography and Network Security. Tata McGraw Hill
Education Private Limited, New York.
[2] Stallings, W. (2013) Cryptography and Network Security: Principles and Practice. 6
Edition, Pearson, Boston.
[3] Rivest, R.L., Shamir, A. and Adleman, L. (1978) A Method for Obtaining Digital
Signatures and Public-key Cryptosystems. Communications of the ACM, 21,
120-126. https://doi.org/10.1145/359340.359342
[4] Thangavel, M., Varalakshmi, P., Murrali, M. and Nithya, K. (2015) An Enhanced
and Secured RSA Key Generation Scheme (ESRKGS). Journal of Information Secu-
rity and Applications, 20, 3-10. https://doi.org/10.1016/j.jisa.2014.10.004
[5] Dhakar, R.S., Gupta, A.K. and Sharma, P. (2012) Modified RSA Encryption Algo-
rithm (MREA). 2012 Second International Conference on Advanced Computing
Communication Technologies, Rohtak, 7-8 January 2012, 426-429.
https://doi.org/10.1109/ACCT.2012.74
[6] Sun, H.M., Wu, M.E., Ting, W.C. and Hinek, M.J. (2007) Dual RSA and Its Security
Analysis. IEEE Transactions on Information Theory, 53, 2922-2933.
https://doi.org/10.1109/TIT.2007.901248
[7] Segar, T.C. and Vijayaragavan, R. (2013) Pell’s RSA Key Generation and Its Security
Analysis. 2013 Fourth International Conference on Computing, Communications
and Networking Technologies (ICCCNT), Tiruchengode, 4-6 July 2013, 1-5.
https://doi.org/10.1109/ICCCNT.2013.6726659
[8] Wiener, M.J. (1990) Cryptanalysis of Short RSA Secret Exponents. IEEE Transac-
tions on Information Theory, 36, 553-558. https://doi.org/10.1109/18.54902
[9] Al-Hamami, A.H. and Aldariseh, I.A. (2012) Enhanced Method for RSA Cryptosys-
tem Algorithm. 2012 International Conference on Advanced Computer Science
Applications and Technologies (ACSAT), Kuala Lumpur, 26-28 November 2012,
402-408. https://doi.org/10.1109/ACSAT.2012.102
[10] Li, Y., Liu, Q. and Li, T. (2010) Design and Implementation of an Improved RSA
Algorithm. 2010 International Conference on E-Health Networking Digital Ecosys-
tems and Technologies (EDT), Shenzhen, 17-18 April 2010, 1, 390-393.
[11] Amalarethinam, I.G. and Leena, H.M. (2017) Enhanced RSA Algorithm with Vary-
ing Key Sizes for Data Security in Cloud. 2017 World Congress on Computing and
Communication Technologies (WCCCT), Tiruchirappalli, 2-4 February 2017,
172-175. https://doi.org/10.1109/WCCCT.2016.50
[12] Chhabra, A. and Mathur, S. (2011) Modified RSA Algorithm: A Secure Approach.
2011 International Conference on Computational Intelligence and Communication
Networks, Gwalior, 7-9 October 2011, 545-548.
https://doi.org/10.1109/CICN.2011.117
[13] Swami, B., Singh, R. and Choudhary, S. (2016) Dual Modulus RSA Based on Jor-
dan-totient Function. Procedia Technology, 24, 1581-1586.
https://doi.org/10.1016/j.protcy.2016.05.143
[14] Patidar, R. and Bhartiya, R. (2013) Modified RSA Cryptosystem Based on Offline
Storage and Prime Number. 2013 IEEE International Conference on Computational
Intelligence and Computing Research, Enathi, 26-28 December 2013, 1-6.
https://doi.org/10.1109/ICCIC.2013.6724176
[15] Kong, F., Yu, J. and Wu, L. (2011) Security Analysis of an RSA Key Generation Al-
gorithm with a Large Private Key. ISC, 2011, 95-101.
[16] Rui, W., Ju, C. and Guangwen, D. (2011) A k-RSA Algorithm. 3rd International
Conference on Communication Software and Networks, Xi’an, 27-29 May 2011,
21-24. https://doi.org/10.1109/ICCSN.2011.6013537
[17] Wagner, N.R. (2003) The Laws of Cryptography with Java Code.
[18] Ali, H. and Al-Salami, M. (2004) Timing Attack Prospect for RSA Cryptanalysis