SHA1 Hash Tool
Other Hash Generator
MD2 MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512/224 SHA512/256 SHA512 SHA3-224 SHA3-256 SHA3-384 SHA3-512 RIPEMD128 RIPEMD160 RIPEMD256 RIPEMD320 WHIRLPOOL TIGER128,3 TIGER160,3 TIGER192,3 TIGER128,4 TIGER160,4 TIGER192,4 SNEFRU SNEFRU256 GOST GOST-CRYPTO ADLER32 CRC32 CRC32B CRC32C FNV132 FNV1A32 FNV164 FNV1A64 JOAAT MURMUR3A MURMUR3C MURMUR3F XXH32 XXH64 XXH3 XXH128 HAVAL128,3 HAVAL160,3 HAVAL192,3 HAVAL224,3 HAVAL256,3 HAVAL128,4 HAVAL160,4 HAVAL192,4 HAVAL224,4 HAVAL256,4 HAVAL128,5 HAVAL160,5 HAVAL192,5 HAVAL224,5 HAVAL256,5The SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function designed to produce a fixed-size 160-bit (20-byte) hash value from an arbitrary-length input. It was developed by the National Security Agency (NSA) and published as a Federal Information Processing Standard (FIPS PUB 180) in 1995. SHA-1 is widely used for data integrity verification and digital signatures, although it has been largely deprecated in favor of more secure algorithms due to vulnerabilities discovered over time.
Input Processing
The algorithm begins by preprocessing the input message. The message is first padded to ensure its length is congruent to 448 modulo 512. Padding consists of a single '1' bit followed by enough '0' bits. A 64-bit representation of the original message length is then appended, resulting in a message length that is a multiple of 512 bits. The message is divided into 512-bit blocks for sequential processing.
Message Schedule Preparation
Each 512-bit block is divided into sixteen 32-bit words. These words are then expanded into eighty 32-bit words using bitwise operations, specifically left rotations and XOR operations, to form the message schedule. This expansion ensures that each round of processing has a unique input derived from the original message block, contributing to diffusion and resistance against certain cryptographic attacks.
Hash Computation
SHA-1 maintains five 32-bit working variables, initialized with specific constant values. Each 512-bit block undergoes eighty rounds of processing, divided into four main stages of twenty rounds each. In every round, the algorithm applies nonlinear functions, bitwise operations, modular additions, and fixed constants to update the working variables. These operations mix the message schedule words with the current state of the hash, ensuring that even small changes in the input produce significantly different outputs.
Final Output
After processing all message blocks, the algorithm produces a concatenated 160-bit output derived from the five working variables. This hash value serves as the unique fingerprint of the input data, providing a deterministic and irreversible representation. SHA-1 output is commonly represented as a 40-character hexadecimal string for display and storage purposes.