Re:NIST Retires SHA-1 Cryptographic Algorithm
by GTP on Thursday December 15, 2022 @11:39AM
(#34002088)
Or use Keccak (which is the permutation that was chosen for SHA3), which lets you pick the length that you need.
Re:NIST Retires SHA-1 Cryptographic Algorithm
by kzrdude on Thursday December 15, 2022 @11:47AM
(#34002214)
Git has already implemented a solution based on SHA-2 with 256 bit output so that's unlikely to be changed for the time being. (But it has not really been launched in earnest, only as a preview feature.)
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.
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").
(I suspect this would be a good compromise for git, since so much tooling assumes a 160 bit hash, and yet we don't want to continue using SHA1)