One of the algorithms used for encryption and discussed in this article are ElGamal algorithm. This algorithm emphasizes the problems mathematics algorithms. Problems with the ElGamal encryption chipertext results will be very difficult in kriptanalis.
The problems raised in this article are:
- How to generate random numbers (prime and not prime) to be the key cryptography in the system?
- How to publish public key and private key to hide?
- How do I calculate a exponent operation that produces an integer that is very large so that can not be saved by any type of data in a resource program (JAVA)?
- How do I calculate the modulo operation of an integer is very large?
- How do I calculate the inversion modulo operation of an integer is very large?
- How to plain text character conversion chiper text or otherwise using the ASCII table, where the maximum number of ASCII characters must be a prime?
1. The prime p (not secret)
2. Random number, g (g
Elgamal algorithm algorithm is one of the public-key cryptography is created by Taher ElGamal in 1984. In the algorithm is generally used for digital signatures, but then modified so that it can also be used for encryption and description.
Encryption process is as follows:
- Encryption
- Plainteks organized into blocks of m1, m2, ..., so that each block represents the value in the range 0 to p - 1.
- Select a random number k, which in this case 0
- Each block is encrypted with the formula m
- a = g^k mod p (1)
- b = y^km mod p (2)
- Pair a and b are cipherteks to block the message m. Thus, the size ciphertext twice its size plainteks.
- Decryption
- For a and b mendekripsi use a secret key, x, and m plainteks be back with the equality
m = b / a^x mod p (3)
mathematics from the equation above can be plainteks that can be returned with the pair a and b
Here is a flowchart used in Agoritma ElGamal:
The first prime number p randomly resurrected. Numbers p Range data is used as a reference for plainteks and chiper text. Eg reference to the ASCII code 0 - 256 then the p value is 257.
After that raised random value g and x. X is the value of private key can be raised up so the user wishes and do not have to be random. Terms of generation g and the value of x is:
After the countdown y (public key) to call a function to calculate the y value of the shipment paremeter g, x, and p. After we made the key y g, y, p as a public key and private key as x.
After determining the key encryption process is complete then the message begins with a special encryption function call with parameter m post plain text and key - public key.
After the encryption then email is sent to the destination email. Chiper text size 2X plain text. Once the recipient receives the email in the text chiper decryption with the decryption function with parameters that are sent chiper text. The process of decryption will be done by using the private key of the recipient email (x).
Operation in the a and y is the same value pangkatnya just different. In the a, g dipangkatkan with k while the y, g dipangkatkan with x.
Encryption algorithm from the above looks simple. However, there are complex issues that matter for inclusion in the program code. This is because the algorithm ElGamal operation perpangkatan and modulo the number that large. For example eg in the y and a:
If p = 223 g = 13 x = 131 and k = 127
Decryption formula is as follows:
formula derived above need to be counted as regular as if it will result in a decimal value. In fact the value in the ASCII table is always integer. So 1 / (a^x) will be downgraded to
6 comments:
thanks to post this article..its help me to try learn a crptography
nice articel
thanks...wait an other articel about criptography
Really liked the article, some points.
I was reading it in order to implement the algorithm and
1. Te distinguish is not clear between b = ( (y^k)*M ) mod p
it is easy to mistake it with b = ( y^(k*M) ) the way it is presented in the post.
Apart from that it was nice to read a "more one article about Elgamal" in a way that made me learn something (like the numbers example etc). Thank you.
dimitris :
thanks for comment,, i think the problem of counting value of 'b' you can use my post with tittles : addition chaining or divide and conquer...
thanks for sharing the link
Post a Comment