SHA-1 Hash

Technical details, regex signatures, and cracking commands for the SHA-1 algorithm.

Regex Identification Signature:
^[a-f0-9]{40}(:.+)?$
Hashcat Command (Mode: 100):
John the Ripper Command:
← Back to Hash Identifier

What is SHA-1?

SHA-1 (Secure Hash Algorithm 1) was designed by the NSA in collaboration with MIT and the University of California, Berkeley, and standardized as FIPS PUB 180-1 in 1995 as part of the SHA (Secure Hash Algorithm) family. It operates as a 160-bit (20-byte) cryptographic hash function, producing a fixed-length digest from input data of any length, with a theoretical collision resistance of approximately 2¹²⁸ operations. Structurally, SHA-1 processes input messages in 512-bit blocks via a compression function that iteratively applies bitwise operations (majority, Ch, Parity, and majority variants), left rotations, and modular additions to four 32-bit working variables, culminating in a final hash derived from the concatenation of these variables. Its primary use-case was digital signatures, message integrity verification, and lightweight authentication protocols, though it was later superseded by SHA-2 due to cryptanalytic vulnerabilities.

SHA-1’s vulnerabilities stem from its outdated design, which lacks key features modern hash functions require: no cryptographic salt, a small output size (160 bits), and a compression function susceptible to length-extension attacks. Its collision resistance was fatally compromised in 2005 when cryptanalysts demonstrated practical attacks using GPU-accelerated brute-force techniques (e.g., the SHA-1bomb toolkit), exploiting parallelizable compression rounds. Optimized implementations (e.g., CUDA/FPGA-accelerated hashing) reduced collision-finding complexity to ~2¹⁰⁰ operations, rendering it infeasible for security-critical applications. Additionally, its fixed-length output and lack of adaptive parameters make it vulnerable to preimage attacks and forgery when used in non-ideal environments, such as password storage without salting or HMAC integration.

Identifying SHA-1 Hashes

Identifying a hash blindly is often difficult because multiple algorithms can output strings of the exact same length. For example, a standard 32-character hexadecimal string could be MD5, NTLM, MD4, or LM. To definitively identify SHA-1, security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack SHA-1

If you need to recover the plaintext password for a SHA-1 hash during a penetration test or forensics investigation, you must supply the correct module ID to your cracking software. Use the exact commands provided at the top of this page to target the hash successfully.