Cipher Utility

SHA-1 Hash Generator

H-02

SHA-1 of any text or file, with a checker for a hash you already have. Runs in your browser; nothing is uploaded.

Case:

160 bits, 40 hex characters

How to check a hash

  1. Type the text, or click File and drop a file.
  2. Paste the hash you have into Compare with.
  3. A green bar means they match.
  4. A red note explains a mismatch.

Worked example

One capital letter changes everything:

hello

aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d

Hello

f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0

Cipher Utility reference card Catalog no. H-02

What SHA-1 is

SHA-1 is a hash function published by NIST in 1995. It turns any input into a 160-bit value, written as 40 hexadecimal characters. For about twenty years it was the standard hash for certificates, software signing and version control.

InputSHA-1
(empty)da39a3ee5e6b4b0d3255bfef95601890afd80709
helloaaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
password5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8

SHA-1 is broken for security

In 2017 researchers from Google and CWI Amsterdam published SHAttered, the first practical SHA-1 collision: two different PDF files with the same hash. Later attacks made collisions cheaper still. Anyone who relies on SHA-1 to prove that data was not tampered with can be fooled, so certificates and signatures have moved to SHA-256.

SHA-1 is still fine for spotting accidental changes and for matching data against older systems that only publish SHA-1 values. For anything new, use SHA-256.

SHA-1 on your own computer

macOS: shasum file.zip Linux: sha1sum file.zip Windows: certutil -hashfile file.zip SHA1 PowerShell: Get-FileHash file.zip -Algorithm SHA1

On macOS, shasum without options uses SHA-1. The checker above accepts a line copied from sha1sum, with the file name after the hash.

Questions about SHA-1

Can a SHA-1 hash be decoded?

No. SHA-1 is a one-way hash, so the original text is not stored in it. Tools that claim to decode SHA-1 look the hash up in lists of hashes made from common words and leaked passwords. Short, common inputs can be found that way; anything long and random cannot.

Is SHA-1 still safe?

Not for security. In 2017 Google and CWI Amsterdam published the first practical SHA-1 collision, two different PDF files with the same hash. Browsers stopped trusting SHA-1 certificates around that time. Use SHA-256 for anything new.

Why does Git use SHA-1?

Git names every commit and file by its SHA-1 hash. Since 2017 it uses a hardened version that detects the known collision attacks, and newer versions can also store repositories with SHA-256.

How long is a SHA-1 hash?

160 bits, written as 40 hexadecimal characters.

Is my text or file sent to a server?

No. Hashing runs in your browser with the built-in Web Crypto API. Neither the text nor the file is uploaded.