3 ms·
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 off
by mmastrac 12y ago
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.
- zatkin 12y agoWould HMAC-SHA256 been a better recommendation in, the year that this presentation was given, 2010?
- dchest 12y ago"Just reviewed my "crypto in 1 hour" talk slides in preparation for giving this talk on Wednesday. 4 years after writing, no updates needed." -- https://twitter.com/cperciva/status/475359526145646593 https://twitter.com/cperciva/status/475359526145646593
- dchest 12y ago"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 https://twitter.com/cperciva/status/475360367191674881
- tptacek 12y agoI 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).
- deleted 12y ago[deleted]
- nly 12y agoI think you're confused? AES-GCM is an authenticated encryption mode. HMAC-SHA256 is just a cryptographic MAC. The two only share the same applications when the latter is combined with a non-authenticated encryption mode in an Encrypt-then-MAC construction. The problem with the polynomial AE modes is they are trickier to implement (AES is actually small, as is SHA).
- mmastrac 12y agoIn many cases where you use an HMAC, you'll also want to encrypt as well (ie: web cookies, tokens, etc). Because of this, I find it's much better just to go with AES-GCM from the start rather than discovering that you don't want to leak your internal DB identifiers later and tacking on the encrypt-then-mac. It also means that the implementation of the algorithm does the work of both authentication and privacy, whereas with HMAC-SHA256 (and HMAC-SHA256 + AES-CBC/CTR) you will see developers hand-rolling more of it, leaving more room for them to do it wrong. I also prefer that AES-GCM is a mode itself, while encrypt-then-mac generally requires a developer to do research into the appropriate encryption mode and other details required to "get this right".