Hash functions
Hash functions are mainly used in cryptography to check the integrity of messages, digital signatures, manipulation detection, fingerprints, and password storage. A function is a good hash function if the input string cannot be guessed based on the output. As hash functions convert random amounts of data to fixed-length strings, there may be some inputs that hash into the same string. Hash functions are created in such a way as to make these collisions extremely difficult to find. The most used hash functions are as follows:
MD2, MD4, and MD5 have 128-bits length and are not secure. SHA-1 has 160-bits length, but it is also not secure.
Hashed Message Authentication Code (HMAC)
Hashed Message Authentication Code (HMAC) is used when we need to check for integrity and authenticity. It provides both server and client with a public key and a private key. The private key is only known to the server and client, but the public key is known to all.
In the case of HMAC, the key and the...