A cryptographic hash turns any input into a fixed-size fingerprint — and crucially, you can't reverse it. It's the most-used primitive in security, and it is not encryption (there's no key and no "decrypt").
The properties
| Property | Meaning |
|---|---|
| Deterministic | Same input → same hash, always |
| One-way | Can't get the input back from the hash |
| Avalanche | Change one bit → completely different hash |
| Collision-resistant | Hard to find two inputs with the same hash |
"hello" → SHA-256 → 2cf24dba5fb0a30e26e83b2ac5b9e29e...
"hellp" → SHA-256 → fa3a6cba1b... (totally different)
What it's for
- Integrity — verify a download wasn't tampered with (compare hashes).
- Digital Signatures — you sign the hash, not the whole file.
- Deduplication / indexing — fingerprint content.
- Passwords — but not with these fast hashes — see Password Hashing.
Don't confuse hashing with encryption. Encryption is reversible with a key; a hash is a one-way fingerprint with no way back.
Related: Digital Signatures · Password Hashing · Public Key Infrastructure