Short and to the point. I'm assuming that it is not a kind of hash function that can be used universally. After having read about universal hash functions used with the one-time pad to form an authentication scheme, these things have bugged me out.
1 Answers
From Wikipedia:
In mathematics and computing universal hashing (in a randomized algorithm or data structure) refers to selecting a hash function at random from a family of hash functions with a certain mathematical property. This guarantees a low number of collisions in expectation, even if the data is chosen by an adversary. Many universal families are known (for hashing integers, vectors, strings), and their evaluation is often very efficient. Universal hashing has numerous uses in computer science, for example in implementations of hash tables, randomized algorithms, and cryptography.
Definition:
A randomized algorithm $H$ for constructing hash functions $h\colon U \to \{1,\ldots,M\}$
is universal if for all $x \neq y$ in $U$, we have
$\Pr_{h\gets H} [h(x) = h(y)] \leq 1/M$
From this answer:
Let $\Phi$ be a finite collection of hash functions that map a given universe $U$ of keys into the range $\{0, 1, 2,\ldots, m - 1\}.$
$\Phi$ is called universal if for each pair of distinct keys $x, y \in U$, the number of hash functions $h \in\Phi$ for which $h(x) = h(y)$ is precisely equal to $$\frac{\lvert\Phi\rvert}{m}.$$
With a function randomly chosen from $\Phi$, the chance of a collision between $x$ and $y$ where $x \neq y$ is exactly $\frac{1}{m}$.
- 49,816
- 3
- 122
- 230
- 181
- 4