Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Diffie Hellman worksheet

http://www.math.cornell.edu/~mec/2003-2004/cryptography/diffiehellma...

Back

Diffie-Hellman Worksheet
(Suggestion for the first time through: use P=257 and N=3) Fix a modulus P = _________ and a base N = _________, which are known to everybody (typically, P is prime for this system and N is a "primitive root" meaning the powers of N are all different modulo P, until the (P-1) power of N is 1, by Fermat's little theorem). Pick your secret exponent E = ________ (E and (P-1) should have no common factors, besides 1.). Find all of the powers of N modulo P listed below, reducing modulo P after every step: N (mod P) = ________ N8 (mod P) N64 (mod P) = ________ = ________ N (mod P) = ________ N16 (mod P) N128 (mod P) = ________ = ________
2

N4 (mod P) N32 (mod P)

= ________ = ________

Now, find the powers above that sum to E, and compute J = NE (mod P) by multiplying those powers of N together. [For example, if E = 113, E = 64 + 32 + 16 + 1. Then, J = NE (mod P) = N64 * N32 * N16 * N (mod P).] J = _________ Trade your J with another group (call theirs K). Now compute KE (mod P) by the same repeated squaring method: K (mod P) = ________ K8 (mod P) = ________ K64 (mod P) = ________ K2 (mod P) = ________ K16 (mod P) K128 (mod P) = ________ = ________ K4 (mod P) = ________ K32 (mod P) = ________

KE (mod P) is the secret number you have with the other group!

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com) 1 of 1

8/14/2011 6:38 AM

You might also like