5 Key Exchange Ver2
5 Key Exchange Ver2
References:
Applied Cryptography, Bruce Schneier
Cryptography and Network Securiy, Willian Stallings
Outlines
• Primitives Root
• Discrete Logarithm
• Diffie-Hellman
• ElGamal
Primitive Root
• A primitive root of a prime number p as one whose powers
modulo p generate all the integers from 1 to p-1.
• Example:
• A prime number 19 has primitive roots: 2, 3, 10, 13, 14, and
15. (It’s shown by Powers of Integers, Modulo 19 Table)
Powers of Integers, Modulo
19 Table
Discrete Logarithm
• For a pair of primitive root α and a prime number p:
dlogα,p(1) = 0 α0 mod p = 1 mod p = 1
dlogα,p(α) = 1 α1 mod p = α
• Based on Powers of Integers, Modulo 19 Table (previous
slide) :
dlog2,19(3) = 13
dlog2,19(6) = 14
Diffie-Hellman Key Exchange
Diffie-Hellman Key Exchange
• The Diffie Hellman was the first public-key algorithm.
• It was invented in 1976.
• This algorithm can be used to generate secret key but not to
encrypt and decrypt message.
• Alice and Bob agree on large prime q and α. α is primitive
root of q.
• q and α do not have to be secret and transmitted over
insecure channel.
Diffie-Helman Protocol (1)
• Alice chooses a random large integer XA and sends Bob
YA = αXA mod q
• Bob chooses a random large integer XB and sends Alice
YB = αXB mod q
• Alice computes
K = YBXA mod q
• Bob computes
K = YAXB mod q
Everyone on the channel just know q, α, YA, and YB.
Diffie-Helman Protocol (2)
Diffie-Hellman with n Parties
(1)
• n=3
• Alice chooses a random large integer XA and sends Bob : YA = αXA mod q.
• Bob chooses a random large integer XB and sends Carol : YB = αXB mod q.
• Carol chooses a random large integer XC and sends Alice : YC = αXC mod q.
• Alice sends Bob : YC‘ = YCXA mod q.
• Bob sends Carol : YA‘ = YAXB mod q.
• Carol sends Alice : YB‘ = YBXC mod q.
• Alice computes secret key : K = (YB’)XA mod q.
• Bob compues secret key : K = (YC’)XB mod q.
• Carol computes secret key : K = (YA’)XC mod q.
Diffie-Hellman with n Parties
(2)
• applied
• to the entire message plus hash code, confidentiality is also
provided.