What is a Cryptographic Hash?
A cryptographic hash function takes any input (text, file, password) and produces a fixed-length string called a hash or digest. Hashes are one-way — you cannot reverse a hash back to the original text. The same input always produces the same hash, making them ideal for data verification.
When to Use Each Algorithm
- SHA-256 — The most widely used hash. Recommended for password storage (with a salt), file integrity checks, digital signatures, and blockchain applications. Part of the SHA-2 family.
- SHA-512 — Produces a longer, stronger hash. Preferred when maximum security is needed. Faster than SHA-256 on 64-bit processors.
- SHA-1 — A legacy algorithm. No longer considered secure for cryptographic purposes (collision vulnerabilities found). Use only for compatibility with older systems.
Common use cases: verifying file integrity, storing passwords securely, digital signatures, checksums, and data deduplication.