Cryptographic Hash
Also known as: Hash function, Digest, Message digest, Checksum
A cryptographic hash function takes any input and produces a fixed-length pseudo-random output (the 'digest') that uniquely identifies the input — and is computationally infeasible to reverse, making hashes the foundation of integrity checks, content addressing, and password storage.
Overview
Common cryptographic hash functions include SHA-256 (256-bit output), SHA-384, SHA-512, and the legacy SHA-1 and MD5. Two cryptographic properties matter:
1. Preimage resistance: given a hash, it is computationally infeasible to find an input that produces it. 2. Collision resistance: it is computationally infeasible to find two different inputs that hash to the same output.
MD5 and SHA-1 are broken against the second property — practical collision attacks exist — so they are unsafe for any security purpose. SHA-256 is the safe default for general-purpose use.
For password storage, a plain cryptographic hash is not enough. Use a purpose-built password hashing function (Argon2, bcrypt, scrypt) that includes a salt and is deliberately slow.