-2
$\begingroup$

AFAIK, HMAC solves the collision problem of hash algorithms by mixing in a pre shared secret.

Can't we just use the pre shared secret to symmetrically encrypt data and leave out the hashing?

$\endgroup$
1
$\begingroup$

HMAC solves the collision problem of hash algorithms by mixing in a pre shared secret.

No, HMAC is a construction of a message authentication code based on a hash function. Specifically intended to be used with hash functions based on the Merkle-Damgård construction.

Can't we just use the pre shared secret to symmetrically encrypt data and leave out the hashing?

The premise of the question is wrong, so the question makes no sense. A message authentication code provides authenticity. I.e., the receiver can be certain that the message was not tampered with in transit. It does not, and does not aim to, provide confidentiality.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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