11-4 Hashing and authentication
Let be a class of hash functions in which each hash function maps the universe of keys to . We say that is k-universal if, for every fixed sequence of distinct keys and for any chosen at random from , the sequence is equally likely to be any of the sequences of length with elements drawn from .
a. Show that if the family of hash functions is -universal, then it is universal.
b. Suppose that the universe is the set of -tuples of values drawn from , where is prime. Consider an element . For any -tuple , define the hash function by
Let . Show that is universal, but not -universal. ( Find a key for which all hash functions in produce the same value.)
c. Suppose that we modify slightly from part (b): for any and for any , define
and . Argue that is -universal. ( Consider fixed -tuples and , with for some . What happens to and as and range over ?)
d. Suppose that Alice and Bob secretly agree on a hash function form -universal family of hash functions. Each maps from a universe of keys to , where is aprime. Later, Alice sends a message to Bob over the Internet, where . She authenticates this message to Bob by also sending an authentication tag , and Bob checks that the pair he receives indeed satisfies . Suppose that an adversary intercepts en route and tries to fool Bob by replacing the pair with a different pair . Argue that the probability that the adversary succeeds in fooling Bob into accepting is at most , no matter how much computing power the adversary has, and even if the adversary knows the family of hash functions used.
a. The number of hash functions for which is , therefore the family is universal.
b. For , could not be -universal.
c. Let be fixed, distinct -tuples. As and range over is equally likely to achieve every value from to since for any sequence , we can let vary from to .
Thus, is equally likely to be any of the sequences, so is -universal.
d. Since is -universal, every pair of is equally likely to appear, thus could be any value from . Even the adversary knows , since is -universal, then is universal, the probability of choosing a hash function that is at most , therefore the probability is at most .