A MAC (Message Authentication Code) is a short piece of cryptographic data that accompanies a message. It allows the recipient to verify that the message has not been altered and that it originated from a legitimate sender. Both parties share a secret key to compute and verify the code. Common variants include HMAC (based on hash functions) and CMAC (based on block ciphers). In practice, MACs appear in API authentication, VPN tunnels, and secure configuration file exchange. If you need to protect data in transit against tampering, a MAC is one of the most straightforward mechanisms available.