Escolar Documentos
Profissional Documentos
Cultura Documentos
Chris Christensen
Class notes
larger. 240 1099511627776 ; too large. 235 34359735368 ; still too large.
Finally, we see that 233 8589934592 . So, the base-2 logarithm of
8589934592 is 33.
The El Gamal cryptosystem and the Diffie-Hellman key exchange system
are based upon the difficulty of the discrete logarithm problem.
Discrete Logarithms
Discrete mathematics refers to working with number systems having the
property that every number is surrounded by a neighborhood that contains
no other number of the system.
1,
It is not absolutely essential that the element we pick for the base be
primitive; it is not necessary that all of the powers be distinct. However, if
there is too much repetition, the number of trials needed to determine the
logarithm would be cut considerably. For example, say we want to know
3? 5mod11 .
Computing the powers of 3 modulo 11 results in:
31 3mod11
32 9mod11
33 5mod11
34 4mod11
35 1mod11
36 3mod11
37 9mod11
38 5mod11
39 4mod11
310 1mod11
Notice that only five of the representatives modulo 11 occur 3, 9, 5, 4, 1.
And, each is repeated. When we try to solve 3? 5mod11 , we are twice as
likely to find the logarithm because there are only half as many possible
powers. Either 3 or 8 can be used as the logarithm of 5 for base 3 and
modulo 11.
El Gamal Encryption
To keep calculation to a level that can be done on a calculator, we will do an example
that uses an artificial plaintext.
We select for our prime p = 997, and we select a = 7 for our primitive
element.
Our plaintext message is m = 813. The message must be an integer mod p;
so, in our example, it must be one of 1, 2, , 996.
The receiver selects some positive integer n and calculates b a n mod p .
Say, n = 105; then b 7105 mod997 989 .
The public-key is p = 997, a = 7, and b = 989. The private-key is n = 105.
For large values of the prime p, the private-key cannot be easily determined
from the public-key.
The sender chooses a positive integer k and calculates y a k mod p and
z mb k mod p . Say, our sender selects k = 87.
y 787 mod997 849
z 813 98987 mod997 19
The ciphertext message sent by the sender to the receiver is y and z 849
and 19.
El Gamal Decryption
How does the receiver decrypt the message?
Recall that the receiver has some additional information the private-key n.
The sender "possesses" this information only buried in the number
b a n mod p . The sender cannot determine n without solving the discrete
logarithm problem b a ? mod p .
How can the receiver use n to decrypt the message?
Using the ciphertext and the private key, the receiver calculates zy n mod p .
zy n mod p mb k (a k ) n mod p m(ba n ) k mod p m(1) k mod p m
For our example,
y n 849105 mod997 (849105 ) 1 mod997 5581 mod997 620mod997
zy n 19 620mod997 813
which was the plaintext message.
Exercises
1a. 35 ?
1b. 27 ?
1c. 55 ?
2a. 2? 4096 .
2b. 3? 59049 .
2c. 5? 78125 .
3a. ?9 512 .
3b. ?8 6561 .
3c. ?6 60466176 .
4. Determine the following:
21 mod13 ?
22 mod13 ?
23 mod13 ?
24 mod13 ?
25 mod13 ?
26 mod13 ?
27 mod13 ?
28 mod13 ?
29 mod13 ?
210 mod13 ?
211 mod13 ?
212 mod13 ?
Is 2 a primitive element modulo 13?
5. Is 2 a primitive element modulo 7?
6. 2? 2147483648 . How many trials did it take to discover the logarithm?
7a. 2? mod59 9 . How many trials did it take to discover the logarithm?
7b. 2? mod59 37 . How many trials did it take to discover the logarithm?
7c. 2? mod59 41 . How many trials did it take to discover the logarithm?
8. Use the public-key p = 997, a = 7, and b = 989 to encrypt the message
712.
9. Use the public-key p = 997, a = 7, and b = 32 to encrypt the message 605.
Try to determine n.
10. The following was encrypted with the public-key p = 997, a = 7, and b =
989. The private key is n = 105. Decrypt the message y = 147 and z = 343.