Attacks on Diffie-Hellman
We're going to continue looking at the Diffie-Hellman algorithm today by examining how to configure the algorithm to be more resistant to attacks. DH is small enough that I'm not going to summarize the algorithm here. You can go back to the description yesterday if needed. I'll reuse the same letters g and p for continuity.
The values g and p are exchanged publicly, perhaps by putting them into a public certificate. There are two modes of DH depending on whether the generated keys for a particular g and p combination are reused. Static DH reuses the key values. Using static keys is faster and doesn't really give any aid to an attacker that can precompute data. Ephemeral DH makes up a new set of keys for every transaction. The advantage of ephemeral keys is that they can be thrown away afterwards and even breaking into the machine later can't help you recover what was exchanged. The sender and receiver can use different modes so ephemeral-static DH is an example with an ephemeral sender and static receiver.
The other major choice when configuring DH is how big to make p and the private keys. In general, it's easier to attack p than to attack a private key. This means that p requires more bits than a private key does. Further, the private key needs to be longer than the key that is being constructed through DH. I have seen rules of thumb that the private key should be twice as long as the exchanged key and that a 1024 bit prime p has an effective limit of a 160 bit private key. This means that a 1024 bit prime is really only good for safely constructing about an 80 bit key, smaller than the 112 bits of 3DES. You should be doing some independent reading about the DH algorithm if you actually need to pick the appropriate size of p and other desirable mathematical properties.
The good news is that suites like SSL combine selected modes of DH with other techniques to protect against common attacks, such as man-in-the-middle while starting up the conversation. That means that your security does not require understanding any of this.
Next time: Using RSA for Sending Messages
Comments
- Anonymous
September 13, 2006
PingBack from http://blogs.msdn.com/drnick/archive/2006/09/12/750344.aspx - Anonymous
September 18, 2006
PingBack from http://blogs.msdn.com/drnick/archive/2006/09/14/753593.aspx - Anonymous
October 17, 2006
One of the key points made about the Diffie-Hellman algorithm is that it doesn’t actually allow you to