Cryptography and Network Security Chapter 12 discusses hash and message authentication code (MAC) algorithms. It covers popular hash functions like SHA-512 and Whirlpool, as well as how to construct MACs using hash-based MACs like HMAC and cipher-based MACs like CMAC. HMAC is the preferred way to construct a MAC using a cryptographic hash function. CMAC improves on CBC-MAC by using two keys and padding to avoid message size limitations.