Re:NIST Retires SHA-1 Cryptographic Algorithm
by danbruc on Thursday December 15, 2022 @11:48AM
(#34002231)
Just as a note, the primary reason for the truncated variants is not to get a shorter hash but to prevent extension attacks. For variants without truncation, the final hash is the entire internal state, therefore an attacker can calculated the hash of any message that starts with the original message and then has additional content without knowing the original message. Truncating the hash denies access to the complete internal state and makes this impossible.
[ Parent
| on HN ]
Re:NIST Retires SHA-1 Cryptographic Algorithm
by cesarb on Thursday December 15, 2022 @01:04PM
(#34003271)
Another way to prevent extension attacks is to make the internal state different whenever the current block is the last block, as done for instance in BLAKE3 (which has as an additional input on each block a set of flags, and one of the flags says "this is the last block").