Question: how does hmac provide authentication?
Answer: HMAC stands for Keyed-Hashing for Message Authentication. It's a message authentication code obtained by running a cryptographic hash function (like MD5, SHA1, and SHA256) over the data (to be authenticated) and a shared secret key. ... They both use cryptographic keys. And they both employ hash functions.