Live data from Hacker News

Everything you need to know about cryptography in 1 hour (2010) [pdf]

daemonology.net

51–60 of 104 posts

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#51
I disagree with two big points in this talk, but I'm sorry to say they're the same two things I disagreed with last time, so this is going to be a boring comment.

First, dedicated AEAD cipher modes are superior to manually composing AES-CTR and HMAC-SHAx. AEAD modes provide both authentication and encryption in a single construction. AES-CTR+HMAC-SHAx involves joining two constructions to do the same thing.

Colin points to AES-GCM, the most popular AEAD mode, as an example of how AEAD modes can be more susceptible to side-channel attacks than AES-CTR+HMAC-SHAx. I don't think this is a strong argument for a couple reasons:

* AES-GCM is so far as I can tell no practical cryptographer's preferred AEAD mode; "whipping boy" might be a better role to ascribe to it.

* AES-GCM's side-channel issues are due principally to a hardware support concern (GMAC, AES-GCM's answer to HMAC, requires modular binary polynomial multiplication, which in pure software is table-driven, which creates a cache timing channel). That hardware support concern might be receding, and platforms that don't have AES-GCM might prefer a different AEAD mode anyways.

* Modern AEAD modes, of the sort being entered into CAESAR, have resilience against side channels as a design goal.

* But the most important rejoinder to Colin's preference for HMAC-SHAx over AEAD modes is this: HMAC-SHAx is responsible for more side-channel flaws than any other construction. Practically every piece of software that has implemented HMAC-SHAx has managed to introduce the obvious timing channel in comparing the candidate to the true MAC for a message. What's worse is, using AES-CTR+HMAC-SHAx in practice means that the developer has to code the HMAC validation themselves; it's practically an engraved invitation to introduce a new timing leak. Almost nobody codes their own AES-GCM.

I also think Colin is wrong about ECC, particular versus RSA.

RSA might be the most error prone cryptographic primitive available to developers. There are two big reasons for this:

* RSA has fussy padding requirements. The current best practices for RSA encryption and signing are OAEP and PSS (huge credit to Colin for getting this right in 2010). If you want to form an opinion about RSA, go read up on OAEP and ask yourself (honestly) if you would come up with anything resembling OAEP if you were called on to encrypt with RSA. Developers as a rule do not use OAEP; instead, most new software still uses PKCS1v15 padding, which introduces susceptibility to terrible vulnerabilities that can often be easily exploited in the wild. Even better are the Javascript developers who build RSA from first principles and skip the padding altogether (the fact that RSA padding is a requirement and not an annoyance to be avoided is why Nate Lawson says we should call it "RSA armoring" and not "RSA padding").

