3 ms·
You can just drop the end of the hash. That is essentially what sha-224, sha-384 , and sha-512/256 are. Or you can use a hash where the internal state is large
by masklinn 3y ago
You can just drop the end of the hash. That is essentially what sha-224, sha-384 , and sha-512/256 are.
Or you can use a hash where the internal state is larger than the output, which is the case of SHA3.
Note that this just protects against length extension, these are not MACs.
- tptacek 3y agoSHA3 KMAC is almost just this (a keyed hash) --- with a length appended, and some domain separation. You can make a MAC out of a truncated keyed SHA2 hash (but don't).