^{1}

^{*}

^{1}

^{1}

^{2}

Cryptography is the study that provides security service. It concerns with confidentiality, integrity, and authentication. Public key cryptography provides an enormous revolution in the field of the cryptosystem. It uses two different keys where keys are related in such a way that, the public key can use to encrypt the message and private key can be used to decrypt the message. This paper proposed an enhanced and modified approach of RSA cryptosystem based on “n” distinct prime number. This existence of “n” prime number increases the difficulty of the factoring of the variable “
*N*” which increases the complexity of the algorithm. In this approach, two different public key and private key generated from the large factor of the variable “
*N*” and perform a double encryption-decryption operation which affords more security. Experiment on a set of a random number provided that the key generation time, analysis of variable “
*N*”, encryption and decryption will take a long time compared to traditional RSA. Thus, this approach is more efficient, highly secured and not easily breakable.

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 proposes prevention of modifications. Availability means data being available to authorized persons when needed the data. Confidentiality, integrity, and availability are three security goals [

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 [

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 decrypts 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 algorithm [

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 numbers, 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 numbers which give an opportunity to select a big encryption exponent from large product “N” to enhance the security. Numerous prime numbers and big encryption 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 modification is described in Section 4 and 5. Section 6 represents implementation and result. Conclusion and future work are discussed in Section 7.

This section involves the work done by various researchers in the field of RSA cryptosystem. The discussion is based on the Modification of RSA algorithm through the recent past. M. Thangavel et al. [

A Modified RSA introduced in the paper [_{p}” and “d” unknown. Security is ensured by using dual modulus based double encryption and decryption with the use of Jordan function in the paper [^{1/4}. Rui’s paper [^{th} power residue theory and RSA algorithm.

This research focuses on to modify RSA algorithm and enhance the security. The schema is based on “n” prime numbers instead of two prime numbers with double encryption and decryption process. Multiple prime numbers increase the factoring time to get the private key. The encryption and decryption process is considered a pair of a random number and their modular multiplicative inverse to increase the security of RSA to a great extent.

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 simulation purpose [

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

Compute Euler phi value of N

Φ ( N ) ← ( p − 1 ) ∗ ( q − 1 )

Find a random variable e, satisfying 1 < e < Φ ( N ) and gcd ( e , Φ ( N ) ) = 1

Compute a random number d, such that d ∗ e ≡ 1 mod Φ ( N )

RSA ENCRYPTION AND DECRYPTION

The encryption is done with the help of public key exponent and the decryption is done with the help of private key exponent.

RSA_Encryption()

Input:

Plain text message, M (

Public key exponent: {e, N}

Output:

Cipher text, X

Procedure:

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 )

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 [

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 numbers. 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 exponent 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

Compute Euler phi value of N

Φ ( N ) ← ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 )

Find a random variable e, satisfying 1 < e < Φ ( N ) and gcd ( e , Φ ( N ) ) = 1

Find another random variable f, satisfying 1 < f < Φ ( N ) and gcd ( f , Φ ( N ) ) = 1

Compute a random number d, such that d ∗ e ≡ 1 mod Φ ( N )

Compute another random number g, such that f ∗ g ≡ 1 mod Φ ( N )

MRSA ENCRYPTION AND DECRYPTION

The encryption is done with the help of public key exponent and the decryption is done with the help of private key exponent. The encryption and decryption are not only related to “N” which consists of four large prime numbers making it difficult to factor but also four random components “e”, “f”, “d”, “g” are involved to make it even more difficult to break the system.

MRSA_Encryption()

Input:

Plain text message, M (

Public key exponent: {e, f, N}

Output:

Cipher text, X

Procedure:

X ← ( M e mod N ) f mod N

MRSA_Decryption()

Input:

Ciphertext message, X

Private key exponent: {d, g, N}

Output:

Decrypted plain text, Y

Procedure:

Y ← ( X g mod N ) d mod N

Let us discuss an example problem using the proposed Modified RSA (MRSA) algorithm.

MRSA example

・ Take four distinct prime numbers w = 53 , x = 41 , y = 43 , z = 47 .

・ 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

・ Find a random number e, satisfying 1 < e < Φ ( N ) and gcd ( e , Φ ( N ) ) = 1 .

e = 41

・ Compute a random number d, such that, d ∗ e ≡ 1 mod Φ ( N ) .

d = 294041

・ Find a random number f, satisfying 1 < f < Φ ( N ) and gcd ( f , Φ ( N ) ) = 1 .

f = 97

・ Compute a random number g, such that, g ∗ f ≡ 1 mod Φ ( N ) .

g = 455713

・ Input message, M = 12321

・ Encryption, X = ( M e mod N ) f mod N = 1081588

・ Decryption, Y = ( X g mod N ) d mod N = 12321

The algorithm is implemented in JAVA 8 running on an Intel (R) Core (TM) i5-3230M CPU @ 2.60 GHz machine and 4.00 GB RAM. The algorithm (RSA and MRSA) have different important parameter affecting its level of security and speed. Increasing the modulus length invoke complexity of decomposing it into factor. Thus, also increase the length of the private key and hence difficult to detect the key. The RSA and Modified RSA (MRSA) parameter changes depend on time and others remain fixed to study the relative emphasis.

The proposed Modified RSA (MRSA) algorithm is examined on varying bit sizes of input.

Performance of original RSA algorithm by Rivest, Shamir, and Adleman [

Comparing the above tables, it can be concluded that the time of key generation of Modified RSA (MRSA) is higher than that of RSA. The higher key generation time of Modified RSA (MRSA) can be seen as an advantage by the fact that the time to break the system is high because of the extra complexity added.

Length of w, x (in bits) | Analyzing time for RSA algorithm | ||
---|---|---|---|

Key generation time (in ms) | Encryption time (in ms) | Decryption time (in ms) | |

100 | 76.63 | 0.16 | 0.25 |

128 | 90.46 | 0.17 | 0.28 |

256 | 94.96 | 0.35 | 0.96 |

512 | 177.47 | 0.56 | 5.2 |

1024 | 570.90 | 1.69 | 26.18 |

2048 | 4201.47 | 3.32 | 130.83 |

4096 | 54,368 | 11.17 | 1116.24 |

Length of w, x, and z (in bits) | Analyzing time for Modified RSA (MRSA) algorithm | ||
---|---|---|---|

Key generation time (in ms) | Encryption time (in ms) | Decryption time (in ms) | |

100 | 244 | 0.28 | 1.59 |

128 | 252.33 | 0.66 | 2.89 |

256 | 257.8 | 1.46 | 14.26 |

512 | 386.8 | 3.00 | 87.94 |

1024 | 1268.6 | 7.79 | 446.32 |

2048 | 7098.6 | 21.90 | 2472.70 |

4096 | 161,913 | 56.87 | 19,983.37 |

For example, input primes of bit length 2048, encryption time in Modified RSA (MRSA) is 21.9 ms and RSA takes 3.32 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.

Comparison between complexity analysis of RSA algorithm and Modified RSA (MRSA) algorithm is discussing in below.

Complexity for Random selected two prime numbers:

・ The complexity of MILLER-RABIN gives the above-mentioned complexities for finding a prime number is O ( s ∗ ( log 2 p ) 2 ∗ ln p ) [

・ Similarly, the complexity of the second number is O ( s ∗ ( log 2 q ) 2 ∗ ln q ) .

Complexity for calculation of N:

・ The complexity of computation of N is O ( log 2 p ∗ log 2 q ) .

Complexity of Computing Euler phi value of N

・ By MODULAR-EXPONENTIATION, the complexity for the second part is (N) −1. The complexity of compute Euler phi value of N is [

Complexity for random variables e:

・ The complexity of finding the random variable e is O ( log 2 ( p − 1 ) ∗ ( q − 1 ) + gcd ( e , ( p − 1 ) ∗ ( q − 1 ) ) ) , as it is known that e and (N) are coprime to each other so gcd ( e , ( p − 1 ) ∗ ( q − 1 ) ) = 1 , and so complexity is O ( ( log 2 ( log 2 p − 1 ) ∗ ( log 2 q − 1 ) ) 2 + 1 ) .

The complexity will increase based on the number of the prime numbers conceded for the proposed algorithm.

Complexity for Random Selected prime numbers:

・ Complexities for finding first prime number is O ( s ∗ ( log 2 w ) 4 ∗ ln w ) .

・ Similarly, the complexity of the second number is O ( s ∗ ( log 2 x ) 4 ∗ ln x ) .

・ The complexity of the third number is O ( s ∗ ( log 2 y ) 4 ∗ ln y ) .

・ Similarly, the complexity of the fourth number is O ( s ∗ ( log 2 z ) 4 ∗ ln z ) .

Complexity for calculation of N:

・ The complexity of computation of n is O ( log 2 w ∗ log 2 x ∗ log 2 y ∗ log 2 z ) .

Complexity of Computing Euler phi value of N

・ Complexity of compute Euler phi value of N is: O ( ( log 2 ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 ) ) 4 ∗ ( ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 ) − 1 ) ) .

Complexity for random variables e and f:

・ The complexity of finding the random variable e is O ( log 2 ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 ) + gcd ( e , ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 ) ) ) , as it is known that e and (N) are coprime to each other so gcd ( e , ( w − 1 ) ∗ ( x − 1 ) ∗ ( y − 1 ) ∗ ( z − 1 ) ) = 1 , andso complexity is O ( ( log 2 ( log 2 w − 1 ) ∗ ( log 2 x − 1 ) ∗ ( log 2 y − 1 ) ∗ ( log 2 z − 1 ) ) 4 + 1 ) .

・ Similarly, Complexity of finding the random variable f is O ( ( log 2 ( log 2 w − 1 ) ∗ ( log 2 x − 1 ) ∗ ( log 2 y − 1 ) ∗ ( log 2 z − 1 ) ) 4 + 1 ) .

Comparing the above complexity it depicts that Modified RSA (MRSA) is more complex than RSA algorithm. The complexity will increase depending on the number of primes considered for the algorithm.

A wide variety of attacks are possible on RSA which includes brute force attack, timing attack etc. [

This introduces the requirement of factoring the product “N”. Elliptic Curve factorization Method (ECM) [

Ω system = Ω w , x , y , z + Ω bruteforce _{ }

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) algorithm more secure than the original RSA algorithm.

The security of RSA depends on factoring the large number. This research works based on “n” distinct prime numbers instead of two prime numbers and it increases the attacking time to find the large prime number. The key generation of Modified RSA (MRSA) depends on large factor value “N” thus it needs higher key generation time. The higher the key generation time increases the time need to break the system which makes the system stronger. The double encryption and decryption procedure of Modified RSA (MRSA) is simple compared to the RSA algorithm thus it is not overhead on the system. Encryption and decryption also take more time than RSA algorithm. The accomplishment of the algorithm is measured with reference to time taken for brute force attack. Limitation of this proposed schema is it will not work properly unless “n” distinct prime numbers are considered. To enhance the security of RSA algorithm by adding some extra factors in encryption and decryption process can be a good future work.

Islam, M.A., Islam, Md.A., Islam, N. and Shabnam, B. (2018) A Modified and Secured RSA Public Key Cryptosystem Based on “n” Prime Numbers. Journal of Computer and Communications, 6, 78-90. https://doi.org/10.4236/jcc.2018.63006