ArticleslgStudy

science

One-key MAC

One-key MAC is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand One-key MAC rather than just read about it. In short: 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.

One-key MAC — main illustration
One-key MAC — illustration

Key takeaways

  • One-key MAC belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect One-key MAC to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of One-key MAC from memory before moving on to harder problems.

Reference excerpt

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. The preferred name is now "OMAC2". The OMAC1 refinement, which became an NIST recommendation in May 2005 under the name CMAC. OMAC is free for all uses: it is not covered by any patents.

History 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, 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. They later submitted the OMAC1 (= CMAC), a refinement of OMAC, and additional security analysis.

Algorithm

To generate an ℓ-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:

Calculate a temporary value k0 = Ek(0). 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: 0x1B for 64-bit, 0x87 for 128-bit, and 0x425 for 256-bit blocks.) If msb(k1) = 0, then k2 = k1 ≪ 1, else k2 = (k1 ≪ 1) ⊕ C. Return keys (k1, k2) for the MAC generation process. As a small example, suppose b = 4, C = 00112, and k0 = Ek(0) = 01012. Then k1 = 10102 and k2 = 0100 ⊕ 0011 = 01112. The CMAC tag generation process is as follows:

Divide message into b-bit blocks m = m1 ∥ ... ∥ mn−1 ∥ mn, where m1, ..., mn−1 are complete blocks. (The empty message is treated as one incomplete block.) If mn is a complete block then mn′ = k1 ⊕ mn else mn′ = k2 ⊕ (mn ∥ 10...02). Let c0 = 00...02. For i = 1, ..., n − 1, calculate ci = Ek(ci−1 ⊕ mi). cn = Ek(cn−1 ⊕ mn′) Output t = msbℓ(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.

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

Implementations Python implementation: see the usage of the AES_CMAC() function in "impacket/blob/master/tests/misc/test_crypto.py", and its definition in "impacket/blob/master/impacket/crypto.py" Ruby implementation

References

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) OMAC Online Test More information on OMAC Rust implementation

Worked examples

Example 1 — a first encounter with One-key MAC

Start with the simplest possible case. Write down what One-key MAC claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to One-key MAC before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about One-key MAC ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of One-key MAC

In research
One-key MAC appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses One-key MAC in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
One-key MAC is common in secondary-school and first-year university syllabi. It links to neighbouring topics Finite fields, Message authentication codes, so understanding it makes those chapters shorter.
In everyday life
Look for One-key MAC outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study One-key MAC in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what One-key MAC means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain One-key MAC out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is One-key MAC in simple terms?

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.

Why does One-key MAC matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study One-key MAC?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on One-key MAC.

Tags

  • Finite fields
  • Message authentication codes

Keep exploring