An almost strongly universal hash family relaxes the exact ordered pair balance of a strongly universal hash family. In the convention used here, choose with the uniform distribution on a finite set from a family with possible outputs. Every individual output remains uniform, and for every distinct pair of inputs and every specified ordered pair of outputs ,
Equivalently, the conditional probability is at most . This asks how predictable a second output can become after the first is known.
For , strongly universal hash families give : learning one output leaves each specified second output with conditional probability . A looser guarantee permits a specified ordered pair to have probability as large as , while each individual output still has probability . Summing over the five equal ordered pairs bounds the collision probability by , rather than the required of a universal hash family. Thus an almost strongly universal hash family need not be a universal hash family. Necessarily , because the conditional probabilities sum to one; equality recovers a strongly universal hash family. This relaxation is useful in Wegman–Carter authentication, where efficiency can be traded against a quantified forgery bound within a complete message authentication protocol.
Let and choose uniformly from the finite family . All bounds below must hold for every pair of distinct inputs .
A universal hash family, also called universal2, satisfies . A strongly universal hash family satisfies
Thus the two outputs are independent and uniform; summing over gives the collision condition. An almost strongly universal hash family permits a larger conditional guessing bound. In the -almost-strongly-universal convention used here,
equivalently . Necessarily , with giving strong universality. Stating this normalization matters because the name alone does not specify the allowed forgery probability.
Here is an explicit polynomial almost strongly universal hashing construction and a one-use message authentication protocol. Use a publicly specified finite field , where . Encode a fixed-length -bit message as field elements , padding the final block in a fixed way. Both parties know the length, so this encoding is injective. They share independent uniform secret field elements , requiring shared secret bits. Define
For every message, the output is uniform because of . For distinct messages and prescribed tags , the condition determines exactly one value of for each . The remaining condition is
Its left-hand side has a nonzero coefficient of positive degree, so subtracting the specified constant gives a nonzero polynomial of degree at most . By the root bound for a polynomial, there are at most possible field elements . Consequently
and this is an -almost-strongly-universal family with , provided . The powers start at one deliberately: a message coefficient at power zero could give a known constant tag shift, allowing a deterministic substitution.
Alice sends the message and its tag over the public channel. Bob accepts only if his independently computed tag agrees. An attacker who has seen no tag guesses one with probability . After seeing a valid pair , an attacker substituting a different message and any chosen tag succeeds with conditional probability at most . This remains true when the choice of depends on the observed pair: the bound is uniform over all those choices. More explicitly, the observed tag leaves uniform because each possible has exactly one compatible secret mask .
For a desired forgery bound , choose . Since and , the substitution bound is at most . The secret requirement is
For a long message this is much shorter than its bits. This is Wegman–Carter authentication: a keyed hash plus a fresh secret one-time pad on the tag. It authenticates the message rather than concealing its contents. Use the key once for the guarantee just established; multiple authenticated messages require fresh masks and a reuse security analysis. Authenticate lengths and sequence identifiers too if variable lengths or replay protection are required.
A strongly universal hash family makes every ordered pair of outputs equally likely: for distinct inputs and arbitrary specified outputs ,
Thus the two outputs are independent random variables, each with the uniform distribution on a finite set. Adding the equal ordered pairs gives collision probability , so the family is also a universal hash family.
Here is a completely enumerable example. In the finite field , take the affine functions , using modular arithmetic modulo . Choose and as independent random variables, each with the uniform distribution on a finite set of all five finite field elements , including . There are equally likely hash functions. For , the ordered pair is . For instance gives ; gives . Every prescribed occurs exactly once, at .
Figure 1.
Enumerating all affine hash functions over the finite field with five elements
. Each cell shows the unique coefficient pair (a,b) producing the displayed outputs at 0 and 1. Removing a = 0 deletes the diagonal and leaves dependent outputs despite uniform individual values. Details.
Each row contains five choices, so each individual output has probability . Each cell has probability , and the five diagonal cells give collision probability . For any distinct , the same conclusion follows from and : a nonzero finite field element has a unique inverse. This is the beauty of the construction: two small random coefficients provide exact pair balance without choosing five unrelated values.
The example uses equal-sized input and output sets to make every choice visible; it illustrates the family definitions rather than compression. In a larger input set, a hash function cannot avoid all collisions into five buckets. What a universal hash family controls is the fraction of its members that collide on each fixed pair, rather than the existence of any collision anywhere.
Restricting to leaves permutations with zero collision probability for distinct inputs. Individual outputs remain uniform, but given , the four values other than each have conditional probability and has zero. Hence these outputs are not independent random variables: this is a universal hash family but not a strongly universal hash family. Finally, the full -member example contains five constant functions, with immediately visible collisions. Its pair guarantee concerns a random choice of hash function, and makes no claim of cryptographic collision resistance.
Universal hash family 2026-10-13
A universal hash family is a finite collection of hash functions into an output set of size such that, for any fixed distinct inputs ,
The choice of uses the uniform distribution on a finite set. The keys are fixed before that choice: the randomness belongs to the hash function, so the guarantee does not assume naturally random keys. Choose one member and keep it while using the table; changing it requires redistributing the stored records. The bound holds separately for every distinct pair, without requiring uniform individual outputs or independent random variables. A strongly universal hash family supplies those stronger properties.
The practical payoff follows from linearity of expectation. If stored keys are distinct from a fixed query, let count how many share its bucket. Then : each key contributes at most to the expected value. With stored keys and buckets, an unsuccessful search encounters at most one record on average over the random choice of hash function. This is an expected value, not a limit on every search; one unlucky choice can still create a long chain.
This calculation needs no independence between the collision events: linearity of expectation adds their individual probabilities. The fixed-query condition matters, since deliberately choosing keys after inspecting the selected hash function can target a crowded bucket.
Carter and Wegman introduced this way of analyzing storage and retrieval in their 1977 paper: average over a chosen class of hash functions while allowing any fixed sequence of inputs. Their 1979 journal version develops the same universal-pair collision condition and constructions. The insight is useful because a randomized algorithm can obtain a performance guarantee through its own choices, even when its inputs have inconvenient patterns.[ref][ref]