Message authentication code (MAC) provides a way to verify both the integrity and authenticity of a message. It is sometimes also called an authentication tag.
A MAC allows the recipient to ensure that a message has not been altered and that it truly originates from the expected sender.
With MAC, both the sender and the receiver share a secret key
There are multiple ways to generate a MAC, with the most common one being HMACS (hash-based message authentication code).