The discussion addresses whether 2048-bit Diffie-Hellman (DH) parameters are too weak for Discourse, initiated by robbyoconnor who argued for a configurable option to use 4096 bits. sam raised a technical concern that the current configuration would fail to boot if the DH file is missing, a point robbyoconnor acknowledged. While sam and robbyoconnor initially favored making the bit length configurable with a warning about 2048-bit weakness, experts codinghorror and mpalmer corrected the premise, stating that 2048-bit parameters are secure and that increasing to 4096 bits offers negligible security gains while significantly slowing down connection handshakes. codinghorror emphasized that attack space doubles with every bit, making 2048-bit already robust. robbyoconnor conceded that the original change was rolled back and expressed openness to keeping the default at 2048 bits while making it configurable. Finally, RGJ suggested that users requiring 4096-bit parameters can simply download pre-generated files from trusted sources like 2ton.com.au rather than generating them locally.
I believe that 2048 bit dhparams is too weak. I was the guy who introduced this PR – to make it more secure.
I think we should make this a configuration option that is passed to the ssl template. Let’s open a discussion about how this could be done. 4096 bits is the right way to go about.
If none of this works for the majority – nginx will work fine without dhparams. You can boot discourse, and then generate dhparams while it is running by entering the web container. It’d add a manual step, but you can get your site up and go and grab a cup of coffee or tea while it does its magic.
Anything higher is basically pointless “mine is bigger than yours” wankery:
Similarly, you may also use a 2048-bit modulus, which is already very far into the “cannot break it zone”. The 4096-bit modulus will make DH computations slower (which is not a real problem for a VPN; these occur only at the start of the connection), but won’t actually improve security.
To some extent, a 4096-bit modulus may woo auditors, but auditors are unlikely to be much impressed by a Raspberry-Pi, which is way too cheap anyway.
Indeed, characterising 2048 bit DH parameters as “weak as hell” is quite misleading. There are no known feasible cryptographic attacks against arbitrary strong 2048 bit DH groups. To protect against future disclosure of a session key due to breaking DH, sure, you want your DH parameters to be as long as is practical, but since 1024 bit DH is only just getting feasible, 2048 bits should be OK for most purposes for a while yet.
@codinghorror, I’m sorry I introduced this – I have no issue with it staying the way it is(since the dhparams change I made was rolled back)…I just wanted to open a discussion if having it configurable was useful…I like it configurable with default being 2048 bits.