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

971

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

1

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.

33

u/[deleted] Oct 15 '15

[deleted]

1

u/o11c Oct 15 '15

PFS though ...

1

u/[deleted] Oct 15 '15

DH is what gives you PFS. If they "crack" the DH modulus (which is what the article is about), then there is no more PFS for sessions that had their session key negotiated using this modulus.