Discrete Logarithms and Diffie-Hellman

Prev: Introduction Next: Integer Factorization and RSA

Exercises

Section 2.1. Diffie-Hellman and RSA

2.1

Write a one page essay giving arguments, both pro and con, for the following assertion:

If the government is able to convince a court that there is a valid reason for their request, then they should have access to an individual’s private keys (even without the individual’s knowledge), in the same way that the government is allowed to conduct court authorized secret wiretaps in cases of suspected criminal activity or threats to national security.

Based on your arguments, would you support or oppose the government being given this power? How about without court oversight? The idea that all private keys should be stored at a secure central location and be accessible to government agencies (with or without suitably stringent legal conditions) is called key escrow.

2.2

Research and write a one to two page essay on the classification of cryptographic algorithms as munitions under ITAR (International Traffic in Arms Regulations). How does that act define “export”? What are the potential fines and jail terms for those convicted of violating the Arms Export Control Act? Would teaching non-classified cryptographic algorithms to a college class that includes non-US citizens be considered a form of export? How has US government policy changed from the early 1990s to the present?

Section 2.2. The Discrete Logarithm Problem

2.3

Let be a primitive root for .

(a) Suppose that and are both integer solutions to the congruence . Prove that . Explain why this implies that the map (2.1) on page 65 is well-defined.

(b) Prove that

for all .

(c) Prove that

for all and .

2.4

Compute the following discrete logarithms.

(a) for the prime , i.e., , , and you must solve the congruence .

(b) for the prime .

(c) for the prime . Hint: Look in the second column of Table 2.1 on page 66.

2.5

Let be an odd prime and let be a primitive root modulo . Prove that has a square root modulo if and only if its discrete logarithm modulo is even.

Section 2.3. Diffie-Hellman Key Exchange

2.6

Alice and Bob agree to use the prime and the base for a Diffie-Hellman key exchange. Alice sends Bob the value . Bob asks your assistance, so you tell him to use the secret exponent . What value should Bob send to Alice, and what is their secret shared value? Can you figure out Alice’s secret exponent?

2.7

Let be a prime and let be an integer. The Decision Diffie-Hellman Problem is as follows. Suppose that you are given three numbers , , and , and suppose that and are equal to

but that you do not necessarily know the values of the exponents and . Determine whether is equal to . Notice that this is different from the Diffie-Hellman problem described on page 69. The Diffie-Hellman problem asks you to actually compute the value of .

(a) Prove that an algorithm that solves the Diffie-Hellman problem can be used to solve the decision Diffie-Hellman problem.

(b) Do you think that the decision Diffie-Hellman problem is hard or easy? Why?

See Exercise 6.40 for a related example in which the decision problem is easy, but it is believed that the associated computational problem is hard.

Section 2.4. The Elgamal Public Key Cryptosystem

2.8

Alice and Bob agree to use the prime and the base for communications using the Elgamal public key cryptosystem.

(a) Alice chooses as her private key. What is the value of her public key ?

(b) Bob chooses as his private key, so his public key is

Alice encrypts the message using the random element . What is the ciphertext that Alice sends to Bob?

(c) Alice decides to choose a new private key with associated public key . Bob encrypts a message using Alice’s public key and sends her the ciphertext . Decrypt the message.

(d) Now Bob chooses a new private key and publishes the associated public key . Alice encrypts a message using this public key and sends the ciphertext to Bob. Eve intercepts the transmission. Help Eve by solving the discrete logarithm problem and using the value of to decrypt the message.

2.9

Suppose that Eve is able to solve the Diffie-Hellman problem described on page 69. More precisely, assume that if Eve is given two powers and , then she is able to compute . Show that Eve can break the Elgamal PKC.

2.10

The exercise describes a public key cryptosystem that requires Bob and Alice to exchange several messages. We illustrate the system with an example.

Bob and Alice fix a publicly known prime , and all of the other numbers used are private. Alice takes her message , chooses a random exponent , and sends the number to Bob. Bob chooses a random exponent and sends back to Alice. Alice then computes and sends to Bob. Finally, Bob computes and recovers the value of Alice’s message.

(a) Explain why this algorithm works. In particular, Alice uses the numbers and as exponents. How are they related? Similarly, how are Bob’s exponents and related?

(b) Formulate a general version of this cryptosystem, i.e., using variables, and show that it works in general.

(c) What is the disadvantage of this cryptosystem over Elgamal? Hint: How many times must Alice and Bob exchange data?

