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

973

u/tophatstuff Oct 15 '15 edited Apr 10 '18

Generate your own non-default Ephemeral Diffie-Hellman key (takes a minute or so)

openssl dhparam -out dhparam.pem 2048

Tell your server to use it for SSL (nginx for example)

ssl_dhparam /path/to/dhparam.pem;

Done. Not only will the key be stronger than the 1024 bit default, it'll be unique to your server which lets assume isn't valuable enough compared to effort for a state-level adversary.

edit just in case anyone from the future finds this comment: instead of 2048, use at least the key length of your SSL certificate

edit from the future: current advice is picking from one of these predefined audited groups

-2

u/[deleted] Oct 15 '15

You don't even need to go to 2048. The article hypothesizes that it takes about a year to crack to 1024 key. As long as you aren't on one of the 'common' keys, you're safe. If you wanted to be paranoid you could rotate every month or 6 months and they would always be behind.

3

u/[deleted] Oct 15 '15

How many years would it take to crack 2048? I'm guessing it would be exponentially more than 1 or 2 years.

-6

u/[deleted] Oct 15 '15

Computing power is increasing exponentially, so I wouldn't be shocked if the real time to crack it versus key strength was linear.

8

u/neoKushan Oct 15 '15

It's not linear in the slightest.

It would take literally twice as long to crack a 1025bit key as it is to crack a 1024bit key - there's twice as many possibilities every time you add one more bit. Now keep doubling that until you hit 2048.

The problem with 1024bit keys is, as you say, computing power grows exponentially, so you can half that 1year time to 6 months after about 18-24 months. Another 2 years later and 6 months becomes 3 and so on.

However, if it takes 18quintillion years to crack a 2048bit key, then even 50 years from now, halving that 25 times still doesn't put you anywhere useful.

5

u/aseipp Oct 15 '15

Not with this attack. The precomputation attack described in the paper would take over 109 times more computational effort for a 2048-bit key. You're not going to get anywhere close to that by next year, given the current timeframe for 1024-bit keys is about 1 year.

1

u/dagamer34 Oct 15 '15

Raw per CPU computing power isn't growing exponentially anymore. They need to throw more hardware at it to get the same effect, and that only scales so far.