I’ve seen that the question has been asked already but this is still confusing to me.
In a digital signature, Alice sends a message M
and the hash(M)
which is signed by her private key. Bob recomputes hash(M)
(that he retrieves with Alice’s public key) and ensures that he finds the same hash value as Alice.
Therefore he knows that the message M
is coming from Alice and that M
has not been tampered with during the transit. So, it looks like we get both authentication and integrity.
In the HMAC construction (or more generally MAC this is not the subject here), a shared key between Alice and Bob is appended to the hash of data. I agree that it provides also both message authentication and integrity but what does it provide more? In other words, in which situation is HMAC absolutely required?