(d) Are there any advantages of this cryptosystem over Elgamal? In particular, can Eve break it if she can solve the discrete logarithm problem? Can Eve break it if she can solve the Diffie-Hellman problem?

Section 2.5. An Overview of the Theory of Groups

2.11

The group consists of the following six distinct elements

where is the identity element and multiplication is performed using the rules

Compute the following values in the group :

(a)

(b)

(c)

(d)

Is a commutative group?

2.12

Let be a group, let be an integer, and define a subset of by

(a) Prove that if is in , then is in .

(b) Suppose that is commutative. Prove that if and are in , then their product is in .

(c) Deduce that if is commutative, then is a group.

(d) Show by an example that if is not a commutative group, then need not be a group. Hint: Use Exercise 2.11.

2.13

Let and be groups. A function is called a group homomorphism if it satisfies

Note that the product uses the group law in the group , while the product uses the group law in the group .

(a) Let be the identity element of , let be the identity element of , and let . Prove that

(b) Let be a commutative group. Prove that the map defined by is a homomorphism. Give an example of a noncommutative group for which this map is not a homomorphism.

(c) Same question as (b) for the map .

2.14

Prove that each of the following maps is a group homomorphism.

(a) The map that sends to in .

(b) The map defined by

(c) The discrete logarithm map , where is a primitive root modulo .

2.15

(a) Prove that is a group.

(b) Show that is a noncommutative group for every prime .

(c) Describe completely. That is, list its elements and describe the multiplication table.

(d) How many elements are there in the group ?

(e) How many elements are there in the group ?

Section 2.6. How Hard Is the Discrete Logarithm Problem?

2.16

Verify the following assertions from Example 2.16.

(a) .

(b) .

(c) .

(d) .

(e) .

(f) .

Section 2.7. A Collision Algorithm for the DLP

2.17

Use Shanks’s babystep-giantstep method to solve the following discrete logarithm problems. For (b) and (c), you may want to write a computer program implementing Shanks’s algorithm.

(a) in .

(b) in .

(c) in .

Section 2.8. The Chinese Remainder Theorem

2.18

Solve each of the following simultaneous systems of congruences, or explain why no solution exists.

(a) and .

(b) and .

(c) and .

(d) , , and .

(e) , , and .

2.19

Solve the 1700-year-old Chinese remainder problem from the Sun Tzu Suan Ching stated on page 84.

2.20

Let be integers with . Let

Prove that is a solution to

and that every solution to (2.24) has the form for some .

2.21

(a) Let be positive integers and suppose that

Prove that .

(b) Let and be two solutions to the system of simultaneous congruences (2.7) in the Chinese remainder theorem (Theorem 2.24). Prove that

2.22

For those who have studied ring theory, this exercise sketches a short proof of the Chinese remainder theorem. Let be integers and let be their product.

(a) Prove that the map

is a well-defined homomorphism of rings. Hint: First define a homomorphism from to the right-hand side of (2.25), and then show that is in the kernel.

(b) Assume that are pairwise relatively prime. Prove that the map given by (2.25) is one-to-one. Hint: What is the kernel?

(c) Continuing with the assumption that the numbers are pairwise relatively prime, prove that the map (2.25) is onto. Hint: Use (b) and count the size of both sides.

(d) Explain why the Chinese remainder theorem (Theorem 2.24) is equivalent to the assertion that (b) and (c) are true.

2.23

Use the method described in Sect. 2.8.1 to find square roots modulo the following composite moduli.

(a) Find a square root of modulo . Note that .

(b) Find a square root of modulo .

(c) Find four square roots of modulo . The modulus factors as . Note that your four square roots should be distinct modulo .

(d) Find eight square roots of modulo .

2.24

Let be an odd prime, let be an integer that is not divisible by , and let be a square root of modulo . This exercise investigates the square root of modulo powers of .

(a) Prove that for some choice of , the number is a square root of modulo , i.e., .

(b) The number is a square root of modulo the prime . Use the idea in (a) to compute a square root of modulo .

(c) Suppose that is a square root of modulo . Prove that for some choice of , the number is a square root of modulo .

(d) Explain why (c) implies the following statement: If is an odd prime and if has a square root modulo , then has a square root modulo for every power of . Is this true if ?

(e) Use the method in (c) to compute the square root of modulo , given that .

2.25

Suppose with and distinct odd primes.

(a) Suppose that . Prove that if the equation has any solutions, then it has four solutions.

