CBC-MAC and DES-MAC
The original block-cipher MAC: secure only for fixed-length messages
Overview
CBC-MAC computes a tag by encrypting a message in CBC mode with a zero IV and keeping the last ciphertext block. It is one of the oldest MAC constructions, standardised for DES as DES-MAC in ANSI X9.9 and FIPS 113.
CBC-MAC XORs each message block into the previous cipher output and encrypts the result. When all messages have the same fixed length, this is a secure pseudo-random function. When lengths vary, an attacker who knows the tags of two messages can construct a third valid message-tag pair by splicing, because the tag of one message is the chaining value for the next. This led to the development of CMAC, which fixes the problem with subkey masking.
NextSSL includes generic CBC-MAC as described in ISO/IEC 9797-1 algorithm 1 and DES-MAC from the withdrawn FIPS 113, both for legacy interoperability. Some protocols prepend the length or use a separately derived final key, as EMAC and ISO/IEC 9797-1 algorithm 2 do, to make CBC-MAC safe for variable lengths. CCM mode uses CBC-MAC internally, with the length encoded in the first block.
History
1985–2001Specified in FIPS 113
Specified in NIST SP 800-38A
Security notes
Plain CBC-MAC is forgeable for variable-length messages and must not be used unless the length is fixed and authenticated. DES-MAC additionally relies on 56-bit DES and is broken by exhaustive key search. Use CMAC or HMAC instead.
Typical uses
Variants in NextSSL
2Frequently asked questions
Which CBC-MAC and DES-MAC variants does NextSSL include?
NextSSL registers 2 CBC-MAC and DES-MAC variants: cbc-mac, des-mac.