The golden rules of encryption for developers

It is easier to provide the list of things that are worth worrying about than it is to list the things that are safe. There are a lot of as-yet unbroken ciphers and constructions. So, here are the things to avoid:

* Block ciphers in the default mode (“ECB”).

* The Dual_EC random number generator, which virtually nobody uses anyways. You weren’t going to accidentally end up using it. Or, for that matter, any other PKRNG (random numbers produced by public key algorithms).

* RSA with 1024 bit moduli (or below); RSA-2048 is your starting point. Conventional DH at similar key sizes will be an issue too, but there’s a “means/motive/opportunity” issue for RSA-1024 given its prevalence.

* MD4, MD5, and SHA1 aren’t backdoored, but are broken or weak. But: all three are survivable in HMAC (don’t use them, though). SHA2 is your best all-around hashing bet right now.

* The NIST P- curves. There’s no evidence to suggest they’re backdoored, but (a) the rationale behind their generation is questionable and (b) they have other annoying properties.

So far as I can tell, you are now fully briefed on the “distrusted” crypto.

Don’t build your own crypto. Use PGP for data at rest, TLS for data in motion, and NaCl for the rare in-between cases.

Source @tptacek:

Photo credit: Jill Catley via Flickr.

Never Negotiate Piecemeal

We worked through the first 4 or 5. Stuart is not a patient man. And never mind that I was the CEO, his frustration with me was visible. He found a good excuse for a break and pulled me aside.

“Mark, you need to stop negotiating point-by-point.

Our goal here isn’t to have a negotiation line-by-line. We want to know what all of their issues are first. You’re compromising on each point and that makes no sense.

Let’s get all of their issues on the table. Let’s then convene privately and rank the issues we care about and which we don’t. 

Let’s be very flexible on the issues that are at the bottom of our rank and they might really care about. Let’s dig in our heels on the issues we care most about. We can trade compromises on issues that aren’t as important to us in exchange for not budging at all on our most important points.

If you negotiate piecemeal you end up compromising on everything. That’s not very smart.”

And it wasn’t. It came both from impatience (who wants to go through an entire list and hear issues without debating them?), inexperience and ego.