A hash function is a mathematical process that takes input data of any size, performs an operation on it, and returns output data of a fixed size. A cryptographic hash function is a special class of hash function that has certain properties which make it suitable for use in cryptography. It should have five key properties:
- The same message should always results in the same hash
- The hash value for any given message should be computed quickly
- It is infeasible to reverse
- Any minor change to a message should change the hash value extensively
- There will never be two different messages with the same hash value