SHA-1 hash generator
Get the SHA-1 hash of any text as hex and Base64, in your browser. SHA-1 is broken for collision resistance: see where it still appears and what to use.
SHA-1 is broken for collision resistance: the SHAttered attack (2017) produced two different PDFs with the same SHA-1. Do not use it for signatures, certificates or anything an attacker can influence. Prefer SHA-256.
Hashed in your browser as UTF-8, exactly as typed: a trailing space or line break changes the hash.
The result appears here.The result appears here.Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.
How to use the SHA-1 hash generator
- Type or paste the text. It is hashed as UTF-8, exactly as entered.
- Read the hash as 40 hex characters, or as Base64.
- Copy the form you need, and prefer SHA-256 if the choice is yours.
About this tool
SHA-1 produces a 160-bit hash, written as 40 hex characters. It was the standard hash of the late 1990s and 2000s and is still everywhere in older systems. It is also broken for collision resistance. In 2017 the SHAttered attack by CWI Amsterdam and Google produced two different PDF files with the same SHA-1, and in 2020 a chosen-prefix collision made forging signed documents practical for a well-funded attacker.
A collision means an attacker can prepare two files with one hash, have the harmless one approved or signed, and swap in the other. So SHA-1 must not be used for digital signatures, certificates, or any integrity check where someone hostile can influence the data. Browsers stopped accepting SHA-1 TLS certificates in 2017, and NIST plans to retire it entirely by the end of 2030.
It still appears where collisions matter less or where change is slow. Git identifies objects by SHA-1 by default, with collision detection added and SHA-256 repositories available. HMAC-SHA-1, used by TOTP codes and older API signatures, is not affected by the collision attacks. Old checksum files list SHA-1 values. Use this tool to match those, and choose SHA-256 for anything new.
Sources
Questions
Not where an attacker could benefit from two inputs with the same hash: signatures, certificates, deduplication of untrusted files. It is still acceptable inside HMAC and for detecting accidental corruption. For new work there is no reason to pick it over SHA-256.
In February 2017 researchers from CWI Amsterdam and Google published two PDF files with different content and the same SHA-1 hash. It was the first public collision for the full function and took roughly nine quintillion SHA-1 computations. Later work cut the cost and allowed attackers to choose the starting content of both files.
By default, yes: commit, tree and blob IDs are SHA-1 hashes. Since 2017 Git uses a hardened implementation that detects the known collision techniques, and newer versions can create repositories that use SHA-256 instead. Hosting support for SHA-256 repositories is still limited.
No. HMAC’s security does not rest on collision resistance, and no practical attack on HMAC-SHA-1 is known. That is why TOTP authenticator codes, which use it by default, remain sound. New designs should still choose HMAC-SHA-256.