Use this when hash collisions matter for signatures or integrity.
Collision Resistance
1. Collision resistance: hard to find two inputs with the same hash.
2. Breaks allow forged certificates/documents.
3. Birthday bound: 2^(n/2).
4. Use ≥ 256-bit hashes.
5. Migrate quickly when weaknesses appear.
two inputs → same digest (should be infeasible)
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Assuming collision resistance protects password hashes.
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.
ReferenceWhy it matters1 section · depth on demand
Why it matters
With a collision an attacker can make two documents (or certificates) with the same hash, get the harmless one signed and use the signature on the malicious one. Generic collision resistance is half the digest length: SHA-256 gives about 128-bit collision security.
| Algorithm | Collision status |
|---|---|
| MD5 | Broken (seconds) |
| SHA-1 | Broken (practical, chosen-prefix) |
| SHA-256/384/512, SHA-3 | No known attacks |
ReferenceHow it works2 sections · depth on demand
Real collision attacks
| Year | Attack |
|---|---|
| 2004 | First MD5 collisions (Wang et al.) |
| 2008 | Rogue CA certificate via MD5 collision |
| 2012 | Flame malware forges Microsoft signature (MD5) |
| 2017 | SHAttered — first SHA-1 collision |
| 2020 | SHA-1 chosen-prefix collision (Shambles) |
In depth
Collision resistance means it is computationally infeasible to find two different inputs that produce the same hash. It is what makes hashes safe for digital signatures, certificates and content addressing: if collisions can be created, an attacker can get a benign document signed and substitute a malicious one with the same hash.
| Algorithm | Collision resistance |
|---|---|
| MD5 | Broken (seconds) |
| SHA-1 | Broken (practical attacks since 2017) |
| SHA-256 | Secure (~2^128 work) |
| SHA-3, BLAKE2/3 | Secure |
The birthday paradox means collision resistance is about half the digest length in bits — a 256-bit hash gives 128-bit collision security, which is why shorter digests are not enough for long-term signatures.
ReferenceImportant terms & boundaries1 section · depth on demand
Security levels
| Property | Attack cost for n-bit hash |
|---|---|
| Preimage resistance | ~2ⁿ |
| Second preimage | ~2ⁿ |
| Collision resistance | ~2ⁿ/² (birthday bound) |
So SHA-256 gives about 128-bit collision resistance. Signatures and certificates depend on collisions; HMAC and password hashing mostly on preimages.
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 → Collision Resistance. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/180-4/upd1/final · confidence 94%