2.2 Secure Hash Algorithm 2 (SHA-256) Authentication
The main purpose of a hash function is to create a distinct digital identifier for a specific set of data, similar to a fingerprint. Unlike error detection codes, each data set must be linked to a unique identifier.
In practical terms, a hash function takes input of varying lengths and produces an output of a fixed size known as a message digest. It has several important attributes, including excellent diffusion, which guarantees a significantly different output with even a small change in input.
Although the fixed output size theoretically limits the ability to generate a unique digest for every possible piece of data, hash functions are designed to make it extremely difficult to find two messages that produce the same digest, effectively creating the appearance of uniqueness for practical purposes.