You are on page 1of 5

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

net/publication/271557093

An algorithm to enhance security in RSA

Conference Paper · July 2013


DOI: 10.1109/ICCCNT.2013.6726517

CITATIONS READS
15 116

4 authors, including:

Durai Raj Vincent P M


VIT University
42 PUBLICATIONS   63 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Durai Raj Vincent P M on 12 December 2018.

The user has requested enhancement of the downloaded file.


IEEE - 31661 1

An Algorithm to Enhance Security in RSA


Rohit Minni, Kaushal Sultania, Saurabh Mishra, Prof Durai Raj Vincent PM, VIT University

[5], [6]
 . To prevent this from happening, in our algorithm we try
Abstract— In symmetric key cryptography the sender as well as to eliminate the distribution of 'n' in both the keys. Instead, we
the receiver possess a common key. Asymmetric key cryptography apply a mathematical transformation over 'n' to get a
involves generation of two distinct keys which are used for replacement for 'n' using which one cannot trace back to the
encryption and decryption correspondingly. The sender converts
the original message to cipher text using the public key while the
factors of 'n' that are 'p' and 'q'. This improves the security of
receiver can decipher this using his private key. This is also called the RSA algorithm [7] by a greater extent.
Public Key Cryptography. For every public key there can exist
only one private key that can decipher the encrypted text. Security II. RSA CRYPTOSYSTEM
of RSA Algorithm can be compromised using mathematical
attack, by guessing the factors of a large number. It may also be
RSA is an asymmetric key cryptosystem relies on the
compromised if one can guess the private key. In accordance with assumption that it is difficult to find the factors of large integers.
the mathematical attack, we propose a secure algorithm in this It involves distribution of public and private key to sender and
paper. In this algorithm, we try to eliminate the distribution of n receiver to encrypt and decrypt the message respectively. RSA
which is the large number whose factors if found compromises the is a three step process that involves Key generation, Message
RSA algorithm. We also present a comparative analysis of the encryption and message decryption. The algorithm is as
proposed algorithm with the RSA algorithm.
follows:
Index Terms— RSA, Security, Encryption, Complexity, Public
key, Private key A. Key generation
i. Generate two distinct random prime numbers p and q.
I. INTRODUCTION ii. Calculate n = p x q. Its length is the key length which
is usually expressed in bits.
The asymmetric key cryptosystem [1], [2] involves the use of two iii. Calculate φ(n) = (p - 1) x (q - 1) where φ is the Euler's
distinct but related keys namely, the public key and the private totient function.
key. Plaintext is converted to cipher text using the public key. iv. Calculate e based on the following conditions:
This process is known as encryption which is performed by the  1 < e < φ(n)
sender. On the other hand, deciphering of the cipher text is
 GCD(e, φ(n)) = 1 i.e., e and φ(n) are co-
performed by making use of the private key. This process is
prime.
known as decryption and is performed by the receiver. Only the
 e must have a short bit-length and small
receiver possesses the knowledge of the private key. In order to
Hamming weight [2].
maintain the confidentiality of the private key, the public key is
v. Find d which satisfies the relation (e x d) Mod (n) = 1
disclosed to the public. The public key is used for authentication
to ensure that the message is coming from the intended sender.
Now, the Public Key comprises e and n i.e., (e, n). The
Public key cryptosystem also ensures confidentiality. Only the
Private Key comprises of d and n i.e., (d, n).
receiver’s private key can decipher the cipher text originating
from the sender. Communication of messages can be done in a
secure manner since knowledge of the public key is not B. Message Encryption
sufficient to decrypt the cipher text. The sender uses the following method to encipher the
Due to the above advantages, in our proposed algorithm we message M:
follow the asymmetric key cryptography technique. In this • Cipher text C = Me Mod (n) where C is the cypher text
scheme, there is a mathematical relation between the two keys. generated after encryption.
Owing to this fact, it is likely that the system may be
compromised if someone discovers the relation between the
keys and successfully derives the private key. In RSA [3], [4] both C. Message Decryption
the keys comprise of the large number ‘n’, which can be The receiver uses the following method to decipher the
factored into 'p' and 'q'. The public key is known to all. It is easy cipher text C:
to derive the private key if someone can guess the factors of 'n' • The original message M = Cd Mod(n).

4th ICCCNT 2013


July 4-6, 2013, Tiruchengode, India
IEEE - 31661 2

 GCD( X, N) = 1.
If A < B then consider X such that:
D. RSA Example  N–B<X<N
 GCD (X, N) = 1.
