One-key MAC

From Wikipedia, the free encyclopedia
(Redirected from CMAC)
Jump to navigation Jump to search

Template:Short description Script error: No such module "redirect hatnote". One-key MAC (OMAC) is a family of message authentication codes constructed from a block cipher much like the CBC-MAC algorithm. It may be used to provide assurance of the authenticity and, hence, the integrity of data. Two versions are defined:

  • The original OMAC of February 2003, which is rarely used.[1] The preferred name is now "OMAC2".[2]
  • The OMAC1 refinement,[2] which became an NIST recommendation in May 2005 under the name CMAC.[3]

OMAC is free for all uses: it is not covered by any patents.[4]

History

The core of the CMAC algorithm is a variation of CBC-MAC that Black and Rogaway proposed and analyzed under the name "XCBC"[5] and submitted to NIST.[6] The XCBC algorithm efficiently addresses the security deficiencies of CBC-MAC, but requires three keys.

Iwata and Kurosawa proposed an improvement of XCBC that requires less key material (just one key) and named the resulting algorithm One-Key CBC-MAC (OMAC) in their papers.[1] They later submitted the OMAC1 (= CMAC),[2] a refinement of OMAC, and additional security analysis.[7]

Algorithm

File:CMAC - Cipher-based Message Authentication Code.pdf

To generate an Template:Mvar-bit CMAC tag (t) of a message (m) using a b-bit block cipher (E) and a secret key (k), one first generates two b-bit sub-keys (k1 and k2) using the following algorithm (this is equivalent to multiplication by x and x2 in a finite field GF(2b)). Let ≪ denote the standard left-shift operator and ⊕ denote bit-wise exclusive or:

  1. Calculate a temporary value k0 = Ek(0).
  2. If msb(k0) = 0, then k1 = k0 ≪ 1, else k1 = (k0 ≪ 1) ⊕ C; where C is a certain constant that depends only on b. (Specifically, C is the non-leading coefficients of the lexicographically first irreducible degree-b binary polynomial with the minimal number of ones: Template:Mono for 64-bit, Template:Mono for 128-bit, and Template:Mono for 256-bit blocks.)
  3. If msb(k1) = 0Script error: No such module "Check for unknown parameters"., then k2 = k1 ≪ 1Script error: No such module "Check for unknown parameters"., else k2 = (k1 ≪ 1) ⊕ CScript error: No such module "Check for unknown parameters"..
  4. Return keys (k1, k2) for the MAC generation process.

As a small example, suppose b = 4Script error: No such module "Check for unknown parameters"., C = 00112Script error: No such module "Check for unknown parameters"., and k0 = Ek(0) = 01012Script error: No such module "Check for unknown parameters".. Then k1 = 10102Script error: No such module "Check for unknown parameters". and k2 = 0100 ⊕ 0011 = 01112Script error: No such module "Check for unknown parameters"..

The CMAC tag generation process is as follows:

  1. Divide message into b-bit blocks m = m1 ∥ ... ∥ mn−1mnScript error: No such module "Check for unknown parameters"., where m1, ..., mn−1 are complete blocks. (The empty message is treated as one incomplete block.)
  2. If mn is a complete block then mn′ = k1mnScript error: No such module "Check for unknown parameters". else mn′ = k2 ⊕ (mn ∥ 10...02)Script error: No such module "Check for unknown parameters"..
  3. Let c0 = 00...02Script error: No such module "Check for unknown parameters"..
  4. For i = 1, ..., n − 1Script error: No such module "Check for unknown parameters"., calculate ci = Ek(ci−1mi)Script error: No such module "Check for unknown parameters"..
  5. cn = Ek(cn−1mn′)Script error: No such module "Check for unknown parameters".
  6. Output t = msb(cn)Script error: No such module "Check for unknown parameters"..

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.

Variants

CMAC-C1[8] is a variant of CMAC that provides additional commitment and context-discovery security guarantees.

Implementations

References

<templatestyles src="Reflist/styles.css" />

  1. a b Script error: No such module "citation/CS1".
  2. a b c Script error: No such module "Citation/CS1".
  3. Script error: No such module "Citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "Citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".

External links

Script error: No such module "Navbox".