Efficiency of 128-bit Encryption and Decryption Process in Elgamal Method Using Elliptic Curve Cryptography (ECC)

Cryptography is a growing science of data security. The integrity of a data is an important thing to keep the secrets contained in the data. In this research will be visualized the efficient quantities that use elliptic curves and do not use them. The Elgamal method is an asymmetric cryptographic algorithm whose complexity of processes. It is especially for digital signatures. This research will discuss about the use of ECC to optimize and streamline the Encryption and Decryption process in particular 128-bit Elgamal method. The hope is that by using elliptic curves the timing of the encryption and decryption process can run faster in the computation of Elgamal Method


Introduction
Cryptography is a plaintext encryption process to ciphertext and ciphertext decryption to plaintext [1]. In cryptography, the encryption process can be used to secure messages and maintain confidentiality in the communication process between the sender and the reci pient. Some functions of criteria such as maintaining data integrity, confidentiality, non-repudiation and authentication [2]. Cryptography can be used on technologies such as cloud computing, network, internet, digital device and online transaction [1], [3]. In the network world, cryptography can also be used for anti-phishing [4].
Cryptography of the elliptic curve includes a public key cryptography system that bases security on the mathematical problems of elliptic curves [5]. Unlike the discrete logarith m problem (DLP) and integer factorization problem (IFP), there is no known sub-optimal time algorithm for solving the mathematical problems of elliptic curve logarithm problem (ECDLP) [6]. A data security that form an application designed based on the science of cryptography would have to take into consideration the running processes with precise and meticulous corresponding algorithms, the accuracy of the data is decrypted without any parts missing, the time required in the process of encryption and decryption, as well as considering the use of processor time to do the whole computing in the process of encryption and decryption [7]- [9]. In response to these problems requires a study to analyze the process and stages of algorithm work in detail when the data or files that are secured to function properly, precise, fast and gated when implemented in a programming language by using algorithms cryptography to generate an application Which is in accordance with the analysis process and research objectives. [10] Cryptography is also used to reduce cybercrime numbers. One effort made to reduce the level of phishing is a combination of cryptography with the field of bio-informatic such as patterns of fingerprint. The Internet as one of the important factors in human life also has a great chance of being targeted by irresponsible parties. In this case, concrete efforts are needed to improve the security of digital data among which is using cryptography. The elements in cryptography are plaintext, ciphertext, cryptogsystem, key, encryption and decryption [11], [2], [1], [3]- [4], [12]- [13].
The cryptographic algorithm in this study is the Elliptic Curve algorithm to form the key and ElGamal algorithm for encryption and decryption of plaintext to follow the rules on the  [11]. ElGamal encryption algorithms apply at points of the elliptic curve so that it uses the rules of operation on the elliptic curve. In the process of the formation of a private key and a public key generated automatically using elliptic curve cryptography which will then be used in the ElGamal cryptographic encryption and decryption algorithms [14] , [10].

Related Works 2.1. Concept of Curve Eliptic Cryptography
ECC can optimize the encryption and decryption process of several methods in AES method cryptography [11] [15]. ECC can be used in some areas of network, hardware, and software. In this section of the discussion described in general how to implement the security of plaintext data using elliptic and elgamal curve algorithms [15]. There are several gradual processes as well as the development that streamlines operations to produce security that matches the theory of elliptic curves and the development of elgamal theory [7] , [16], [17].
The plaintext encoding process begins with the formation of a private key pair and a public key using elliptic curve cryptography theory by generating prime numbers, having a set of value pairs (x, y) satisfying the equation y2=x3+ax+b and selecting a point as a public key. And choose integer d as private key.The point chosen as the public key will be used for the plaintext encryption process using modified elgamal cryptography (using operating rules on elliptic curve theory) to produce 2 ciphertext values, C1 and C2. The value will be returned to plaintext using private key as well. [17] The ElGamal cryptographic generating algorithm with the elliptic curve returns the public key and private key consisting of an elliptic curve selected by Ep (a, b), so the first thing to do is to form an elliptical curve group. The ElGamal generator algorithm with general elliptic curve is as follows: a. Select the elliptic curve number E (a, b) in GF (p). b. Select α=(x1, y1) as the generating point on the elliptic curve group E (a, b). c. Select integer d with terms d> 1 and d <p -1. d. Select β=d.α (point multiplication using elliptic curve operating theory). e. Kpublic=(E (a, b), α, β) and Kprivate=d.
The following will explain in detail the process of forming an elliptical curve group to select the public key and its private key [18]. The first step in elgamal generator algorithm with elliptic curve is to select the elliptic curve number E (a, b) in GF (p). Select the prime number with the condition p> 3 for Fp, so the elliptic curve equation used is y2=x3+ax+b mod p with the condition of 4a3+27b2 ≠ 0. Suppose that is taken any prime number=19. Then the value of a and b is randomly generated for its coefficients so that the elliptic curve equation of GF (p) is formed by filling the values of a and b in the equation with values a and b between 1 and p -1. Suppose a=1 and b=1 so that the elliptic curve equation becomes: Y2=x3+x+1 (mod 19), 4a3+27b2 ≠ 0 (mod p), 4 .13+27.12 (mod 19)=31 (mod 19)=12 ≠ 0. If the process of checking discriminant 4a3+27b2 (mod p) is 0, then the random formation process of values of a, b and p must be repeated until it qualifies [19][20].

