MAC

We can use a symmetric key algorithm to protect the integrity of data. This is accomplished by computing a CBC residue. Simply encrypt the entire message in CBC mode and save only the final encrypted block (this is known as the CBC residue). This is illustrated here. The CBC residue is the MAC (message authentication code), or it is sometimes called a MIC (message integrity code). If any bit of the message is changed, the MAC is highly likely to change.

The receiver computes the CBC residue and and compares it with the received MAC. If they agree, he assumes the received data agrees with the sent data.

Can message confidentiality and integrity be obtained with a single CBC encryption? Surprisingly, the answer is no. See your textbook for details.