(b) Suppose that you had a machine that could find all four solutions for some given . How could you use this machine to factor ?

Section 2.9. The Pohlig-Hellman Algorithm

2.26

Let be a finite field and let . Prove that has an element of order . This is true in particular for any prime power that divides . Hint: Use the fact that has a primitive root.

2.27

Write out your own proof that the Pohlig-Hellman algorithm works in the particular case that is a product of two distinct primes. This provides a good opportunity for you to understand how the proof works and to get a feel for how it was discovered.

2.28

Use the Pohlig-Hellman algorithm (Theorem 2.31) to solve the discrete logarithm problem

in each of the following cases.

(a) , , .

(b) , , .

(c) , , . Hint: .

(d) , , . Hint: has a factor of .

Section 2.10. Rings, Quotient Rings, Polynomial Rings, and Finite Fields

2.29

Let be a ring with the property that the only way that a product can be is if or . In the terminology of Example 2.55, the ring has no zero divisors. Suppose further that has only finitely many elements. Prove that is a field. Hint: Let with . What can you say about the map defined by ?

2.30

Let be a ring. Prove the following properties of directly from the ring axioms described in Sect. 2.10.1.

(a) Prove that the additive identity element is unique, i.e., prove that there is only one element in satisfying for every .

(b) Prove that the multiplicative identity element is unique.

(c) Prove that every element of has a unique additive inverse.

(d) Prove that for all .

(e) We denote the additive inverse of by . Prove that .

(f) Let be the additive inverse of the multiplicative identity element . Prove that .

(g) Prove that for every nonzero .

(h) Prove that an element of has at most one multiplicative inverse.

2.31

Let and be rings. A function is called a ring homomorphism if it satisfies

(a) Let , , and denote the additive and multiplicative identities of and , respectively. Prove that

where the last equality holds for those that have a multiplicative inverse.

(b) Let be a prime, and let be a ring with the property that for every . Here means to add to itself times. Prove that the map

is a ring homomorphism. It is called the Frobenius homomorphism.

2.32

Prove Proposition 2.41.

2.33

Prove Proposition 2.43. Hint: First use Exercise 2.32 to prove that the congruence classes and depend only on the congruence classes of and .

2.34

Let be a field and let and be nonzero polynomials in .

(a) Prove that .

(b) Prove that has a multiplicative inverse in if and only if is in , i.e., if and only if is a constant polynomial.

(c) Prove that every nonzero element of can be factored into a product of irreducible polynomials. Hint: Use (a), (b), and induction on the degree of the polynomial.

(d) Let be the ring . Give an example to show that (a) is false for some polynomials and in .

2.35

Let and be the polynomials

Use the Euclidean algorithm to compute in each of the following rings.

(a)

(b)

(c)

(d)

2.36

Continuing with the same polynomials and as in Exercise 2.35, for each of the polynomial rings (a)-(d) in Exercise 2.35, find polynomials and satisfying

2.37

Prove that the polynomial is irreducible in . Hint: Think about what a factorization would have to look like.

2.38

The multiplication table for the field is given in Table 2.5, but we have omitted fourteen entries. Fill in the missing entries. This is the field described in Example 2.57. You can download and print a copy of Table 2.5 at www.math.brown.edu/~jhs/MathCrypto/Table2.5.pdf.

2.39

The field is a field with elements, which for the moment we denote by . See Example 2.58 for a convenient way to work with .

(a) Is a primitive root in ?

(b) Is a primitive root in ?

(c) Is a primitive root in ?

Hint: Lagrange’s theorem says that the order of must divide . So if for all proper divisors of , then is a primitive root.

2.40

Let be a prime number and let . The quotient ring and the finite field are both rings and both have the same number of elements. Describe some ways in which they are intrinsically different.

2.41

Let be a finite field.

(a) Prove that there is an integer such that if we add to itself times,

then we get . Note that here and are the multiplicative and additive identity elements of the field . If the notation is confusing, you can let and be the multiplicative and additive identity elements of , and then you need to prove that . Hint: Since is finite, the numbers , , , … cannot all be different.

(b) Let be the smallest positive integer with the property described in (a). Prove that is prime. Hint: If factors, show that there are nonzero elements in whose product is zero, so cannot be a field. This prime is called the characteristic of the field .

(c) Let be the characteristic of . Prove that is a finite-dimensional vector space over the field of elements.

(d) Use (c) to deduce that has elements for some .