1
$\begingroup$

Not all the cryptographic hash functions have the counter parameter for making messages be different for each counter value. But many accept a key parameter.

Is reasonable to use the key parameter as a counter?

Is it safe?

$\endgroup$

1 Answer 1

1
$\begingroup$

Hash functions don't have key as parameter. I assume you got that misconception from programming languages such as PHP where they allow you to set a key to turn them into HMAC, despite they're no longer plain hash anymore.

That counter is part of padding to make the message "Merkle-Damgaard-Compliant", and there are other ways to do that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.