Consider the following example:
i. Generation of the keys vi. Find k2 such that k1 x k2 Mod (X) = 1
Say, p = 5 and q = 7
n=pxq Now, the Public Key consists of (k1, X) and the Private Key
=35 is (k2, X).
φ(n) = (p-1) x (q-1)
=4x6 B. Message Encryption
=24 The sender enciphers the plain text message PT using the
GCD (e, 24) = 1 and 1 < e < 35 method below.
e=5 • Encipher the message PT using public key (k1, X) by CT
= PTk1 Mod(X) where CT is the cypher text generated after
e x d Mod (φ(n)) = 1
encryption.
5 x d Mod (24) = 1
d=5
Public Key = (5, 35) C. Message Decryption
Private Key = (5, 35) The receiver deciphers the cipher text as follows:
• Decipher the cipher text CT by using the private key (k2,
ii. Message Encryption X) by PT = √(CTk2 Mod(X)).
Consider the message 3.
C = 35 Mod(35)
= 243 Mod(35) D. Modified RSA Example
= 33
Consider the following example:
iii. Message Decryption i. Generation of the keys
M = 335 Mod(35) Say, A = 5 and B = 7
= 39135393 Mod(35) N=5x7
=3 =35.
φ(N) = (A-1) x (B-1)
=4x6
III. OUR SCHEME (MODIFIED RSA) =24.
The modified algorithm introduces 2 more steps to eliminate GCD (k1, φ(N)) = 1 and √N < k1 < N.
n from the key so that one cannot trace back to the factors p and GCD (k1, 24) = 1 and √35 < k1 < 35
q by mathematical factorization of n. So, RSA can be made k1 = 5
more secure to some extent [8], [9]. This algorithm also contains
three parts: Key generation inside which n is eliminated, Now, we compute X (To replace N)
Message encryption and Message decryption. Since B is greater,
N – B < X < N and GCD(X, N) = 1.
A. Key generation 28 < X < 35 and GCD (X, 35) = 1.
i. Generate two distinct random prime numbers A and B. X = 29
ii. Calculate N = A x B. Its length is the key length which
is usually expressed in bits. k1 x k2 Mod (X) = 1
iii. Calculate φ(N) = (A - 1) x (B - 1) where φ is the Euler's 5 x k2 Mod (29) = 1
totient function. k2 = 6
iv. Calculate k1 based on the following conditions [10]: Public Key = (k1, N) = (5, 29)
 √N < k1 < φ(N) Private Key = (k2, N) = (6, 29)
 GCD (k1, φ(N)) = 1 i.e., k1 and φ(N) are co-
prime. ii. Message Encryption
 k1 must have a short bit-length and small Consider the message 3.
Hamming weight. CT = PTk1 Mod(X)
v. Compute X (To replace N) = 35 Mod (29)
If A > B then consider X such that: = 243 Mod (29)
= 11
 N–A<X<N

4th ICCCNT 2013


July 4-6, 2013, Tiruchengode, India
IEEE - 31661 3

Consider the message 2.


iii. Message Decryption (Note that 24 < 23)
PT = √ CTk2 Mod (X) CT = PTk1 Mod(X)
= √ 116 Mod (29) = 25 Mod (23)
= √ 1771561 Mod (29) = 32 Mod (23)
=√9 = 9.
=3
iii. Message Decryption
As we can see, in this example, we have successfully PT = 4√ CTk2 Mod (X)
eliminated N by replacing it with X. This makes our algorithm = 4√ 914 Mod (23)
secure as one cannot trace back to A and B using X. = 4√ 22876792454961 Mod (23)
In RSA the constraint on the message is that the message = 4√ 16
should be less than the value of n. In our algorithm, the = 2.
constraint is that the message should be less than the square root Due to the constraint, say if the message was 3 for the above
of N. This is due to the fact that when we take the Mod of a case, since 34 >23, while decrypting the message we need to
number, the answer obtained is always less than the modulus take the mod with a higher multiple of X1 i.e., 23. In this case it
value i.e., the number with which the Mod is taken. is 92.
Further we can extend this algorithm by applying another Message Encryption
layer of encryption. This can be performed by repeating step 5 Consider the message 3.
and finding k2 after the calculation of Xi. CT = PTk1 Mod(X)
But this time we need to take the fourth root of the answer = 35 Mod (23)
obtained instead of square root. This can be applied even more = 243 Mod (23)
number of times as long as the values taken meet all the = 13.
constraints.
Let’s consider another example by applying a second layer Message Decryption
of encryption for n to replace X and obtain X1. PT = 4√ CTk2 Mod(X)
= 4√ 1314 Mod (92)
i. Generation of the keys = 4√ 3937376385699289 Mod (92)
Say, A = 5 and B = 7 = 4√ 81
N=AxB = 3.
=35
φ(N) = (A-1) x (B-1)
=4x6 IV. COMPARISON AND ANALYSIS OF RSA WITH MODIFIED RSA
=24
GCD (k1, φ(N)) = 1 and √N < k1 < N. The analysis of RSA with the modified RSA algorithm is
GCD (k1, 24) = 1 and √35 < k1 < 35. tabulated and shown with the help of graphs. The graphs below
k1 = 5 show the comparison of time, in Ticks (1 millisecond equals
10,000 Ticks), between RSA and our Modified RSA algorithm
Now, we compute X (To replace N). with a single layer of encryption i.e., using X as the modulus.
Since B is greater, As the algorithm focuses on the security aspect of RSA, so time
N – B < X < N and GCD (X, N) = 1. complexity increases to some extent.
28 < X < 35 and GCD (X, 35) = 1.
X = 29. The table in Fig. 1 below contains sample input and time
complexity for RSA algorithm.
Since B is greater,
X – B < X1 < X and GCD (X1, X) = 1. p q Message Key Encryption Total
22 < X1 < 29 and GCD (X1, 29) = 1. generation Decryption time Time
X1 = 23. time (in (in Ticks) (in Ticks)
Ticks)
5 7 2 9237 15816 25053
To compute k2 (private key component) 7 11 3 11037 17373 28410
k1 x k2 Mod (X1) = 1. 11 13 5 8888 14839 23727
Fig. 1. Time Complexity of RSA Algorithm.
5 x k2 Mod (23) = 1.
k2 = 14.
The table in Fig. 2 below contains the same sample input as
Public Key = (k1, X1) = (5, 23)
above with time complexity for Modified RSA algorithm.
Private Key = (k2, X1) = (14, 23)