ECC Procedure Phase 1: Determining the main points of Elliptic Curve
Before proceeding with the second step in the ElGamal generator algorithm with the elliptic curve of choosing the point as the value of α, it will be explained first about how to determine the points on the elliptic curve [21], [18]. To determine the most important points of elliptic curve, it is necessary to identify elements of the elliptic group E19 over Fp, wi th Fp={0,1,2,3,4,5, 6,7,8,9,10,11,12,13,14,15,16,17,18}. But before determining E19, first look for quadratic residue modulo 19 (quadratic residue modulo) which is symbolised by QR19. [7], [17]  According to Table 1, the set of quadratic residues of modulus 19 is QR19={0, 1, 4, 9, 16, 6, 17, 11, 7, 5}. Then determine the elliptic group element E19 (1,1) which is the settlement of the equation y2=x3+x+1 (mod 19), for x ∈ F19 and y2 ∈ QR19. Here are the steps to find elements of elliptic curve groups or dots on the elliptic curve based of elliptic curve equations that have been formed: [23] a. Set x from 0 to p -1, for this matter means x={0, 1,. . ., 18}. b. Calculate the value of y2 based on the elliptic curve equation that has been formed, ie y2=x3+x+1 (mod 19). c. check for quadratic residue y2 to find out whether y2 has square root or not. Checks are true if the result of value y2 is the quadratic residual set value, and is false if it is not a quadratic residue. d. If y2 is a quadratic residue, then x above Fp is the point on the elliptic curve, with the point y being taken from the y2 value in Table 2.  ,7), (2,12), (5,6), (5,13), ( 7,16), (7,3), (9,6), (9,13), (10,17), (10,2), (13,11), (13,8), (14,17), (14,2), (15,16), (15,3), (16,16), (16,3), ∞}. The number of main points on the curve=20 points and plus the infinity point (∞) so that the number of elliptic curve points with the equation y2=x3+x+1 (mod 19) is 21 dots. Finding the elliptical group element in the above manner is less efficient because if the prime number chosen is large, it takes a repetition process as much as p times to determine the quadratic residual set of modulus p, for example the random prime number chosen is 317 (9-bit), it is required As many as 317 iterations to search for the set of QR17 and do 317 more iterations to find elements of the elliptic curve group.

