In cryptography, a cryptographic hash function is a transformation that takes an input and returns a fixed-size string, which is called the hash value. Hash functions with this property are used for a variety of computational purposes, including cryptography. The hash value is a concise representation of the longer message or document from which it was computed. The message digest is a sort of "digital fingerprint" of the larger document. Cryptographic hash functions are used to do message integrity checks and digital signatures in various information security applications, such as authentication and message integrity.
There is no formal definition which captures all of the properties considered desirable for a cryptographic hash function.
A cryptographic hash function h : M → Z is a mapping from the set of messages of arbitray length i.e., the domain M to a set of fixed length (approx. 160 bits) message digests i.e., the range Z .
These properties below are generally considered prerequisites:
- Preimage resistant (See one way function for a related but slightly different property): given h(m) it should be hard to find any m′ such that h ( m′ ) = h ( m ).
- Second preimage resistant : given an input m1 , it should be hard to find another input, m2 (not equal to m1 ) such that h ( m1 ) = h ( m2 ).
This property is implied by collision-resistance. Second preimage resistance is sometimes referred to as weak collision resistance .
- Collision-resistant : it should be hard to find two different messages m1 and m2 such that h ( m1 ) = h ( m2 ). This property is sometimes referred to as strong collision resistance .
Birthday Paradox: If there are n people having m possible birthdays and if n > (approx.) then with high probability (i.e., probability >
) there will be a pair of people having the same birthday.
Proof: The probability that all people having distinct birthday (assuming m > n ) is as follows:
=
≤ =
£
⇒ The probability that there is a pair of people having the same birthday ≥
.