Cryptographic hash function
- Preimage resistance. It is too difficult to invert the function and find an original message from its digest.
- Second preimage resistance. It is too difficult to change the message without also changing its digest.
- Collision resistance. It is too difficult to find any two messages with the same digest.
With many algorithms, the message is a string of octets, and the digest has a fixed number of bits. For example, SHA-256 always computes a 256-bit digest. One can write this digest in hexadecimal.
Though algorithms like MD4 define digest for message of any bit length, many actual implementations assume that the bit length is a multiple of 8.