SHA-1 and SHA-0
The 160-bit NIST hash with practical collisions since 2017; kept for compatibility
Overview
SHA-1 is a 160-bit Merkle–Damgård hash published by NIST in 1995 as a fix to the withdrawn SHA-0. It was the dominant hash of the 2000s, but practical collisions and chosen-prefix collisions have since been demonstrated, and it must not be used where collision resistance matters.
SHA-1 processes 512-bit blocks through 80 rounds on a 160-bit state of five 32-bit words, in the same design lineage as MD4 and MD5. SHA-0, published in 1993 and withdrawn shortly afterwards, differs only by a missing one-bit rotation in the message expansion; that small change made SHA-0 far weaker and was the reason SHA-1 was issued.
NextSSL carries SHA-1, SHA-0 and SHA-1DC. SHA-1DC is the collision-detecting variant by Marc Stevens and Dan Shumow: it computes standard SHA-1 but flags inputs that show the disturbance patterns used by known collision attacks, and is the implementation Git adopted after the SHAttered collision. The output for ordinary inputs is identical to SHA-1.
History
1995–2022SHA-1 published in FIPS 180-1
Wang, Yin and Yu find a theoretical collision attack
Specified in FIPS 180-4
SHAttered: first public SHA-1 collision
Chosen-prefix collision demonstrated (SHA-1 is a Shambles)
NIST announces SHA-1 retirement by 2030
Security notes
SHA-1 is broken for collision resistance: the SHAttered attack produced a full collision in 2017 and a practical chosen-prefix collision followed in 2020. SHA-0 is broken more severely. Preimage resistance is still not practically broken, so HMAC-SHA1 and legacy protocol uses survive, but new designs should use SHA-2 or SHA-3.
Typical uses
Variants in NextSSL
3Frequently asked questions
Which SHA-1 and SHA-0 variants does NextSSL include?
NextSSL registers 3 SHA-1 and SHA-0 variants: sha0, sha1, sha-1dc.
Families with similar names
Other hash functions
All 424Related
NIST SP 800-90A deterministic random bit generator built on HMAC
MD2, MD4 and MD5Ron Rivest's message-digest hashes; all three are broken and kept for legacy use
SHA-2The NIST Merkle–Damgård hash family behind most of today's TLS, signatures and software
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2
HMACThe standard way to build a MAC from a cryptographic hash (RFC 2104, FIPS 198-1)
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2