CMAC
From Wikipedia, the free encyclopedia
In cryptography, CMAC (Cipher-based MAC) is a block cipher-based message authentication code algorithm, it may be used to provide assurance of the authenticity and, hence, the integrity of binary data. This mode of operation fixes security deficiencies of CBC-MAC (CBC-MAC is secure only for fixed-length messages).
The core of the CMAC algorithm is a variation of CBC-MAC that Black and Rogaway proposed and analyzed under the name XCBC and submitted to NIST . The XCBC algorithm efficiently addresses the security deficiencies of CBC-MAC. Iwata and Kurosawa proposed an improvement of XCBC and named the resulting algorithm One-Key CBC-MAC (OMAC) in their papers and . They later submitted OMAC1 , a refinement of OMAC, and additional security analysis . The OMAC1 variation efficiently reduces the key size of XCBC. CMAC is equivalent to OMAC1.
To generate an l-bit CMAC tag t of message m using a b-bit block cipher E and secret key k one first generates two sub-keys k1 and k2 using the following algorithm (this is equivalent to multiplication by x and x2 in a finite field). Let signify a standard left-shift operator:
- Calculate a temporary value k0 = Ek(0).
- If msb(k0) = 0 then else , where C is a certain b-bit constant (namely the non-leading coefficients of the lexicographically first irreducible degree-b binary polynomial with the minimal number of ones).
- If msb(k1) = 0 then else
As a small example, suppose b = 4, C = 00112, and k0 = Ek(0) = 01012. Then k1 = 10102 and k2 = 01112.
The CMAC tag generation process is as follows:
- Divide message into b-bit blocks , where are complete blocks.
- If mn' is a complete block then else
- Let c0 = 00...02.
- For , calculate
- Output t = msbl(cn).
The verification process is as follows:
- Use the above algorithm to generate the tag.
- Check that the generated tag is equal to the received tag.
[edit] References
- ^ NIST, Recommendation for Block Cipher Modes of Operation: The CMAC Mode for Authentication, Special Publication 800-38B.
- ^ J. Black, P. Rogaway, A Suggestion for Handling Arbitrary-Length Messages with the CBC MAC, available from NIST.
- ^ J. Black, P. Rogaway, CBC MACs for arbitrary-length messages: The three-key constructions, Advances in Cryptology—Crypto 2000.
- ^ T. Iwata, K. Kurosawa, OMAC: One-Key CBC MAC, Fast Software Encryption 2003.
[edit] External links
- RFC 4493 The AES-CMAC Algorithm
- RFC 4494 The AES-CMAC-96 Algorithm and Its Use with IPsec
- RFC 4615 The Advanced Encryption Standard-Cipher-based Message Authentication Code-Pseudo-Random Function-128 (AES-CMAC-PRF-128)
|