News for hackers. Stuff that matters.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @01:49PM (#2917532)
Virtually all AES/RSA/SHA256 cryptography outside of a very few well-known, well-regarded cryptosystems is effectively snake oil.

It's a credit to Zimmerman's article that he doesn't leave it at "don't write your own block ciphers", adding that you need to understand block cipher modes (we should stop calling ECB mode "ECB mode", by the way, and start calling it "the default mode"). But obviously, this 1997 article doesn't nearly cover the bases on all the other things you have to do correctly to not end up with trivially breakable cryptography. A lot of those things weren't even known to the public in 1997.

An even more important point is that Zimmerman is talking about cryptography implemented in its strongest, safest venue: data at rest. As implemented by most developers today, crypto ends up in a far more exposed venue: one where a server holds a secret key and uses crypto not to protect a file but to enforce policy. Despite being the 2011 common case for crypto, this is a far harder scenario to get right, because adversaries can devise ways to query the key-holder to learn things about the plaintext, ciphertext, and behavior of the system as a whole.

My advice: don't trust crypto at all outside of TLS, GPG/PGP, and SSH. And know that of those three systems, two were broken relatively recently.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by pnathan on Tuesday August 23, 2011 @03:02PM (#2917910)
What advice would you give to someone who did realistically want to work in, implement, and evaluate industrial-strength crypto?
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @03:13PM (#2917962)
Spend 6-8 years breaking it.

(I haven't spent that much time on crypto, and so as a general rule we don't do implementation projects).

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by pnathan on Tuesday August 23, 2011 @03:18PM (#2917986)
I'm going to presume you also by that imply "read all the standard texts, seminal papers, and current state of the art papers".
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by timsally on Tuesday August 23, 2011 @03:42PM (#2918102)
You'll want to follow people in the industry as well (I've found Nate's blog in particular an enjoyable read). A lot of the practical knowledge accumulates in the brains of the guys who actually get hired to do crypto work. It's an interesting feedback loop to be sure.

Also, it's my impression that start of the art papers aren't really necessary to start off with. The implementation errors people make in their code are flaws that have long been published, sometimes for decades.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @03:49PM (#2918123)
Crypto papers actually kind of suck; my experience is that roughly 2/3rds of the time, the complicated formula on the page works out to a "for" loop that would be trivially easy to understand if expressed in algol syntax.

Best advice: do deep research on TLS. For every feature, do a directed search of the literature and do experimentation to try to figure out why that feature is there. Most of the features in TLS exist as a countermeasure to some attack. Follow this tack all the way down the stack, starting with the high-level protocol features and working your way all the way down through the block cipher modes and configuration that it uses.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by timsally on Tuesday August 23, 2011 @03:54PM (#2918134)
Yeah there definitely is a bit of an art to reading them. But we can't have cryptographers and security professionals merging too fast... that would just make too much sense. :P
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by eru on Wednesday August 24, 2011 @12:14PM (#2921258)
Studying mathematics also helps. Gives you a framework for studying, and contacts to people who are interested in the same field.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by rdl on Tuesday August 23, 2011 @02:15PM (#2917662)
Even using those, people will mess up key management and other security critical aspects.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @02:18PM (#2917675)
I'm a little allergic to allusions to the risk of "key management", because Applied Cryptography (not a good book) calls that out specifically as the riskiest thing about implementing crypto, and it is most definitely not the riskiest thing about implementing crypto.

So let me just say that while key management is hard, even if you stipulate that your key management is perfect, you are probably still boned. The simple task of exchanging real time messages between two parties with secure keys is treacherously hard to implement.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by demallien on Tuesday August 23, 2011 @05:34PM (#2918464)
Yup. Just to give the uninitiated some examples of things you have to watch out for:

1) don't do the modern day equivalent of an Enigma-style 'cillies', ie doing something that reduces the entropy of your key generator (not using the full range of possible values, not having a random distribution of values, etc)

2) Make sure that the decryption time does not vary with the number of correctly guessed bits of the key, ie don't stop a decryption attempt in the real system if you discover that the decryption must be wrong part way through.

3) Make sure that your randomly generated keys don't ever generate keys that create a degenerate crypto text

4) Make sure that you don't use a key for longer than it's cryptoperiod

that's just a small sample of the gotchas that can ping you. And in that list, I'm only worrying about plain decryption of the message, without worrying about 'minor' details such as identifying that a party is who they say they are, man-in-the-middle attacks, replay attacks (resending a recorded encrypted message later on, to open access to something), injecting messages into the communication and so on.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by pdhborges on Tuesday August 23, 2011 @02:42PM (#2917816)
Hi, what book would you recommend in alternative to e Applied Cryptography?
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @02:46PM (#2917834)
Practical Cryptography (also known as Cryptography Engineering).

But read them to learn how to break cryptosystems, and then go do that. Don't read them and then try to build something. They're missing details too.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by caf on Tuesday August 23, 2011 @08:02PM (#2918873)
I think AC is, like Zimmerman above, talking mostly about the data-at-rest case when it refers to key management being the riskiest part. This is reasonable, because in the data-at-rest case, all cryptography does is replace a large secret (the plaintext you want to protect) with a small secret (the key you need to protect instead). If you already had a keeping-something-a-secret problem, then it's reasonable to presume that you will have almost as much of a problem keeping the key a secret.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @08:05PM (#2918877)
First, _Applied_ is totally not just talking about data at rest. It's chock full of archaic challenge-response protocols and half-specified descriptions of asy key exchange schemes.

Second, even for data at rest problems, _Applied_ is a terrible resource.

Just get _Practical Cryptography_ and burn your copy of _Applied_. Schneier co-authored _Practical_. It's a great book.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by caf on Tuesday August 23, 2011 @08:25PM (#2918931)
Agreed - I have both already, I haven't burnt AC yet though (I find it occasionally useful for identifying which oddball 90s cipher a developer has gotten it into their head to use - yes, I have actually seen "3-Way" used in anger...)
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by dublinclontarf on Tuesday August 23, 2011 @02:13PM (#2917651)
> My advice: don't trust crypto at all outside of TLS, GPG/PGP, and SSH. And know that of those three systems, two were broken relatively recently.

Good advice, but they weren't broken, just mistakes in their implementation.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @02:19PM (#2917683)
That is first of all not true, and second of all not relevant. In both cases the cryptosystem itself had a design flaw. And in both cases the implementations of that cryptosystem, aside from the design flaws, had implementation flaws that made the design a moot point.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by yuhong on Tuesday August 23, 2011 @02:25PM (#2917721)
It is still a good point though. Even using proven protocols, you can still make mistakes in the implementation. Using proven implementations is best.
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @02:30PM (#2917757)
I took his point to be the opposite: that the worst that seems to happen with cryptosystems is that implementations are broken.

That bugged me on two levels: first, the idea that there haven't been terrible bugs in e.g. SSL3, and second that an implementation bug means "just upgrade OpenSSL", when it's more like "the discovery of buffer overflows and attendant years of chaos".

I am jumpy about this topic, though.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by palish on Tuesday August 23, 2011 @03:03PM (#2917912)
Which two?
Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by amalcon on Tuesday August 23, 2011 @06:32PM (#2918640)
All three have had flaws of one sort or another discovered since 2005 (TLS has had several; OpenSSH had the Debian keygen thing and an SSHv1 vulnerabiity, and possibly others; GPG apparently had a couple of problems back in 2006).

TLS has definitely had more severe issues, but then, it's also the most widely deployed (so undiscovered flaws are more likely to be discovered). On the other hand, it's also solving the most complicated problem of the three.

Re:Phil Zimmermann: Beware of Snake Oil Crypto (1997) by tptacek on Tuesday August 23, 2011 @08:07PM (#2918882)
The number and nature of the flaws in TLS actually give me more confidence in it. It's not that other systems don't have similar or worse flaws; it's that these kinds of flaws are a cast iron bitch to find, and TLS is the protocol with the maximum incentive for study.

Give it time; we'll find something horrible out about ISAKMP.