CMAC

From Wikipedia, the free encyclopedia

This article is about cryptography, for the neural network term see Cerebellar Model Articulation Controller.

CMAC (Cipher-based MAC) [1] 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 [2] and submitted to NIST [3]. 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 [4] and [5]. They later submitted OMAC1 [6], a refinement of OMAC, and additional security analysis [7]. 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 a \ll b signify a standard left-shift operator:

  1. Calculate a temporary value k0 = Ek(0).
  2. If msb(k0) = 0 then k_1 = k_0 \ll 1 else k_1 = (k_0 \ll 1) \oplus C, where C is a b-bit constant.
  3. If msb(k1) = 0 then k_2 = k_1 \ll 1 else k_2 = (k_1 \ll 1) \oplus C.

As a small example, suppose b = 4, C = 10102, and k0 = Ek(0) = 01012. Then k1 = 10102 and k2 = 11102.

The CMAC tag generation process is as follows:

  1. Divide message into b-bit blocks m = m_1 \| \cdots \| m_{n-1} \| m_n', where m_1, \ldots, m_{n-1} are complete blocks.
  2. If mn' is a complete block then m_n = k_1 \oplus m_n' else m_n = k_2 \oplus (m_n' \| 10\ldots0_2).
  3. Let c0 = 00...02.
  4. For i = 1,\ldots, n, calculate c_i = E_k(c_{i-1} \oplus m_i).
  5. Output t = msbl(cn).

The verification process is as follows:

  1. Use the above algorithm to generate the tag.
  2. Check that the generated tag is equal to the received tag.

[edit] References

  • ^  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, available from NIST.
  • ^  T. Iwata, K. Kurosawa, OMAC: One-Key CBC MAC, Fast Software Encryption 2003.
  • ^  T. Iwata, K. Kurosawa, OMAC: One-Key CBC MAC—Addendum, available from NIST.
  • ^  T. Iwata, K. Kurosawa, Stronger Security Bounds for OMAC, TMAC, and XCBC, available from NIST.

[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)


Hash algorithms: Gost-Hash | HAS-160 | HAS-V | HAVAL | MDC-2 | MD2 | MD4 | MD5 | N-Hash | RadioGatún | RIPEMD | SHA family | Snefru | Tiger | VEST | WHIRLPOOL | crypt(3) DES
MAC algorithms: DAA | CBC-MAC | HMAC | OMAC/CMAC | PMAC | UMAC | Poly1305-AES | VEST
Authenticated encryption modes: CCM | EAX | GCM | OCB | VEST   Attacks: Birthday attack | Collision attack | Preimage attack | Rainbow table | Brute force attack
Standardization: CRYPTREC | NESSIE   Misc: Avalanche effect | Hash collision | Hash functions based on block ciphers
Cryptography
v  d  e
History of cryptography | Cryptanalysis | Cryptography portal | Topics in cryptography
Symmetric-key algorithm | Block cipher | Stream cipher | Public-key cryptography | Cryptographic hash function | Message authentication code | Random numbers