MAC Based On The Hash Function
MAC Based On The Hash Function
MAC Based On The Hash Function
• L = number of blocks in M
• K =secret key; recommended length is n; if key length is greater than b, the key is
input to the hash function to produce an n-bit key
• K+ = K padded with zeros on the left so that the result is b bits in length
• The algorithm can be defined as using the cipher block chaining (CBC) mode
of operation of DES with an initialization vector of zero.
• The data (e.g., message) to be authenticated are grouped into contiguous 64-
bit blocks:
• If necessary, the final block is padded on the right with zeroes to form a full
64-bit block.
• Using the DES encryption algorithm E and a secret key , a data authentication
code (DAC) is calculated as follows.
O1 = E(K, D)
O2 = E(K, [D2 XOR O1])
O3 = E(K, [D3 XOR O2])
...........................
ON = E(K, [DN XOR ON-1])
Data Authentication Algorithm
Cipher-Based Message Authentication Code
(CMAC)
• First, let us define the operation of CMAC when
the message is an integer multiple of n of the
cipher block length b.
• For AES, the key size is 128, 192, or 256 bits; for
triple DES, the key size is 112 or 168 bits.
CMAC Structure
CMAC Structure