3 ms·
I would say there's a balancing problem. The best practices change over time, but old literature, and especially old online resources, have lots of inertia. We
by bostik 11y ago
I would say there's a balancing problem.
The best practices change over time, but old literature, and especially old online resources, have lots of inertia. We can call it the stagnating force of cargo culting, or the dark side of PageRank. The literature I remember reading clearly stated that in DH the security lies in the data used for key exchange and not the parameters. The use of well-known parameters are in fact encouraged. You state the same:
> Yes, if you're going to use 1024-bit prime group, you definitely want to be using one very few others use. [...] It doesn't much matter how many people use your (properly selected) 2048 bit group; no amount of precomputation puts it in reach of attackers.
Using standard, known-secure parameters is clearly a winner here. So: the best practice is to use provided DH parameters. What do people deploying applied cryptography do? They use parameters available from their chosen crypto library. Parameters, that were set as defaults years earlier.
Around year 2000, it was computationally (relatively) expensive to generate your own DH group. And, because using your own group makes it harder to bootstrap trust, it would have added complexity in an already complex mechanism. Hence, the best practice of using known DH group made even more sense.
The fact that Logjam mitigation strategy includes the recommendation to generate your own DH group flies against the face of established DH best practices. (Can we just assume that the modern crypto libraries will catch a faulty RNG and refuse to expose clearly vulnerable parameters? For sake of brevity, at least?) Those deploying applied crypto in the field are now faced with conflicting information. The established and easily discovered (PageRank[tm]) literature states that the best practice is to use known DH groups. The same literature also states that for compatibility reasons, using >1024 bit groups are not recommended. Now contrast this with the Logjam paper: those who require compatibility are suddenly in the need of their privately generated DH parameters. So suddenly the best practice is to ignore established best practice?
That's a nasty conflict.
Of course the sane and secure route was to simply make sure all servers were using ECDHE. But if you need to serve clients that are using ancient browsers, you probably still have to accept the known 1024 DH groups too.
- wolf550e 11y agoGenerating DH parameters is as expensive as generating an RSA key pair. It was never too expensive to generate DH parameters for your server, once, or every restart, or daily. It still is too expensive to generate DH parameters per-connection. If Apache always did what it does now (generate new DH params on service start, of the same size as the RSA key), it would have been secure and not computationally expensive for anyone except embedded platforms that don't run Apache anyway. The client does not care whether the 1024 bit DH prime is common or not, so even if you have to use 1024 bit DH params, make sure they're new and that the NSA can probably crack them.
- tptacek 11y agoWhat's concerning is this idea, pretty clearly expressed in the blog we're commenting on, that it's a good idea to generate DH parameters on the fly. I don't think that's true at all. It's a good idea not to use 1024 bit params. That's the change that's needed. Attempting to generate params (or RSA keys or whatever) on the fly just exposes you to another class of bugs.