* RSA easily supports a direct encryption transform, which is widely used in practice. ECC software as a general rule does not synthesize an encryption transform from the ECDLP; instead, ECC software uses the ECDLP to derive a key, and then uses something like AES to actually encrypt data. You might be thinking, "that's how RSA software works too". But RSA in practice is subtly different: you can, for instance, easily encrypt a credit card number directly using RSA, or build a crappy key exchange protocol where the client encrypts (doesn't derive or sign, but encrypts) a key for the server. RSA and conventional DLP crypto therefore offer (encrypt, key-exchange, sign); ECC in practice offers just (key-exchange, sign). That's one less dimension of things developers have to get right in ECC cryptosystems.

Colin is smarter than me and much better trained in cryptography than I am. All I do is find and exploit crypto bugs in real software. I am usually as nervous as any of you are to challenge Colin about crypto, but I think I can win these two arguments. (Spoiler alert: Colin doesn't think so).

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#52
He doesn't know how to write even simple mathematics. E.g., he uses symbols n and k without definition. Without careful definitions right there in the context, such symbols mean nothing. He is not clear enough about what he means by x.

His lack of precision in his writing lowers confidence in the quality of what he has written.

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#53
post #46
post #8

The reason this is being (re)posted now is that I gave this talk at a Polyglot Vancouver meetup last night. Freed from the constraint of a conference schedule I actually took about 90 minutes to go through this talk this time (followed by another 30 minutes of questions).

I don't suppose there's a video of this available? Longer + decent Q&A sounds appealing.

There was a video camera. I assume it will be posted somewhere; I didn't ask.

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#54
post #44

Earlier quoted context omitted.

I always do that now. The only reason I didn't this time is that the slides were from 2010, before I updated my Makefile to automatically build both versions.

> that the slides were from 2010 Considering this, what do you think has changed in the past 5 years? Eg the slides mention SHA3 as a future option, now it is finalized and afaik usable. There is also one interesting thing about SHA3 which I learned recently, namely that it can apparently be easily used as MAC too: > Unlike SHA-1 and SHA-2, Keccak does not have the length-extension weakness, hence does not need the H…

what do you think has changed in the past 5 years? Eg the slides mention SHA3 as a future option, now it is finalized and afaik usable.

Not much has changed. I still think SHA3 is worth considering 5-10 years into the future; five years ago I was concerned about the implications of MD5 and SHA1 breaks on SHA2, but the lack of recent progress makes me happier with staying on SHA2 while SHA3 gets more analysis.

do you think it would be reasonable to add exception for "DON’T: Try to use a hash function as a symmetric signature." rule?

I mentioned this in the talk; even with SHA3 you need to be careful, since a simple "append and hash" would result in MAC("key", "data") == MAC("keyd", "ata"), which breaks the MAC assumptions. Yes, you can use SHA3 as a MAC, but make sure you know what you're doing.

ECC seems to be on the rise (or is it just my perception?). Do you think a revised slide set would include something more about elliptic curves?

ECC is getting more popular; not necessarily for the right reasons, though. (The big drivers seem to be "bitcoin uses this" and "the most common way of using this provides forward perfect secrecy".) That said, as mathematicians continue to attack ECC systems, I am gradually becoming more comfortable; the 2025 version of this talk might recommend using them, but for now I don't think it makes sense to change my recommendation (except for situations like bitcoin which specifically need ECC's advantages).

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#55
post #52

He doesn't know how to write even simple mathematics. E.g., he uses symbols n and k without definition. Without careful definitions right there in the context, such symbols mean nothing. He is not clear enough about what he means by x . His lack of precision in his writing lowers confidence in the quality of what he has written.

He doesn't know how to write even simple mathematics.

Umm...

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#56
post #51

I disagree with two big points in this talk, but I'm sorry to say they're the same two things I disagreed with last time, so this is going to be a boring comment. First, dedicated AEAD cipher modes are superior to manually composing AES-CTR and HMAC-SHAx. AEAD modes provide both authentication and encryption in a single construction. AES-CTR+HMAC-SHAx involves joining two constructions to do the same thing. Colin poi…

You are entitled to your opinions, no matter how wrong they are. ;-)

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#57
post #48
post #22

Earlier quoted context omitted.

Dan Boneh's free "Crypto 1" on coursera. A new session will be starting on the 30th of June. I've taken it myself and this is hands down one of the best MOOCs (and class overall) I've ever taken.

I agree, "Crypto 1" was excellent! On Coursera's website, in the upcoming section, it says that "Crypto 2" starts in 3 months. I hope that's true!

[deleted]

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#58
post #14
post #4

He recommends HMAC-SHA256 in this paper, but I think that AES-GCM is a better construction, as long as you understand the requirements for IV uniqueness. It offers significant improvements on top of the standard HMAC (privacy and additional out-of-band data) without adding much in terms of size.

"And I still maintain that recommendation. CTR+HMAC is far more robust against side channel attacks than any AE mode." -- https://twitter.com/cperciva/status/475360367191674881

I think Colin has a hard row to hoe with this argument, given how often HMAC implementations cough up timing vulnerabilities. Even if you're stuck with GCM, GCM has the advantage of having mercifully few implementations. Everyone writes their own HMAC verifiers (badly).

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#59
post #52

He doesn't know how to write even simple mathematics. E.g., he uses symbols n and k without definition. Without careful definitions right there in the context, such symbols mean nothing. He is not clear enough about what he means by x . His lack of precision in his writing lowers confidence in the quality of what he has written.

I am reminded of this: https://news.ycombinator.com/item?id=35079

Re: Everything you need to know about cryptography in 1 hour (2010) [pdf]

#60
post #8

The reason this is being (re)posted now is that I gave this talk at a Polyglot Vancouver meetup last night. Freed from the constraint of a conference schedule I actually took about 90 minutes to go through this talk this time (followed by another 30 minutes of questions).

Hey, I found a small typo in the presentation. On page 80, in "good" code sample, you can see:

    x |= MAC_computed[i] − MAC_computed[i];
It probably should be something like:

    x |= MAC_computed[i] − MAC_received[i];
Post reply on HN