Cryptographic hash function
In cryptography, a cryptographic hash function is a hash function with certain additional security properties. A hash function takes a long string (or message) as input and produces a "digest" of that message. Loosely speaking, the security properties are intended to ensure that the digest looks "random" and does not leak any information about the message itself, and that other messages can not be found that produce the same digest. Note that checksums (and CRCs) are quite distinct from cryptographic hash functions in application and are not interchangeable.Mathematically, a cryptographic hash function is a hash function that is:
- Preimage resistant (one way): given h such that h=hash(m1) it should be hard to find m1.
- Second preimage resistant: given h and m1 such that h=hash(m1) it should be hard to find m1 ≠ m2 such that h=hash(m2).
- Collision-free: it should be hard to find two messages m1 and m2 such that hash(m1)=hash(m2). Because of the birthday paradox this means the hash function has to have a larger image than is required by being preimage-resistance property.
In practice, of course, Alice and Bob would be computer programs, and the secret would be something less frivolous. In cryptography, the above application is called timestamping. The other important application of secure hashes is verification of message integrity.
SHA-1 and MD5 are the most commonly used cryptographic hash functions.
List of cryptographic hash functions
MD5, RIPEMD-160, SHA, Snefru, Tiger