7 ms·
I would like to clarify: The thing that I said was "table stakes" for implementing cryptography was passing the algorithm test vectors, which this author's pre
by tptacek 9y ago
I would like to clarify:
The thing that I said was "table stakes" for implementing cryptography was passing the algorithm test vectors, which this author's previous post claimed as a security feature.
If you're unfamiliar with the concept, a test vector is a series of strings and intermediate values used to ensure that your (say) OCB3 is the same as everyone else's OCB3.
Had he asked, I'd further claim that not having dumb C bugs is also table stakes for cryptography, since serious crypto vulnerabilities happen at a higher level of abstraction. The author grazes past (somewhat disconcertingly) one such class of bugs when he discusses carry propagation and limb scheduling in the context of Poly1305. Improper carry propagation is an example of the kind of security vulnerability for which there are no test vectors and no memory safety validation tools.
You just have to know what a carry propagation bug is, where to look for them (not Poly1305), and what the impact of one is.
Hopefully, the author of this library does.
- lisper 9y ago> You just have to know what a carry propagation bug is This is one of the things that drives me nuts about the crypto community. The natural response upon reading, "You just have to know X" if you don't already know is to go search for X. Well, if you go search for "carry propagation bug" you will find lots of examples of carry propagation bugs being found and fixed, but no explanation of what one is. The thing that "you just have to know" is not so easy to find. The courteous thing to do when mentioning something that "you just have to know" but which is not easy to find is to provide a pointer or a short in-line explanation. When you don't do that you leave your reader with no choice but to publicly expose their ignorance of this purportedly crucial knowledge by asking, which I will now proceed to do as a public service: What the hell is a carry propagation bug? Where do you look for them? And what is their impact? And while we're at it, what are "table stakes"?
- steveklabnik 9y ago"table stakes" is an idiom that comes from poker. It's the amount you can win or lose in a single hand, that is, the smallest amount of money you need to have to be able to sit at the table and play the game.
- chubot 9y agoBeing able to Google unfamiliar terms is table stakes for participating in HN :) http://www.urbandictionary.com/define.php?term=table%20stakes http://www.urbandictionary.com/define.php?term=table%20stake...
- deleted 9y ago[deleted]
- Tomte 9y ago"Table stakes" in competetive Poker means that all you can bet is what's on the table, in front of you. So this old movie cliché where the protagonist has lost almost all his chips and needs a huge win, so he casually throws in his car keys and the title to his house in the middle of play is not allowed. Neither is grabbing your wallet and throwing cash in. The idea is that (a) rich people cannot bully others around at will with their huge wealth "in the background" and also (b) players are protected from losing possessions extraneous to the game.
- idlewords 9y agoIn this context, though, it means the minimum you need to play the game.
- jacobolus 9y agoYou’re getting confused between two different things with the same name. This use of “table stakes” means something like the minimum buy-in to join the table or the table’s minimum bet to play a hand. When used as an analogy, the table stakes are just features expected of anyone, not something special to advertise. For example, you wouldn’t say “I’m the best driver because I have a driver’s license and car insurance” – those things are just “table stakes” for drivers.
- KineticLensman 9y ago> And while we're at it, what are "table stakes"? (business) minimum entry requirement for a market or business arrangement OR (poker) limit on the amount a player can win or lose in the play of a single hand [1] [1] https://en.wikipedia.org/wiki/Table_stakes https://en.wikipedia.org/wiki/Table_stakes
- brians 9y agoCarry propagation is one pixel in the 4K movie that is safe crypto implementation. One reason not to link to trivia and factoids about safe crypto implementation is that it builds a dangerous false sense of competence. There are programs that teach this, but they take years. Nobody who's passed through that is interested in creating an easy scaffolding whose levels are unclear.
- pierrebai 9y agoI wish the meme that crypto is hard would just die. The reason is that the statements is wrong and is probably encourage exactly what it wants to discourage. Crypto is hard is not factually incorrect. The problem is that it is trivially correct, because programming is always hard. Every algorithm and design is hard to get right. The correct statement, and the one that should be repeated instead is that crypto's stakes are high. Getting it wrong carries bigger consequences than a normal program. So stop propagating that crypto is hard. (Because people do hard stuff everyday and might thus think they've got the right stuff to write crypto.) Say that crypto has too high stakes to be done off the cuff.
- idlewords 9y agoNo, crypto is actually hard. One difference from regular programming is that there really are no 'intermediate' errors. Experience shows that getting one small detail wrong is as bad as getting the whole thing wrong. I can't think of another programming domain where that holds.
- Kalium 9y agoIs it possible that you are expecting the cryptography community to be one organized around being newbie-friendly and encouraging to beginners? The crypto community has repeatedly been burned by overeager beginners with false senses of competence making rather nasty mistakes. Consequences can be dire, from destroying companies to getting people killed. On the lighter end, you have things like Decrytocat. In some arenas, it's appropriate and a good practice to assume that everyone reading is a beginner who needs 101-level info on everything. Webdev is a good example - CSS, or cascading style sheets, are good for handling the display logic of semantic markup. The stakes are low and the costs for screwing up trivial. With cryptography, it needs to be driven home to the idle reader that this is serious stuff.
- tptacek 9y agoDecryptocat isn't the lighter end of things. Snowden used it to communicate with Glenn Greenwald's associates during the same time period Decryptocat was found (there are worse flaws in that software than Decryptocat, by the way). Now you see the issue!
- lisper 9y ago> Is it possible that you are expecting the cryptography community to be one organized around being newbie-friendly and encouraging to beginners? Not at all. I'm not actually expecting anything. All I'm saying is that as a matter of common courtesy (in any field) if you're going to say, "You just have to know X" then you should do at least one of the following: 1. Check that if someone doesn't know X that they can get at least a lead on how to learn about it by searching for X. 2. Provide a pointer for someone who wants to learn about X to follow as a starting point 3. Provide a brief in-line primer on X If none of those conditions hold then it's not constructive to say, "You just have to know X." What you're really doing in that case is not providing useful information, but rubbing your audience's nose in the fact that they are ignorant and you are not, and worse, that you acquired your knowledge through some privileged channel to which they do not have ready access. Honestly, what possible reaction could you reasonably expect other than frustration?
- tptacek 9y ago
- nix0n 9y agoCarry propagation bugs are something that can go wrong in a bignum implementation. Bignum is what you need when you have one number that you're splitting between multiple variables (because it's a 256-bit number, and you want your library to work on 32-bit PCs, for example). Carry propagation is if part of your result is too large for one part of your number and needs to overflow into the next part. Actual carry propagation bug and bugfix available here: https://news.ycombinator.com/item?id=8857363 https://news.ycombinator.com/item?id=8857363
- tptacek 9y agoGive me a fucking break. Sean, Marcin, and I spent the better part of a year individually replying to tens of thousands of emails from people doing the Cryptopals challenges that we wrote and published for free. Do you know how much work that was? Here's a hint: it was a lot of work. There are a lot of charges you can level at me to try to win a dumb message board argument, but the one where I want cryptography to be a secret priesthood known only to the anointed select is not one of them --- nor is the argument that I haven't taken the time to help make these kinds of cryptographic attacks easier for people to learn about. Please immediately find one of those other arguments to substitute for this one, and, if you have it in you, take a moment to retract. Thanks in advance.
- jacobolus 9y agoRead charitably, his post is more an expression of frustration that this concept that is supposed to be an obvious well-known keyword was difficult to find out about in a google search. https://encrypted.google.com/search?hl=en&q=carry%20propagation%20bug https://encrypted.google.com/search?hl=en&q=carry%20propagat... This is more an indictment of the whole community that there aren’t clear glossaries or other introductory resources with good google juice, and doesn’t necessarily reflect much on your specific comment or intent. He could have phrased it much better, but I think you’re also overreacting.
- tptacek 9y agoI thought so too, but then I read his comment downthread about how my wording "rubbed his nose" into the fact that he doesn't know what a carry propagation bug is. Sorry, I stand by what I wrote.
- lisper 9y agoI do sincerely apologize for taking my frustrations out on you, because you have indeed gone above and beyond the call to help make crypto accessible. Nonetheless, I still stand by the substance of my comment: when you (not you specifically, but anyone) say, "You have to know X" you should check that doing a Google search for X yields some reasonable results, and if it doesn't, provide a hint on how to proceed.
- elsjaako 9y agoIsn't this the point of the usual advice, "don't write your own crypto"? There are a million gotchas, and most of these you've just gotta know.
- lisper 9y agoYes, and this is kind of the point I'm trying to make. "Don't write your own crypto" is the wrong message IMHO. The message should be something more like, "Absolutely, write your own crypto, because that's the best way to learn, and here's a pointer to how to get started. Just don't use the results of your early efforts for anything mission critical, and if you want to know why, read this..." And, taking my own advice, here's the link everyone should be pointing to: https://cryptopals.com https://cryptopals.com
- fapjacks 9y agoI have the strongest instinct that "Don't write your own crypto" is one of the few successful barrier-to-entry phrases in the same spirit as something like "Surfing sucks, don't try it".
- elsjaako 9y agoIsn't this the point of the usual advice, "don't write your own crypto"? There are a million gotchas, and most of these you've just gotta know.
- deleted 9y ago[deleted]
- loup-vaillant 9y ago> Improper carry propagation is an example of the kind of security vulnerability for which there are no test vectors I beg your pardon? Some tests vectors from the RFC are designed specifically to handle some overflow that if handled improperly will give you the wrong results. I have checked, this hits the relevant paths. Or were you talking about something else? By the way, I haven't attempted to implement curve25519 field arithmetic myself, that would have been suicide (compared to curve25519, Poly1305 is a piece of cake). It all comes from ref10, minus the left shift UB it had. > which this author's previous post claimed as a security feature. Here's my current view on security: correct software is secure, period. Vulnerable software is incorrect, period. Which means that anything that helps assert correctness is a security feature. Test vectors, sanitisers, static analysis, Valgrind… are all security tools, and passing any one of them increases confidence in the product, thus making it more secure. Add enough of these, and confidence gets close enough to 100% that we can deem it ready for production. So, yeah, test vectors are a security feature. Laughably insufficient by themselves, but still necessary to assert the security of a crypto suite. > Had he asked, I'd further claim that not having dumb C bugs is also table stakes for cryptography Yeah, sorry about that. I assumed the same, but I thought Valgrind had me covered at the time —oops. Using sanitisers on Monocypher has been quite the eye opener. I didn't realise how dangerous I used to be. I still have my doubts, by the way. While I would gladly trust Monocypher with my data by now, I don't dare openly recommending it over Libsodium just yet. That may have to wait for a serious external audit.
- tptacek 9y agoI feel like I'm reading you again claiming that the test vectors for an algorithm in the standards documents constitutes a battery of security tests for the algorithm. That's not the case; I think 'lisper will tell you the same thing, despite being much more on your side of this issue than I am. Test vectors are an implementation aid and mostly intended for interop. And yes, I believe I'm talking about a more complicated class of bugs than you are. For instance: OpenSSL's algorithm implementations pass test vectors (OpenSSL is FIPS certified, too). But OpenSSL has had recent carry propagation bugs. I am not concerned about your use of C, or about the presence of memory corruption bugs in your library. If I was going to harp on about that, I'd also have to go after everyone who's written a Markdown library. My concern is that the kinds of things you say you've done to ensure the security of your cryptography don't address real cryptographic vulnerabilities. You may have done other things and I just haven't read about them! I don't really care about your library one way or the other; the only thing I care about is the idea that if you pass test vectors and Valgrind is OK with your binary, you're probably OK. No!