The methods described in _Applied Cryptography_ are unfortunately well-tried, but few of them are true. _Applied_ is an almanac of cryptographic concepts. Where _Practical_ tries hard to present best practices at every point in the book, _Applied_ instead strives for the broadest coverage; it's a survey, not an instruction guide. Unfortunately for all of us, ~20 years of _Applied_ readers have tried to put directly into practice the material in that book, much of which is (relevant to modern standards) half-baked.
It's also important to know that _Practical_ is also showing its age. There are very common, very serious vulnerabilities that _Practical_ does very little to prevent. For instance, "Design Rule 4" in _Practical_, "The Horton Principle", implies that message authentication should precede encryption. This construction is now disfavored; protocols that use mac-then-encrypt have been broken with side channels abetted by attacker chosen ciphertext.
Other concepts missing from _Practical_: elliptic curve --- particularly given endangered status of RSA, which would be a nit if not for the extremely detailed coverage Schneier gives to more theoretical threats to AES, (EC)DSA parameter tampering, the notion of minimizing randomness from cryptosystems, the modern AE modes, an in-depth treatment of side channels (where "in-depth" might mean "at least as much coverage as is given to the question of what block cipher mode to use") --- particularly error oracles, applications of hash collisions, RSA message formatting (it doesn't even cover OAEP), and secure key derivation.
I write this from a place of love; _Practical Cryptography_ is one of my all-time favorite software security books. It's one of those books you can "read backwards" to learn how to break systems in addition to learning how to build them. With age, though, _Practical_ is becoming more useful as a breaker's guide and less and a builder's guide.
There is no book anywhere that a generalist developer can read to learn how to build a secure cryptosystem from scratch, and generalist developers should be relying instead on high-level libraries like Keyczar and Nacl.
I don't know a think about Satoshi's competence (I couldn't, because nobody knows who he is), but Moxie Marlinspike has spent over 15 years building his competence. If you're Moxie, build whatever you want.
* Added a co-author (Tadayoshi Kohno)
* Added handy exercises for self-study (presumably the work of Kohno)
* Buried the opening "Design Philosophy" chapter in the following "Context" chapter, in a more nuanced, mature form
* Drops a discussion of UMAC for one of GMAC which is similar in that they both eschew the use of normal hash functions for something called a "universal" hash
* Discussion of OCB and CCM modes is updated with info about CWC and GCM, since that took place in the publishing interim
* Index is only a page longer, but seems more complete
* Reduced from 410 pages to 353, with a font that appears slightly larger and much less LaTeX-ugly; perhaps the kerning is better too?
That's all I found in 15 minutes of skimming. Note that flaws which were understandable in Practical are more glaring in Engineering: recommending XML where JSON would be better, advocating MAC-then-encrypt rather than encrypt-then-MAC, etc. I probably would not have purchased Engineering if I had realized how minor its updates were. It would be better to purchase if you don't own either book, though.
I dont think this is easy at all just lots of articles saying dont even try it, when I bet theres more than competent people here like you who could probably pull off impressive alpha software for long and thorough peer review instead of us all being stuck with decades old clunky software like Truecrypt or GnuPG Assistant.
Who knows maybe in a year cryptocat will be excellent software at least the devs listen to auditors now
I find your sentiment about GnuPG a little galling. GnuPG is widely trusted and one of the most reviewed cryptosystems in the world; you advocate that it should be replaced --- by Cryptocat, no less --- because you find it "clunky". It's as if the thought hadn't occurred to you that a better exercise than designing one's own vanity cryptosystem might instead be to come up with a new UX for an existing trustworthy system.
I'm curious as to what web application you foresee supplanting Truecrypt, which is a full-disk encryption system whose entire UX is "enter the password to access this disk".
TC is clunky and has distro rights problems so a lot of releases like Tails are dumping it.
I'm a reasonably competent home mechanic. I happily rebuild engines and gearboxes for cars and motorcycles at home. I can modify and tune engines. I easily do all my households vehicle maintenance. And I happily help friends out with their repairs and maintenance. One thing I won't do though, is fix a friends brakes. I'm happy working on my own brakes, and happy to accept the responsibility for my actions. I won't take hat responsibility on for friends though. If you're not happy/capable of fixing your own brakes, take it to someone qualified and insured.
I think crypto is the same. There's nothing wrong with learning about and writing your own crypto as a curious amateur. But deploying that crypto where it can get other people killed is a bigger deal. Don't be "the cryptocat guy", "Oh yeah, I just found out you can't use water for brake fluid, turns out it boils when it gets hot! Who knew? Anyway, I just put brake fluid in my brakes, you should probably upgrade yours too sometime…"
I think if you want to _deploy_ crypto to other people, you owe it to yourself to have at least as much "professional training" as an auto mechanic gets before they're allowed to repair your brakes. And to further stretch the analogy - I'll point out tha most mechanics these days don't "repair" much in brake systems, they'll just replace large components - its becoming more common to not be able to buy seals and pistons any more - you're expected to just replace entire calipers or master cylinders. In my head that's the same approach as saying "I'll choose to use GPG or OpenSSL, but I won't 'do my own crypto'" - for someone who's _not_ prepared to put in a few hundred hours of proper crypto training, I think "rolling your own crypto software" is something best left to personal/educational projects, and never deployed I a way that other people might rely upon it.
...a system for which there is no security definition, no security proof, a known polynomial time attack (for some vague notion of "attack"), etc. I do not think this is the best example you can come up with.
One of the problems here is that cryptography cannot just be cobbled together from component pieces. Things do not always compose securely. Bitcoin is not a signature system, so even if the ECDSA implementation is perfect it does not guarantee that Bitcoin is secure. One of the things that makes cryptography, especially in the public-key setting, difficult is the very precise assumptions and very precise definitions of security; it is easy to make an assumption that is not implied by a security definition, and very easy to violate a key assumption without even realizing it. Worse, cryptosystems must be composed with other software, and such compositions can be insecure (which is basically what happened with Skype).
It's not that people should be scared away. Rather, we need to develop better tools that help programmers catch or avoid these kinds of bugs.
Result is SHA3 full disk for Android. Its certainly not foolproof or nor do I claim its secure but a lot of people are digging through the source and forensics hackers are interested in seeing what they can do with it. I realize I broke cardinal rule of using something that hasn't been proven for decades first (like AES 256) but its been a good learning experience thats for sure.
Really important to know how to be safe and what to look out for. I wasn't getting the feeling that many infosec professionals on HN were able/willing to outline reasonable guidelines for experienced devs/admins to follow.
What I perceive is that the problem isn't really that "infosec professionals on HN" are unwilling to teach developers, but rather that we're not teaching developers what they want to hear about crypto.
I think we're on the same page here, but coming at it from different perspectives. I often have to find ways to secure as best as possible insecure systems that are already built. And I'm trying to find ways to incrementally improve systems over time so they get more and more secure.
I can't wait to deploy code until its 100% secure, or the startups I've worked for would just find someone else to do the job who wouldn't be a 'blocker'.
I'm just rebutting the idea --- which maybe you didn't mean --- that elitist infosec people were trying to set themselves up as gatekeepers. The opposite is true. Sean and I are working hard on getting as much of what we know about breaking cryptosystems into the challenges (set 7 is coming out probably next week, and I'm working on ECC stuff for set 8 now). We want the info out.
But look at the numbers I just posted: 8100 people have started the challenges. Just 51 people have managed to finish. I like the challenges a lot, but candidly: on the scale of professional cryptographic research, it's pretty basic; being among the 0.5% of challenge finishers wouldn't qualify you to design cryptosystems.
That's fine if your working on a social network for cats, or another rage face Internet meme generator, but please don't use that excuse if you're storing my credit card details or health records (or writing an encrypted chat client you're promoting to political activists who's lives might literally depend on it).
It is possible to learn it but learn it first and ship it to the public later or if you must with great big experiment/insecure warnings all over it.
Don't get me wrong I am a huge Debian fanboy, but how much crypto code do Debian developers write?
The historical answer seems to have been "too much"...
"Luciano Bello discovered that the random number generator in Debian's openssl package is predictable. This is caused by an incorrect Debian-specific change to the openssl package (CVE-2008-0166). As a result, cryptographic key material may be guessable."
I doubt that very much, based on reading the original Bitcoin paper and his posts to the cryptography mailing list. More than likely Satoshi was an amateur/enthusiast.
Moxie Marlinspike doesn't seem to be scared of it either. According to him it's not impossible to learn simple, tried and true methods for crypto engineering that are all spelled out in Schneier's books and various white papers. These standards were completely ignored by the cryptocat guys (and ignored repeated warnings from auditors). So if you can read, comprehend and do bare minimum research of NIST standards you're pretty safe rolling your own crypto software if you know about attention to detail, the doom principal, PRNGs and their flaws, and know not to attempt to make your own primitives. If you guy's can push out incredibly complex and relatively secure financial trading software there's no reason you can't roll your own SHA-256 on your Android phone replacing SHA-1 FDE or even design Redphone like Moxie did. Would also help if you hung around hashcat forums, read Schneier's cryptogram newsletter, and watched some lectures about software crypto engineering.