Comment

Comment by rainsford

Length extension attacks are only one of the issues you can run into, so even if you use SHA3 or truncated SHA2 as your hash primitive you still shouldn't be rolling your own keyed hash construction.

The article references this as "YoloMAC" with a link to a pretty good Trail of Bits blogpost about it. But the TLDR is that just prepending the key to the message can lead to ambiguous encoding problems, so you still need to add extra complexity to your hand rolled keyed hash to handle things that the underlying hash primitive isn't going to protect you from on it's own. You're better off using a non-hand-rolled construction that protects against all the things including length extension.

parent rainsford 19 days ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton