Diffie-Hellman and the last bit

Let p = 10007 p = 10007 and g = 5. g=5. You may assume that p p is prime and g g is a primitive root mod p . p.

Suppose Alice and Bob are carrying out the Diffie-Hellman protocol with these parameters. As a first step, Alice sends Bob g m ( m o d p ) g^m \pmod p and Bob sends Alice g n ( m o d p ) , g^n \pmod p, where m m and n n are secret positive integers less than p , p, known only to Alice and Bob, respectively.

An eavesdropper Eve knows the values of p p and g g , and sees the transmissions. In particular, she sees that Alice sends Bob the number 2 2 and Bob sends Alice the number 3. 3. What can Eve deduce about m m and n n quickly? (That is, much more quickly than computing m m and n n --please don't compute m m and n n to solve the problem!)

m m is even, n n is odd m , n m,n are both even m , n m,n are both odd m m is odd, n n is even

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Jesse Nieminen
Apr 22, 2016

5 5 is a Primitive root (mod 10007) \text{ (mod 10007)} . Thus, ord 10007 5 = 10006 \text{ord}_{10007} 5 = 10006 .

Hence, 5 x 1 (mod 10007) 10006 | x 5^x \equiv 1 \text{ (mod 10007)} \Rightarrow \text{10006 | x} .

Since 10006 = 2 × 5003 10006 = 2 \times 5003 ,

5 5003 m 2 5003 1 (mod 10007) 5^{5003m} \equiv 2^{5003} \equiv 1 \text{ (mod 10007)} if m m is even and 5 5003 m 2 5003 1 (mod 10007) 5^{5003m} \equiv 2^{5003} \equiv -1 \text{ (mod 10007)} if m m is odd.

5 5003 n 3 5003 1 (mod 10007) 5^{5003n} \equiv 3^{5003} \equiv 1 \text{ (mod 10007)} if n n is even and 5 5003 n 3 5003 1 (mod 10007) 5^{5003n} \equiv 3^{5003} \equiv -1 \text{ (mod 10007)} if n n is odd.

Euler's criterion tells that ( 2 10007 ) L 2 5003 (mod 10007) \left(\frac{2}{10007}\right)_L \equiv 2^{5003} \text{ (mod 10007)} and ( 3 10007 ) L 3 5003 (mod 10007) \left(\frac{3}{10007}\right)_L \equiv 3^{5003} \text{ (mod 10007)} .

Second Supplement to Quadratic Reciprocity tells that ( 2 10007 ) L = 1 \left(\frac{2}{10007}\right)_L = 1 , since 10007 1 (mod 8) 10007 \equiv -1 \text{ (mod 8)} .

Law of Quadratic Reciprocity tells that ( 3 10007 ) L = ( 10007 3 ) L = ( 1 3 ) L = 1 \left(\frac{3}{10007}\right)_L = \left(\frac{-10007}{3}\right)_L = \left(\frac{1}{3}\right)_L = 1 , since 10007 3 (mod 4) 10007 \equiv 3 \text{ (mod 4)} and 3 3 (mod 4) 3 \equiv 3 \text{ (mod 4)} .

Thus, 2 5003 3 5003 1 (mod 10007) 2^{5003} \equiv 3^{5003} \equiv 1 \text{ (mod 10007)} .

Since 2 5003 1 (mod 10007) 2^{5003} \equiv 1 \text{ (mod 10007)} and 3 5003 1 (mod 10007) 3^{5003} \equiv 1 \text{ (mod 10007)} , m, n are both even \boxed{\text{m, n are both even}} .

The computation can be sped up using Legendre symbols .

Patrick Corn - 5 years, 1 month ago

Log in to reply

Oh, I didn't realize that I could use Legendre symbols to compute that so easily. :D Thanks!

Jesse Nieminen - 5 years, 1 month ago

J up J I'm nmihx sex kmi IPhb

Amanda Curry - 2 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...