Streamlined security for mobile and embedded devices
 
Ephemeral Diffie-Hellman
In Ephemeral Diffie-Hellman key exchange, two parties called Alice and Bob
agree on a prime p, and a generator g of the field Z*p. This field consists of the set of integers that have no non-trivial
factors in common with p.
The parties follow this protocol:
Alice selects random number a from the field. This number remains secret
for the duration of the key exchange. Alice calculates
ga mod p and sends it to Bob (see the
Diffie-Hellman Key Exchange diagram below).
Bob selects random number b from the field, calculates
gb mod p and sends it to Alice (see the
Diffie-Hellman Key Exchange diagram below).
\code \endcode
@image html dh_key_exchange.jpg
\code \endcode
Alice, knowing g, a and gb mod p,
calculates the shared secret (gb)a = gab mod p.
Bob, knowing g, b and ga mod p,
calculates the shared secret (ga)b = gab mod p.
Both Alice and Bob now have the same shared secret as the key with which to
perform symmetric encryption. Eve, the eavesdropper, knows g,
ga and gb, however being unaware of either
a or b, is unable to calculate gab from
ga and gb.
This difficulty arises from the Diffie-Hellman problem which is based upon
the discrete logarithm problem in which x cannot be easily calculated
from gx mod p.
Ephemeral Diffie-Hellman does not provide authentication, since neither party
has guarantees about the entity with which it is communicating.