Chapter 6
Message Authentication Codes
A message authentication code, or MAC, is a construction that detects tampering with messages. Encryption prevents Eve from reading the messages but does not prevent her from manipulating the messages. This is where the MAC comes in. Like encryption, MACs use a secret key, K, known to both Alice and Bob but not to Eve. Alice sends not just the message m, but also a MAC value computed by a MAC function. Bob checks that the MAC value of the message received equals the MAC value received. If they do not match, he discards the message as unauthenticated. Eve cannot manipulate the message because without K she cannot find the correct MAC value to send with the manipulated message.
In this chapter we will only consider authentication. The mechanisms for combining encryption and authentication will be dealt with in Chapter 7.
6.1 What a MAC Does
A MAC is a function that takes two arguments, a fixed-size key K and an arbitrarily sized message m, and produces...