ArticleslgStudy

computer science

UMAC (cryptography)

UMAC (cryptography) is a computer 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 UMAC (cryptography) rather than just read about it. In short: In cryptography, a universal hashing message authentication code, or UMAC, is a message authentication code (MAC) calculated using universal hashing, which involves choosing a hash function from a class of hash functions according to some secret (random) process and applying it to the message. The resulting digest or fingerprint is then encrypted to hide the identity of the hash function that was used.

Key takeaways

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

Reference excerpt

In cryptography, a universal hashing message authentication code, or UMAC, is a message authentication code (MAC) calculated using universal hashing, which involves choosing a hash function from a class of hash functions according to some secret (random) process and applying it to the message. The resulting digest or fingerprint is then encrypted to hide the identity of the hash function that was used. A variation of the scheme was first published in 1999. As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message. In contrast to traditional MACs, which are serializable, a UMAC can be executed in parallel. Thus, as machines continue to offer more parallel-processing capabilities, the speed of implementing UMAC can increase. A specific type of UMAC, also commonly referred to just as "UMAC", is described in an informational RFC published as RFC 4418 in March 2006. It has provable cryptographic strength and is usually substantially less computationally intensive than other MACs. UMAC's design is optimized for 32-bit architectures with SIMD support, with a performance of 1 CPU cycle per byte (cpb) with SIMD and 2 cpb without SIMD. A closely related variant of UMAC that is optimized for 64-bit architectures is given by VMAC, which was submitted to the IETF as a draft in April 2007 (draft-krovetz-vmac-01) but never gathered enough attention to be approved as an RFC.

Background

Universal hashing

Let's say the hash function is chosen from a class of hash functions H, which maps messages into D, the set of possible message digests. This class is called universal if, for any distinct pair of messages, there are at most |H|/|D| functions that map them to the same member of D. This means that if an attacker wants to replace one message with another and, from his point of view, the hash function was chosen completely randomly, the probability that the UMAC will not detect his modification is at most 1/|D|. But this definition is not strong enough — if the possible messages are 0 and 1, D={0,1} and H consists of the identity operation and not, H is universal. But even if the digest is encrypted by modular addition, the attacker can change the message and the digest at the same time and the receiver wouldn't know the difference.

Strongly universal hashing A class of hash functions H that is good to use will make it difficult for an attacker to guess the correct digest d of a fake message f after intercepting one message a with digest c. In other words,

Pr h ∈ H [ h ( f ) = d | h ( a ) = c ] {\displaystyle \Pr _{h\in H}[h(f)=d|h(a)=c]\,}

needs to be very small, preferably 1/|D|. It is easy to construct a class of hash functions when D is field. For example, if |D| is prime, all the operations are taken modulo |D|. The message a is then encoded as an n-dimensional vector over D (a1, a2, ..., an). H then has |D|n+1 members, each corresponding to an (n + 1)-dimensional vector over D (h0, h1, ..., hn). If we let

h ( a ) = h 0 + ∑ i = 1 n h i a i {\displaystyle h(a)=h_{0}+\sum _{i=1}^{n}{h_{i}}{a_{i}}}

we can use the rules of probabilities and combinatorics to prove that

Pr h ∈ H [ h ( f ) = d | h ( a ) = c ] = 1 | D | {\displaystyle \Pr _{h\in H}[h(f)=d|h(a)=c]={1 \over |D|}}

If we properly encrypt all the digests (e.g. with a one-time pad), an attacker cannot learn anything from them and the same hash function can be used for all communication between the two parties. This may not be true for ECB encryption because it may be quite likely that two messages produce the same hash value. Then some kind of initialization vector should be used, which is often called the nonce. It has become common practice to set h0 = f(nonce), where f is also secret. Notice that having massive amounts of computer power does not help the attacker at all. If the recipient limits the amount of forgeries it accepts (by sleeping whenever it detects one), |D| can be 232 or smaller.

Example The following C function generates a 24 bit UMAC. It assumes that secret is a multiple of 24 bits, msg is not longer than secret and result already contains the 24 secret bits e.g. f(nonce). nonce does not need to be contained in msg.

NH and the RFC UMAC

NH Functions in the above unnamed strongly universal hash-function family uses n multiplies to compute a hash value. The NH family halves the number of multiplications, which roughly translates to a two-fold speed-up in practice. For speed, UMAC uses the NH hash-function family. NH is specifically designed to use SIMD instructions, and hence UMAC is the first MAC function optimized for SIMD. The following hash family is 2 − w {\displaystyle 2^{-w}} -universal:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with UMAC (cryptography)

Start with the simplest possible case. Write down what UMAC (cryptography) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer 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 UMAC (cryptography) 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 UMAC (cryptography) 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 UMAC (cryptography)

In research
UMAC (cryptography) appears in computer 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 UMAC (cryptography) 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
UMAC (cryptography) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Message authentication codes, so understanding it makes those chapters shorter.
In everyday life
Look for UMAC (cryptography) 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.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “UMAC (cryptography)” →

Affiliate

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

How to study UMAC (cryptography) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what UMAC (cryptography) 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 UMAC (cryptography) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is UMAC (cryptography) in simple terms?

In cryptography, a universal hashing message authentication code, or UMAC, is a message authentication code (MAC) calculated using universal hashing, which involves choosing a hash function from a class of hash functions according to some secret (random) process and applying it to the message. The…

Why does UMAC (cryptography) matter?

Because it connects several computer 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 UMAC (cryptography)?

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 UMAC (cryptography).

Tags

  • Message authentication codes

Keep exploring