Hash functions

SHA0

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

broken Root API only
Broken tier.

Practical attacks exist. Present for compatibility and research only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About SHA0

SHA0 is one of 3 SHA-1 and SHA-0 variants in the NextSSL registry, a cryptographic hash function. It produces a 20-byte (160-bit) output. Its registry entry cites SHA-0 (withdrawn FIPS 180, 1993), sphlib implementation. NextSSL lists it in the broken tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

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

Sizes

FieldBytesMeaning
out20Output

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'broken' is reachable from the root API only
digest = root.call("hash_with", "sha0", None, b"abc")[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Other SHA-1 and SHA-0 variants

2

Frequently asked questions

What is SHA0?

SHA0 is a hash in the SHA-1 and SHA-0 family. SHA-1 is a 160-bit Merkle–Damgård hash published by NIST in 1995 as a fix to the withdrawn SHA-0.

What are the SHA0 sizes?

In NextSSL, SHA0 uses: output 20 bytes.

Who designed SHA0 and when?

SHA0 belongs to the SHA-1 and SHA-0 family, first published in 1995 by National Security Agency. Its origin: NIST FIPS 180-1 (now FIPS 180-4).

Which standards define SHA0?

SHA0 is referenced by SHA-0 (withdrawn FIPS 180, 1993), sphlib implementation.

Is SHA0 safe to use?

SHA0 is in the broken tier. Practical attacks exist. Present for compatibility and research only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).

What other SHA-1 and SHA-0 variants are there?

NextSSL also registers sha-1dc, sha1 in the SHA-1 and SHA-0 family.