Hash functions

A hash function is function which can have a number of different properties in cryptography. Most often, it is required that the hash function is one-way or preimage resistant. If such a hash function exists, then many other primitives are known to exist. In other settings, it’s important that the hash function is collision resistant, meaning that it is hard to find two colliding inputs; when is negligible, this implies one-wayness — RS04.

Syntax

A hash function is a function where is the key space, is the domain, and is the range.

Properties

There are a number of different properties that different cryptographic protocols require of hash functions. Sometimes, even the particular assumptions are insufficient to prove security of a protocol. In this case, there is sometimes still hope to prove security when modeling a hash function as a random oracle.

Preimage resistance (one-wayness)

One of the most fundamental properties is preimage resistant or one-way. This is important in many computational complexity analyses.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{pr}}_{\hash,\calA}(\secpar)$}
\begin{algorithmic}
\State $k \getsr \calK$ ; $x \getsr \calD$
\State $y \gets \hash(k,x)$
\State $\hat{x} \gets \calA(k,y)$
\Return $[\hash(k,\hat{x}) = y]$
\end{algorithmic}
\end{algorithm}

A hash function is one-way or preimage resistant if for every efficient

is negligible. In this case, is called a one-way function (OWF).

Auxiliary-input one-wayness

A function , efficiently computable given the auxiliary input , is auxiliary-input one-way if for all efficient there are infinitely many on which inverts on a uniform input with probability negligible in — OW93.

Weak one-wayness

A function is weakly one-way if there is a polynomial such that for all efficient and all sufficiently large , : every efficient inverter fails with noticeable probability — Yao82a. Every one-way function is weakly one-way, and weak one-way functions yield one-way functions.

Distributional one-wayness

A function computable in polynomial time is distributionally one-way if there is a polynomial such that for all efficient and all sufficiently large ,

where is statistical distance; equivalently, the statistical distance between and a uniform element of , averaged over , is at least — IL89. Every one-way function is distributionally one-way — folklore; conversely, distributional one-way functions yield one-way functions — IL89.

Sub-exponential one-wayness

A function is sub-exponentially one-way if there is a constant such that for all sufficiently large , every adversary of size at most has .

Size-verifiable one-wayness

A one-way function is size-verifiable if the preimage-size problem lies in — AGGM06, BB15. It is approximately size-verifiable, a weaker condition, if the promise problem with yes-instances such that and no-instances such that lies in — BB15. A one-way permutation is size-verifiable, since every has exactly one preimage — standard. A size-verifiable one-way function is a one-way function.

Collision resistance

Often times, protocols require stronger properties than one-wayness alone. When is negligible, collision resistance implies preimage resistance, but not conversely — RS04.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{cr}}_{\hash,\calA}(\secpar)$}
\begin{algorithmic}
\State $k \getsr \calK$
\State $(\hat{x}_0, \hat{x}_1) \gets \calA(k)$
\Return $[\hash(k,\hat{x}_0) = \hash(k,\hat{x}_1) \wedge \hat{x}_0 \neq \hat{x}_1]$
\end{algorithmic}
\end{algorithm}

A compressing family with and , , is collision resistant, a collision-resistant hash function (CRHF), if for every efficient

is negligible. Compression is part of the definition because without it the notion is trivial: the identity has no collisions. The amount of compression is immaterial: Merkle–Damgård iteration turns a family compressing by one bit into a collision-resistant family from to for every polynomial — Dam89.

Target collision resistance (universal one-wayness)

The adversary commits to a target input before the key is sampled, then must find a second input colliding with it.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{tcr}}_{\hash,\calA}(\secpar)$}
\begin{algorithmic}
\State $(x, \st) \gets \calA_1(1^\secpar)$
\Comment{$\calA_1$ outputs $x \in \calD$ before seeing the key}
\State $k \getsr \calK$
\State $\hat{x} \gets \calA_2(\st, k)$
\Return $[\hash(k,\hat{x}) = \hash(k,x) \wedge \hat{x} \neq x]$
\end{algorithmic}
\end{algorithm}

A compressing family () is a universal one-way hash function (UOWHF), or target collision resistant, if for all efficient ,

is negligible — NY89. Collision resistance implies target collision resistance — standard.

Distributional collision resistance

Other results

Unknown results

Participates in

Builds on Hash function

Produces Hash function

Barriers