by magicalhippo · 3y ago · 0 comments
Truncated SHA-2, eg SHA-512/256, has some resistance against length extension attacks[1] while non-truncated has none, so wouldn't that be the gold standard?
edit: Thinking a bit more, I guess there are a lot of interesting cases which are not prone to length extension attacks where the full SHA-512 would be better.
[1]: https://en.wikipedia.org/wiki/SHA-2#Comparison_of_SHA_functi...
My guess is that it’s a truncated md5(secret + data) or hmac. Either way, with a sufficient long a secret, I won’t be able to guess it (offline), and because of the truncation, length extensions also out of the question.
With only 48 bits of entropy, I can’t shake the feeling that there are practical attacks I have not considered.