The Hash function is nothing but a mathematical algorithm.

Any function that can be used to map data of “ ARBITRARY “ size to data of a “ FIXED “ size.

The result of a hash function is called Hash values / Hash codes / Hash digest / Hashes / Fingerprint.

BASIC EXAMPLE:

Untitled

A cryptographic hash functions have 5 properties :

  1. DETERMINISTIC : The same message always results in the same hash.
  2. Quick to compute the hash value for any given message.
  3. It must be infeasible to determine the original message from its hash value except by trying all possible messages.That is hashes can’t be reversed.
  4. A small change to a message should change the hash value so extensively that the new hash value appears uncorrelated with the old hash value.
  5. It must be infeasible to find two different messages with the same hash value ( this would be called a “ HASH COLLISION “ ).

Points to remember while choosing a hash function :

  1. The longer the digest , the more secure the function.

  2. There are many different hash functions available.

  3. The most common cryptographic hash functions are,

    The below is the graph shown with various hash functions along with its computational speeds. We need to choose our hash functional that is highly secure and also it should have good computational speed. So choose wisely. According to below graph SHA-512 is the best option if you dont have access to use blake , else go with blake algorithm.

    Untitled

    SECURE HASH ALGORITHM :