We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Message Authentication Code (MAC)

While checksums are useful on their own, they provide no authentication mechanism. For example, if the NSA intercepts a message in transit, they can maliciously alter the message and the checksum. When the message is received by the original recipient, they will think it hasn't been altered.

All a plain checksum does is protect against accidental alterations.

To get the protection we want from malicious attackers, we need to use a MAC, or Message Authentication Code

In short, a MAC is a checksum that is authenticated by a secret key. This means that if the message is altered by someone who doesn't have the secret key, the checksum will not match.