Re:Whatever happened to SHA-256 support in Git?
by bawolff on Thursday June 23, 2022 @04:44PM
(#31854909)
Truncated sha256 is safer than sha-1 (depending of course on how much you truncate it, but given context lets assume truncating to size of sha-1 - 160 bits).
SHA-1 is quite broken at this point. SHA-256 is not. There aren't any practical non-generic attacks on full sha-256 and thus there wouldn't be any on the truncated version. The Wikipedia article goes into the different attacks on the two algorithms.
That said, if your concern is length extension attacks - strongly reccomend using sha-512/256 instead of trying to do your own custom thing.
SHA-1 is quite broken at this point. SHA-256 is not. There aren't any practical non-generic attacks on full sha-256 and thus there wouldn't be any on the truncated version. The Wikipedia article goes into the different attacks on the two algorithms.
That said, if your concern is length extension attacks - strongly reccomend using sha-512/256 instead of trying to do your own custom thing.