RSA-and-ElGamal-Algorithm
RSA-and-ElGamal-Algorithm
Abstract—RSA is an algorithm for public-key cryptography Speed is the main disadvantage of public-key cryptography,
and is considered as one of the great advances in the field of public because there is always a tradeoff between efficiency and
key cryptography. RSA security lies in the difficulty of factoring security[3]. Inventors of RSA suggest the prime number used to
large number into prime factors. The inventor of RSA Algorithm generate the keys have more than 100-digit length, but this may
suggests prime number that is used to generate the keys have more cause long computation time. But if we use small digit length for
than 100 digits’ length for security reasons. Elgamal algorithm the key size, this will lead to many security holes.
also is one of public key cryptography algorithm. The security of
this algorithm lies in the difficulty of calculating discrete An implementation and analysis of ElGamal and RSA
logarithm. In this paper, the author proposes key generation algorithm has been done in [6]. Based on that implementation
algorithm that is considered safe from the combination of the RSA and analysis, ElGamal algorithm is more secure as compared to
and Elgamal algorithm. Based on the experiment that has been RSA algorithm because it generates more complex cipher text
done, the computing time required for the proposed algorithm is and it was also slow because when we encrypt and decrypt it, it
relatively short, compared to the original RSA algorithm. generates more than one public keys.
Keywords—RSA; ElGamal; public key cryptography; In this paper, the author propose a key generation algorithm
combination; algorithm design made from combination of RSA and Elgamal Algorithm. This
algorithm uses 256 bit prime numbers, in order to make
computing time for encryption and decryption processes faster
I. INTRODUCTION than using 1024 bit of prime numbers on the original RSA
algorithm. Although the prime numbers that are used is in small
RSA is a popular algorithm in public key cryptography. It bit, but safety factors remain to be addressed by using a
was created by three researchers at the MIT (Massachusetts combination of RSA and Elgamal algorithm.
Institute of Technology) in 1976, namely Ron Rivest, Adi
Shamir, and Leonard Adleman. RSA algorithm security lies in
the difficulty of factoring large numbers into prime factors[1].
Factoring is done to obtain the private key. II. RSA ALGORITHM
RSA is a popular algorithm in public key crypthography.
While efficient algorithm for factoring large numbers into
This algorithm was created by three researchers from MIT
prime factors is undiscovered, RSA Algorithm security is still
(Massachusetts Institute of Technology) in 1976, namely: Ron
ensured. Inventors of this algorithm suggest the prime number
(R)ivest, Adi (S)Hamir, and Leonard (A)dleman. Its security lies
used to generate the keys have more than 100-digit length. Thus,
in the difficulty of factoring large numbers into prime factors[1].
the multiplication result of that prime value is larger than 200-
digit length. According to Rivest and friends, attempt to find a The following are properties used in RSA Algorithm:
factor of 200-digit number takes computing time for 4 billion
years[1]. Prime numbers which has more than 100 digits, that 1. and ݍ, prime number (private)
are considered safe for the RSA algorithm, will certainly take a 2. ݎൌ Ǥ ݍ (public)
longer computing time when compared to using prime numbers
that have relatively fewer digits. 3. ߶ሺݎሻ ൌ ሺ െ ͳሻሺ ݍെ ͳሻ (private)
Elgamal Algorithm is also one of public key cryptography 4. ܲ( ܭencryption key) (public)
algorithm. This algorithm was originally used for digital 5. ܵ( ܭdecryption key) (private)
signatures, but later was modified to be used for encryption and
decryption. The security of this algorithm lies in the difficulty of 6. ܺ (plaintext) (private)
calculating the discrete logarithm. Discrete logarithm problem 7. ܻ(ciphertext) (public)
is, if is a prime number and and is any integer, then find
such that[2]:
݃ ௫ ൌ ݕሺ݉݀ሻ
A. Key Pair Generation standard for signatures. On behalf of this software and its
The following are procedures to generate pair of key for problems with ElGamal discovered in late 2003[5].
encryption: The following are properties used in ElGamal Algorithm:
1. Choose two random prime number, and ݍ. 1. Prime number, (public)
2. Calculate ݎൌ Ǥ ݍ. It should be ݍ ് , because if ൌ 2. Random number, ݃ǡ ሺ݃ ൏ ሻ (public)
ݍ, then ݎൌ ଶ , and can be obtained from the square
root of ݎ. 3. Random number, ݔǡ ሺ ݔ൏ ሻ (private)
3. Calculate ߶ሺݎሻ ൌ ሺ െ ͳሻሺ ݍെ ͳሻ 4. Plaintext, ܯ (private)
4. Choose public key, ܲܭ, which is relatively prime with 5. Ciphertext, ܽ and ܾ (public)
߶ሺݎሻ.
5. Generate private key with this equation ܵܭǤ ܲ ܭൌ A. Key Pair Generation
ͳሺ݉߶݀ሺݎሻሻ. Note that this equation is equivalent
with ܵܭǤ ܲ ܭൌ ͳ ݉߶ሺݎሻ, so ܵ ܭcan be obtained The following are procedures to generate pair of key for
with: encryption:
C. Decryption
III. ELGAMAL ALGORITHM Decryption of ܽ and ܾ is done by using secret key,
Same with RSA Algorithm, ElGamal is also a public key ݔ, and plaintext ݉ is recovered by this equation:
cryptography algorithm. This algorithm was originally used for
݉ ൌ ܾȀܽ ௫ ݉݉݀
digital signature, but was later modified so it also can be used
for encryption and decryption. The strength of this algorithm lies Note that:
in the difficulty of calculating discrete logarithm[2]. To encrypt
and decrypt a message, a discrete power is executed. This ܽ ௫ ݃ ؠ௫ ሺ݉݀ሻ
operation is efficient to compute. An attacker that seeks to then:
decrypt an intercepted message may try to recover the private
key. To this end, a logarithm needs to be computed. No actual ܾ ݕ ݉ ݃ ௫ ݉
ؠ ؠ௫ ݉ ؠሺ݉݀ሻ
method exists for this. Under these circumstances, the ܽ௫ ܽ௫ ݃
encryption is secure[4].
So that, plaintext can be recovered from pair of ciphertext ܽ
Today, ElGamal algorithm is used in many cryptographic and ܾ.
products. The open-source software GnuPG uses ElGamal as
2016 8th International Conference on Information Technology and Electrical Engineering (ICITEE), Yogyakarta, Indonesia
7. ܻ(ciphertext) (public) Processes that was done in the early steps is the same as the
The proposed algorithm design use additional properties key generation process by using RSA Algorithm. First, generate
obtained from ElGamal Algorithm, which is as follows: prime numbers and ݍ. After that, calculate ݎൌ Ǥ ݍ. Then
calculate ߶ሺݎሻ ൌ ሺ െ ͳሻሺ ݍെ ͳሻ. Once the generation is done,
1. Prime number, ݈ܧ (public) generates random number, ܲܭ, the encryption key, where the
2016 8th International Conference on Information Technology and Electrical Engineering (ICITEE), Yogyakarta, Indonesia