What are message digests and cryptographic hash functions?
A message in cryptography is any piece of data, big or small, that is processed by a cryptographic algorithm.
A cryptographic hash function is an algorithm that maps a message of arbitrary size to a relatively short (for example, 256 bits) fixed-size array of bits. This fixed-size bit array is called a message digest or a cryptographic hash.
In other words, a message digest is the output of a cryptographic hash function. As we mentioned in the previous chapter, we can say that a message digest is a cryptographically strong checksum.
A good cryptographic hash function has the following properties:
- It is deterministic, meaning that processing the same message must always yield the same message digest.
- It is irreversible, meaning that it must be impossible or extremely difficult to recover the original message by its digest. The only way to reverse the hash should be brute force and it must be too computationally...