SHA-1 Hash Generator
SHA-1 with a live Git object-hash mode (matches git hash-object exactly), an HMAC-SHA1/TOTP demo showing where SHA-1 is still genuinely valid, and the SHAttered collision story explaining where it is not.
What this tool does
Computes SHA-1 from text or a file, a
Git object hash mode that reproduces exactly what
git hash-object outputs for the same content, a live
HMAC-SHA1 / TOTP (RFC 6238) demo, and a self-check
against the official standard test vectors. This is a focused,
SHA-1-specific companion to this site's general
Hash Generator -- here for the two things
that make SHA-1 different from every other broken hash: it is
still load-bearing inside Git's object model, and its *keyed*
variant (HMAC-SHA1) is still genuinely fine for things like
one-time codes, while raw unkeyed SHA-1 is not.
The SHAttered attack (2017)
On February 23, 2017, researchers at Google and CWI Amsterdam published the first practical SHA-1 collision, nicknamed SHAttered. They produced two different PDF files with completely different visible content that hash to the exact same SHA-1 digest -- proof the collision resistance that makes a hash trustworthy for signatures and certificates was gone in practice, not just in theory. The attack took roughly 9,223,372,036,854,775,808 SHA-1 computations (about 6,500 CPU-years plus a GPU phase), which sounds enormous but was already within reach of a well-funded attacker -- and far cheaper than anyone expected when NIST first flagged SHA-1's theoretical weakness back in 2005.
Why SHA-1 was retired for security
NIST deprecated SHA-1 in 2011 and formally disallowed it for digital signatures at the end of 2013, based on theoretical attacks that made collisions cheaper than the 2^80 operations a 160-bit hash should require. The CA/Browser Forum banned issuing new SHA-1 TLS certificates starting January 1, 2016, and major browsers stopped trusting SHA-1 certificates entirely by 2017 -- all before SHAttered even landed, which simply confirmed the deprecation had been the right call. NIST's own roadmap retires every remaining SHA-1 usage from federal specifications by the end of 2030.
Git still uses SHA-1 -- and that's a different risk model
Every Git commit, tree, and blob is identified by a SHA-1
hash of its contents, and that hasn't changed just because
SHA-1 is broken for signatures. The reason it's a different
problem: Git's SHA-1 usage is a content-addressing and
accidental-corruption check, not a defense against a
motivated adversary engineering a matching object on purpose --
and since SHAttered, Git has shipped SHA-1DC (collision-detecting
SHA-1), which actively detects the specific structure SHAttered-
style attacks rely on and refuses to hash a deliberately crafted
collision. Git's long-term fix is a full transition to SHA-256
object IDs, which is still in progress across the ecosystem. The
"Git Object Hash" mode on this page reproduces the exact value
git hash-object would output for the same content,
by hashing "blob " + length + "\0" + content rather
than the raw content alone.
HMAC-SHA1 and TOTP are still genuinely fine
This is the detail most "SHA-1 is dead" explainers skip: HMAC-SHA1 doesn't inherit SHA-1's collision weakness, because HMAC's security doesn't depend on collision resistance the way raw hashing (for signatures) does -- it depends on SHA-1 still behaving like a pseudorandom function under a secret key, which it does. That's exactly why TOTP, RFC 6238 (the algorithm behind most 6-digit authenticator-app codes) still specifies HMAC-SHA1 as its default, over a decade after SHA-1 signing was banned. The TOTP demo on this page computes a real code from a secret and the current time using the exact RFC 6238 construction, so you can see HMAC-SHA1 actually at work in a system still considered secure today.
Self-check against RFC 3174 and RFC 2202
RFC 3174 publishes the official SHA-1 test vectors and RFC 2202 publishes the official HMAC-SHA1 test vectors -- this tool computes all of them live, using the browser's native Web Crypto implementation, and checks the result against the published values so the implementation is demonstrated correct rather than just asserted.
Privacy
Everything is computed entirely in your browser via the native Web Crypto API. Nothing you type, upload, or generate here is sent to a server.