Hash collision
A hash collision occurs when two distinct inputs produce the same hash value under the same function and parameters.
A table bucket can collide even when the full hash values differ. Reducing the values modulo the bucket count can merge them. Chained tables compare stored keys to distinguish candidates. This indexing problem differs from an attack on a cryptographic digest. [9]
Hashing identical bytes twice is not a collision. Finding any colliding pair differs from finding a replacement for an already specified original, which is a second-preimage problem. [1] [2]
The ideal collision-resistance strength of an L-bit cryptographic hash is L/2 bits, so SHA-256 offers 128 bits against collisions but 256 bits against preimages, while SHA-1 may fall considerably below its expected 80 bits. Truncating a digest to a shorter length lowers that strength to half the truncated length, which leaves 48 bits for a 96-bit truncated SHA-256 value. [6] [7]
The first published collision for full SHA-1 required work equivalent to 2^63.1 SHA-1 compressions, about 6,500 CPU years and 100 GPU years, and produced two distinct PDF documents with one digest. [8]
Fletcher-4 supplies a concrete non-cryptographic contrast: in a pinned OpenZFS scalar-function study, [0,4,0,4,0] and [1,0,6,0,1] share the result [8,24,52,96], with six changed bits and different SHA-256 file digests. Their signed difference cancels all four position moments. The fixed original reference is not replaced. This is not a cryptographic-hash collision, minimum-distance proof, mounted-pool experiment or measured hardware failure probability. [10] [11]
Relations
- related
- Checksum, Cryptographic hash function, Merkle tree, Data deduplication, Rateless IBLT, Minimal perfect hash function, Universal hashing, Hash index (PostgreSQL), Birthday bound
Advantages
- Collision strength is tabulated per approved function, so a digest can be chosen for a target strength, for example 192 bits for SHA-384 and SHA3-384 or 256 bits for SHA-512 and SHA3-512. [7]
Limitations
- Collision resistance concerns the difficulty of finding colliding inputs, not an assertion that every input has a unique digest. [3]
- CRC undetected-error probabilities require a stated error model and cannot be treated as universal device failure rates. [4]
- Digital signatures depend on collision resistance, and SHA-1 was disallowed for signature generation at the end of 2013, with a plan to end its remaining uses published in December 2022. [7]
- An application that needs a given collision strength from a truncated digest must keep at least twice that many output bits. [6]
Citations
- NIST CSRC glossary: collision
- NIST CSRC glossary: second preimage resistance
- NIST CSRC glossary: cryptographic hash function and security properties
- RFC 3385: iSCSI CRC/Checksum Considerations, sections 1-2 and 10 (historical error-model analysis)
- Dang. NIST SP 800-107 Revision 1: Recommendation for Applications Using Approved Hash Algorithms (August 2012), sections 4.1-5.1.
- NIST CSRC: Hash Functions project page, approved algorithms and security strengths.
- Stevens, Bursztein, Karpman, Albertini and Markov. The first collision for full SHA-1. CRYPTO 2017, abstract and section 1.
- Thorup. High Speed Hashing for Integers and Strings. arXiv:1504.06804v9 (2020), sections 2, 2.1, 3 and 6.
- OpenZFS zfs-2.3.4: pinned scalar Fletcher-4 functions and overflow arithmetic.
- Hesela: pinned Fletcher-4 scalar study, exact results, controls and offline replay (synthetic algorithm fixtures).
Further reading
Sources & caveats
- sp800-107 is NIST SP 800-107 Revision 1, read in sections 4.1, 4.2 and 5.1 for collision-resistance strength and truncation.
- nist-hash-functions is the NIST CSRC hash functions project page, read for the security-strength table and SHA-1 transition history.
- shattered is the 2017 paper on the first full SHA-1 collision, read in the abstract and introduction for the work estimate.
- nist-collision and nist-second-preimage are glossary entries kept for the distinction between collisions and second preimages.
- nist-hash and rfc3385 were not re-read and are kept only for the existing limitations.
- Fletcher-4: nine constructed configurations, pinned scalar functions and a fixed reference. No mounted pool, field-rate estimate or independent peer replication. https://hesela.dev/research/fletcher4/results.json
- Fletcher-4 source pins, licensing and claim limits: https://hesela.dev/research/fletcher4/sources.json