Phase 2: Forming Public Key and Private Key
To find congruent quadratic residue modulo p will be easier if using Euler's criterion theory (equation 6), i.e., if the value of 1 mod p is a quadratic residue of modulus p, and if it is worth ≠1 mod p, it is a non-residue modulus p. While determining the y value at the point of the elliptic curve depends on the prime number p raised. Based on the theory that has been exposed about the quadratic congruent that to find the value of y at an elliptic curve point is very easy. It is using condition p ≡ 3 mod 4. the value of x referred to in the equation can be used to find the y on a Elliptic curve point.
To get the point that will be the private key and the public key does not need to find the entire point on the curve, but simply by taking just any point so that it will reduce the key generator process. Here's the algorithm: a. Select the prime p at random terms p> 3 and p ≡ 3 mod 4 b. Select a and b randomly from 1 to p -1 for the equation y2=x3+ax+b mod p with condition 4a3+27b2 ≠ 0 mod p. c. Select x randomly from 0 to p -1, then finds the value of y2 based on the elliptic curve equation that has been formed. d. Check y2 is the quadratic residue of modulus p using euler criteria. e. If the value is true, calculate the value of the root.
For The values found are x=10, y1=17 and y2=2, then the points on the arbitrarily formed elliptic curves are (10,17) and (10,2). When compared with the previous sample data then the points found are the same/true. As a second step in the Elgamal generator algorithm with the elliptic curve can be taken one of the points from the example above that is α =(10.17). While the third step chooses integer d with d> 1 and d <p -1, for example selected d=3. The next step is to calculate the value of β=d.α. Since α is the point on the elliptic curve and d is an integer, then this multiplication can be done by repeated addition as d using the elliptic curve point addition theory. Similar to the real number, that 5x3 equals five sums 3 times. Here is the calculation of the value of β, with d=3 and α=(10. Looking for inverse multiplication value from 34-1 at ℤ19 can be done using extended Euclid theory by finding t value because of t=a-1. Here's an example with a=34 and m=19. 1 0 -5 19 7 From the data in Table 3, it is found t=-5, so that 34-1=-5 in ℤ19. Because -5=19 -5=15 at ℤ19, then 34-1=14 at ℤ19. Can be verified 34 x 14=47 ≡ 1 (mod 19) and gcd value (19,34) ≡ 1 (mod 19). Since the lambda value has been found, the next step is to find the values of x3 and y3 to derive new points using equation (2) (14.17). After obtaining the lambda value, the final step of the ElGamal key forming algorithm with the Elliptic Curve is to determine the public and private keys. In this case, the public key is the elliptic curve parameter, α and β. While private key is integer d, so: UK public= (E (a, b), α, β) and UK private=d. Kpublic={(E (1,1) GF (19)), (10,17), (14,17)} and K private=3.
Multiplication of points or sum of points repeatedly as the above means will be less efficient if the number of repetition (integer d is selected) is large because the sum of the point needs to be done as much as integer d. It is necessary to apply square and multiply algorithm,

Phase 3: Encoding
The original text as the input of the ElGamal cryptographic system encryption algorithm with the Elliptic Curve is a point on the elliptic curve. Before doing the encoding process, it is necessary to map plaintext at elliptic curve points. The process of mapping or encoding plaintext into elliptic curve points can be done using the koblitz method. But to find the value of x based on the plaintext encryption algorithm by the to blitz method must select the appropriate elliptic curve parameter. Suppose that the selected k is k=10, while the maximum value of ASCII value is 128 and the minimum value of x is m.k+1 for example 128 x 10+1=1281 as a character representation. [24] To obtain a point with coordinates x> =1281, it is necessary to select an elliptic curve with a prime not smaller than 1281. The selection of elliptic curve parameters corresponding to blitz method depends on the value of k selected. If simplified, the maximum value of k allowed is p/128. Here's an example with plain text "Aceh": a. The elliptic curve E (1,1) GF (1879). b. The "Aceh" plaintext in the ASCII decimal code is {65, 99, 101, 104}. c. the selected integer k is k=11. d. Do looping x=m.k+1. Then check whether it has a y value on the elliptic curve or not, this can be done using euler criteria theory. For m=65: X=m.k+1=65 x 11+1=716 Then calculate the value of y2 Y2=x3+ax+b=7163+1.716+1=1642 (mod 1879) Checking point on the curve is by quadratic check of residue using Euler criteria A (p-1)/2 ≡ 1 mod p, with a=y2 1642 (1879-1)/2 ≡ 1642939 ≡ 1878 (mod 1879), is not a quadratic of modulo residue 1879 so it is necessary to continue x=m.k+2: X=m.k+2=65 x 11+2=717 Y2=x3+ax+b=7173+1.717+1=980 (mod 1879) 980 (1879-1)/2 ≡ 980939 ≡ 1 (mod 1879), is a quadratic residue so that: Y=a (p+1)/4 mod p=980 (1879+1)/4=980470=556 (mod 1879) The encoding result m=65 is (717,556).  (1145,351).

Phase 3: Encryption
The original text (P) as the input of the ElGamal cryptographic system encryption algorithm [25] with the Elliptic Curve are the points on the elliptic curve and the key UK public = (E (a, b), α, β). The encryption selects a random integer r and then calculates the cypher text as follows: C2=P+r x β The above formula is the development of the plaintext encryption formula using ElGamal, by substituting the power operation into multiplication and multiplication operations into sums. For example, with plaintext "Aceh", if the generator of the key algorithm selects the elliptic curve K public=(E (1,1), (275, 676), (1225, 1248)) and K private=22 with the elliptic curve in GF (1879). Given the elliptic curve y2=x3+x+1 GF (1879), α=(275, 676), and β=(1225, 1248). While the plaintext has been mapped to {(717, 556), (1091, 1024), (1112, 1510), (1145, 351)}, Then the encryption does the following: Select randomly integer r, for example selected r=17. Calculating C1=r x α and C2=P+(r x β), with P being plaintext that has been mapped into elliptic curve points. While point multiplication can utilize square and multiply theory as in table 5.

Phase 4: ElGamal Decryption Process Using Elliptic Curves
Encrypt after obtaining C1 and C2 can recover the original text P by using private key K private=d and compute P=C2 -(d x C1). It can be proved that the P obtained is equal to P by encryptor:

Phase 5: Decoding
Since the result of password recovery is still the points on the elliptic curve, it is necessary to return the mapping to ASCII decimal values again using the koblitz method by calculating m=| (x-1)/k |.

Performance Analysis
In testing the two forms of encryption above can be seen how the workings of elliptic curve cryptography to cryptography ElGamal with the existence of targets for a shorter time, the accuracy of data when encryption and decryption. Here are the results of testing the process of encryption and decryption using methods with efficiency and without efficiency. The table above shows the time difference between the method without efficient and efficient method when performing the process of encryption or decryption. The average acceleration during computing is > 6.25% compared to when not using ECC. For time difference data during encryption or decryption using the efficient and efficient method with random data input on an attribute, public key and private key and the use of 128 and 256-bit numbers are in the attachment.

Conclusion
The process of encryption and decryotion on the ElGamal method more efficiently from a time perspective is when we use elliptic curve cryptography. Using the elliptic curve algorithm as the key constructor and ElGamal algorithm for encryption and decryption by following the rules on elliptic curve points, the security level can be designed as expected. The application of the formation of private keys and public keys that are generated automatically by elliptic curve algorithm is very influential on cryptographic computations when performing calculations correctly, quickly and concisely.