I feverishly searched the web and couldn't find a clear explanation about what exactly is "Ephemeral diffie-hellman". Let's briefly recall how diffie-hellman basically works:
- Bob and Alice agree publicly on a generator ($g$) and a prime modulo ($p$)
- Bob selects a private integer ($b$) and computes $B=g^b \bmod p$. He then passes $B$ publicly to Alice
- Alice selects a private integer ($a$) and computes $A=g^a\bmod p$. She then passes $A$ publicly to Bob.
- Bob computes $K = A^b\bmod p$
- Alice computes $K = B^a\bmod p$
So now Bob and Alice both have $K$.
The explanations I see on the web are all sorts of:
Ephemeral Diffie-Hellman (DHE in the context of TLS) differs from the static Diffie-Hellman (DH) in the way that static Diffie-Hellman key exchanges always use the same Diffie-Hellman private keys. So, each time the same parties do a DH key exchange, they end up with the same shared secret.
First to verify some issue: Are "private keys" in the context of diffie-hellman refer to the private $a$ and $b$ that Alice and bob privately select respectively? I'll assume they do, if not - correct me please.
Now, what I don't understand here is, what does it mean that "static DH exchanges always use the same Diffie-Hellman private keys."? I mean:
- What is considered an exchange? A session of information exchanging between to parties?
- If so, does static DH refer to exchanges between the same two parties?
- If not so, considering that, seemingly, using static DH also requires the use of the same $g$ and $p$, how does using static DH will always generate the same $K$?
It'll be great if someone could clarify this whole subject. Thanks