Hash family

SHA-1 and SHA-0

The 160-bit NIST hash with practical collisions since 2017; kept for compatibility

broken 3 variants NIST FIPS 180-1 (now FIPS 180-4)

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–2022
  1. SHA-1 published in FIPS 180-1

  2. Wang, Yin and Yu find a theoretical collision attack

  3. Specified in FIPS 180-4

  4. SHAttered: first public SHA-1 collision

  5. Chosen-prefix collision demonstrated (SHA-1 is a Shambles)

  6. 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

Verifying legacy signatures and checksumsGit object IDs (collision-detecting variant)HMAC-SHA1 in older protocols such as TOTP

Variants in NextSSL

3
AlgorithmTierSizes (bytes)StandardsAPI
SHA0
sha0
broken out 20 SHA-0 (withdrawn FIPS 180, 1993), sphlib implementation root
SHA-1
sha1
broken FIPS out 20 FIPS 180-4, RFC 3174 root
SHA-1dc
sha-1dc
unverified out 20 — root

Frequently 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.