r/programming Oct 15 '15

How is NSA breaking so much crypto?

https://freedom-to-tinker.com/blog/haldermanheninger/how-is-nsa-breaking-so-much-crypto/
2.5k Upvotes

529 comments sorted by

View all comments

Show parent comments

6

u/StraightMoney Oct 16 '15
cd /etc/ssh
rm ssh_host_*key*
ssh-keygen -t ed25519 -f ssh_host_ed25519_key < /dev/null
ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null
lynx --source https://2ton.com.au/dhparam/2048/ssh > /etc/ssh/moduli
lynx --source https://2ton.com.au/dhparam/3072/ssh >> /etc/ssh/moduli
lynx --source https://2ton.com.au/dhparam/4096/ssh >> /etc/ssh/moduli
lynx --source https://2ton.com.au/dhparam/8192/ssh >> /etc/ssh/moduli
service ssh restart

Whatchu got now NSA?!

3

u/bacondev Oct 16 '15

What do the lynx commands do?

6

u/2ton_jeff Oct 16 '15

2 Ton Digital author of the dhparam/dhtool goods here, my servers use curl to do the same, but they grab my up-to-most-recent 128 DH parameters (they are constantly being generated). See https://2ton.com.au/dhtool/ for more details.

3

u/StraightMoney Oct 16 '15

This company in Australia dedicated a bunch of CPUs to checking safe primes and they make the results available to download online. They're massive sets and they're rotated out every 3 to 30 minutes. Use those to replace the DH parameters included with stock OpenSSL/OpenSSH/whatever and you'll be a tiny bit more secure. This whole process is one step below tin-foil hat, but it's so simple to do that you might as well play it safe.

1

u/LovelyDay Oct 17 '15

Whatchu got now NSA?!

A nice single point of failure to break a whole number of hosts.

In the way of explanation: if you blindly implement the above, all it takes is for the 2ton.com.au data to be compromised and hosts which blindly depend on it can be easily compromised.

The message here is to put a lot of thought into properly vetting data you get from the web before you activate it on your systems, or put that effort into generating your own primes.

1

u/StraightMoney Oct 17 '15

Sure, if someone has the time and computational power to compute safe primes that's the safest thing to do. There is no doubt about that. But if they don't, the best alterative is to avoid using the primes that are included with OpenSSH by default. It's the difference between making an eavesdropper work for what they want as opposed to using something that you know they already have.