3 ms·
hobbes@namagiri:~$ time openssl dhparam -5 2048 Generating DH parameters, 2048 bit long safe prime, generator 5 This is going to take a long time ..
by daveloyall 11y ago
hobbes@namagiri:~$ time openssl dhparam -5 2048
Generating DH parameters, 2048 bit long safe prime, generator 5
This is going to take a long time
............[snip]......++*++*
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEAzshMWp3IBjMW5Aia2wJOvA2EBY32Mn2fMXzlyFDklnRUg8ff/19A
YWbRA4RAXrBMxoXEH1LVVpm5l89PGZ3DzjDafuNzNskgUhcAewUXXMQdkOFnPHYc
5F7+3DS8981Q0Q05qscBb26YGb2XaoJygyVj+B87NTvdAPzNU4fW5DyCuxhf5eov
ZeZwcC4KZ31Lr7enFcFBjTjxQxW88pP4YhiNYQ1fsFARGJT0X7ksOlRVWFrODu6b
nq0Ye/UWe0WB1zzmxz66ZujAwRwAgfmQZd7rILJqg68sxBeg88FlXJUeKfPL/bIT
KOl1LhiHr/HkUBfgZRahK0MGcthwiLdFZwIBBQ==
-----END DH PARAMETERS-----
real 0m37.073s
user 0m33.464s
sys 0m2.924s
hobbes@namagiri:~$
Edit: second run:
real 0m35.362s
user 0m31.992s
sys 0m2.880s
Would somebody post the steps I should use to make my own OpenSSH sshd(s) use non-standard DH parameters? Do I need to do anything to my clients?
- daveloyall 11y agoApparently `/etc/ssh/moduli` is where I should store newly generated DH parameters. See the manpage moduli(5). Hm, the format of the existing file does not match the format of what `openssl dhparam` generated. I'll research...
- schoen 11y agoThe dhparam command has mostly been used with Apache, as far as I know; ssh provides its own commands as part of ssh-keygen, which are described in the man page you just mentioned. However, the paper authors say "If you use SSH, you should upgrade both your server and client installations to the most recent version of OpenSSH, which prefers Elliptic-Curve Diffie-Hellman Key Exchange." That might ultimately be a simpler and safer course unless you have to deal with old clients that you don't have the ability to upgrade.
- 2ton_jeff 11y agoBit late to the party here, but this is why I wrote https://2ton.com.au/dhtool/ https://2ton.com.au/dhtool/ ... I have 48 CPU cores still dedicated to constantly generating safe primes and generators (have amassed a huge number of 2k, 3k, 4k and 8k DH parameters if anyone's interested) Any of the sizes' most recent 128 parameters can be downloaded in SSH moduli format, e.g. https://2ton.com.au/dhparam/4096/ssh https://2ton.com.au/dhparam/4096/ssh
- pentestercrab 11y agoVery interesting. Any chance you'll be attending the Ruxcon security conference in Melbourne?
- AnimalMuppet 11y agoIf you wanted, you could start a small business selling CDs with those DH parameters. Be of public service and make some money at the same time.
- daveloyall 11y agoThe EFF addressed this today. For SSH, they suggested this guide. https://stribika.github.io/2015/01/04/secure-secure-shell.html https://stribika.github.io/2015/01/04/secure-secure-shell.ht... Indeed, the guide recommends generating new contents for the /etc/ssh/moduli file (IFF you keep `diffie-hellman-group-exchange-sha256` enabled).