# Difference between hash function

In some paper, the terms "cryptographic hash function" and "deterministic hash function" would appear? I'm wondering what's their difference, and are there some other types of hash functions? Like the cryptonote whitepaper in 4.2.1

• All the cryptographic hash functions that we use in standards is deterministic. Dec 11, 2018 at 11:09
• Thanks for all the helps. So I can assume that if the term "cryptographic" does not appear it might not satisfy some security requirement? Dec 12, 2018 at 4:06

## 3 Answers

A hash function is a function taking an arbitrary length string as the input, and output a fixed length string. All hash functions are deterministic (correct me if I am wrong). Generally, a good hash function should map the inputs to its output range as uniformly as possible. Cryptographic hash functions have more requirements for security. The three most commonly used security properties are:

1. One-way: Given a hash value $$h$$ it should be difficult to find any message $$m$$ such that $$h = hash(m)$$.
2. weak collision resistance: Given an input $$m_1$$, it should be difficult to find a different input $$m_2$$ such that $$hash(m_1) = hash(m_2)$$.
3. collision resistance: It should be difficult to find two different messages $$m_1$$ and $$m_2$$ such that $$hash(m_1) = hash(m_2)$$.
• Maybe you should also explain what you understand by „deterministic“ Dec 11, 2018 at 14:17

You can define a hash function as any function which maps maps input of any length to a fixed length output. The hash by definition is deterministic. Wikipedia has a nice article too.

If you talk about cryptographic hash function, you place additional stronger requirements for the hash function which are necessary for information-security applications, such as collision resistance, pre-image resistance, infeasibility to compute the input, high avalanche effect, .. (full list in the article or in any serious cryptography course materials)

The main difference between non-cryptographic hash functions and cryptographic hash functions is that cryptographic hash functions must withstand serious attack. For example, non-cryptographic hash functions are expected to produce few hash collisions in normal use.