What is a Cryptographic Hash?
A cryptographic hash function takes arbitrary input data and maps it to a fixed-size array of bytes, often represented as a hexadecimal string. This output is called the hash value or digest.
Key properties of good cryptographic hashes:
- Deterministic: The same input always produces the exact same hash.
- Quick to compute: Generating the hash from data is fast.
- Irreversible: It is computationally infeasible to guess the original input from the hash alone (unlike encoding, such as Base64).
- Collision resistant: It is extremely unlikely that two different inputs will produce the same hash.
Note: SHA-1 is no longer considered secure against well-funded adversaries and should not be used for cryptographic security. SHA-256 and SHA-512 (part of the SHA-2 family) are currently the standard for secure applications.