Use this when choosing hash functions for integrity, signatures or password storage.
Hashing
Hashing turns data of any size into a fixed-length digest with a one-way function. It is used for integrity checks, digital signatures and, with slow salted algorithms, for storing passwords.
data → hash → compare with trusted value
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
A hash function maps any input to a fixed-size digest. A cryptographic one is one-way, collision-resistant and changes completely when the input changes by one bit.
Subtopic SHA-256SHA-256 is part of the SHA-2 family and produces a 256-bit hash.
Subtopic SHA-512SHA-512 is the SHA-2 variant with a 512-bit digest. It is often faster than SHA-256 on 64-bit CPUs and is used where a longer hash or higher security margin is wanted.
Subtopic SHA-1SHA-1 produces a 160-bit hash. Practical collisions have been shown, so it is deprecated for certificates and signatures, though it still appears in legacy systems and Git.
Subtopic MD5MD5 produces a 128-bit hash and is broken for security, since collisions can be created easily.
Subtopic Collision ResistanceCollision resistance means it is practically impossible to find two different inputs with the same hash.
Subtopic Password HashingPassword hashing stores passwords with a slow, salted algorithm — Argon2id, bcrypt, scrypt or PBKDF2 — so stolen hash databases are expensive to crack.
Subtopic PBKDF2PBKDF2 derives keys or password hashes by running HMAC many times with a salt.
Subtopic bcryptbcrypt is a well-established password hashing algorithm with a salt and adjustable cost factor, such as cost 12.
Subtopic scryptscrypt is a memory-hard password hashing and key derivation function, tuned with N, r and p parameters, designed to make large-scale hardware cracking costly.
Subtopic Argon2Argon2 (Argon2id) is the recommended modern password hashing algorithm.
sha256sum <file>— computesha256sum -c SHA256SUMS— verify listGet-FileHash <file> -Algorithm SHA256— Windows
ReferenceWhy it matters1 section · depth on demand
What this area covers
| Topic | Answers |
|---|---|
| Hash function, collision resistance | Properties and why they matter |
| SHA-256 / SHA-512 / SHA-1 / MD5 | Which are safe |
| Password hashing, PBKDF2, bcrypt, scrypt, Argon2 | How to store passwords |
Rule of thumb: SHA-256+ for integrity, HMAC for authentication, Argon2id for passwords.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A cryptographic hash function turns any input into a fixed-length digest. The same input always gives the same digest, a tiny change gives a completely different one, and it is infeasible to find the input from the digest or two inputs with the same digest.
| Use | Algorithm guidance |
|---|---|
| Integrity (files, downloads) | SHA-256, SHA-512, SHA-3 |
| Digital signatures | SHA-256 or stronger |
| Password storage | Slow, salted functions: Argon2id, scrypt, bcrypt, PBKDF2 |
| Message authentication | HMAC-SHA-256 |
| Avoid | MD5, SHA-1 (collisions found) |
A plain fast hash is wrong for passwords: attackers can test billions of guesses per second. Password hashing functions are deliberately slow and memory-hard.
Hash functions at a glance
| Function | Output | Status |
|---|---|---|
| MD5 | 128 bits | Broken (collisions) |
| SHA-1 | 160 bits | Broken (collisions) |
| SHA-256 / SHA-512 | 256 / 512 bits | Recommended |
| SHA-3 | 224–512 bits | Recommended |
| BLAKE2 / BLAKE3 | variable | Fast, secure |
For passwords use Argon2id, scrypt, bcrypt or PBKDF2 — not plain hashes.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hashing. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/180-4/upd1/final · confidence 94%