CBC-MAC is a cryptographic algorithm used to ensure the integrity and authenticity of a message. It combines the principles of block cipher encryption with a specific method of chaining the blocks together. In this process, the message is divided into fixed-size blocks, and each block is encrypted in such a way that the encryption of one block depends on the previous block’s output. This chaining mechanism creates a unique authentication tag for the entire message, which can be used to verify that the message has not been altered during transmission.
When a sender transmits a message, they compute the CBC-MAC by applying the encryption process to the message blocks and then sending the resulting authentication tag along with the message. The recipient can then perform the same computation on the received message and compare the calculated tag with the one provided. If the tags match, it confirms that the message is authentic and has not been tampered with. CBC-MAC is particularly useful in scenarios where message integrity is critical, as it provides a robust way to detect any unauthorized modifications.
[…] is a technique for constructing a message authentication code from a block cipher. The message is encrypted with some block cipher algorithm in CBC mode to create a chain of blocks such that each block depends on the proper encryption of the previous block. This interdependence ensures that a change to any of the plaintext bits will cause the final encrypted block to change in a way that cannot be predicted or counteracted without knowing the key to the block cipher.
https://book.hacktricks.xyz/cryptography/cipher-block-chaining-cbc-mac-priv