ii. Message Encryption

4th ICCCNT 2013


July 4-6, 2013, Tiruchengode, India
IEEE - 31661 4

A B Message
Key Encryption Total
generation Decryption Time Time
time (in (in Ticks) (in Ticks)
Ticks)
5 7 2 14383 21980 36363
7 11 3 11837 22217 34054
11 13 5 20606 42581 63187
Fig. 2. Time Complexity of Modified RSA Algorithm.

As we can see with increased security only a little increase of


time complexity is seen.

Fig. 5. Total time complexity comparison between RSA and Modified RSA.

V. CONCLUSION

Thus, in this paper we present a modified algorithm for RSA


with enhanced security. The security feature here is the
elimination of n from the original RSA algorithm. Instead, the
Fig. 3. Key generation time comparison between RSA and Modified RSA.
newly generated replacement for n can be used in both the keys.
The RSA algorithm is prone to mathematical factorization
The key generation process has more variation in time due to
attacks. The algorithm that we presented in this paper
extra step of encrytion or elimination of N.
eliminates this issue making the algorithm more secure with a
slight increase of time complexity.

VI. REFERENCES
[1] W. Diffie and M. E. Hellman, New directions in cryptography, IEEE
Trans. Inform. Theory, Nov. 1976,22: 644-654.
[2] Atul Kahate, “Cryptography and Network Security”, ISBN-10:0-
07-064823-9, Tata McGraw-Hill Publishing Company Limited,
India, Second Edition, pages 38-62,152-165,205-240.
[3] R. Rivest, A. Shamir, L. Adleman, "A Method for Obtaining Digital
for Signatures and Public-Key Cryptosystems", Communications of
the ACM, vol. 21 (2), pp. 120-126, 1978.
[4] William Stallings, “Cryptography and Network Security”, ISBN 81-
7758-011-6, Pearson Education, Third Edition, pages 42-62,121-
144,253-297.
[5] Sattar J Aboud, “An Efficient Method for Attack RSA Scheme”,
978-1-4244-4457-1/09/$25.00 IEEE, 2009.
Fig. 4. Encryption and decryption time comparison between RSA and Modified
RSA. [6] Thomsan D. Bruce D. Arjen L. and Mark M., “On the Factoring of
RSA-120”, (169), pp. 166-174, 1994.
The encryption and decryption of message has the time [7] Ravi Shankar Dhakar, Amit Kumar Gupta, Prashant Sharma,
“Modified RSA Encryption Algorithm (MREA)”, Second
difference due to change in the decryption algorithm. The latter International Conference on Advanced Computing &
one being more complex takes more time. Communication Technologies, 2012.
[8] B R Ambedkar, Ashwani Gupta, Pratiksha Gautam, SS Bedi, “An
Efficient Method to Factorize the RSA Public Key Encryption”,
International Conference on Communication Systems and Network
Technologies, 2011.
[9] Hung-Min Sun, Mu-En Wu, Wei-Chi Ting, and M. Jason Hinek,
“Dual RSA and Its Security Analysis”, IEEE Transactions on
Information Theory, Vol. 53, No. 8, Aug. 2007.
[10] Sattar J Aboud, Mohammad A AL-Fayoumi, Mustafa Al-Fayoumi
and Haidar S Jabbar, “An Efficient RSA Public Key Encryption
Scheme", Fifth International Conference on Information
Technology: New Generations, 2008.

4th ICCCNT 2013


July 4-6, 2013, Tiruchengode, India
View publication stats

You might also like