Text to encode

SHA-1 Hash

What is SHA-1 Hashing?

SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function that produces a 160-bit (20-byte) hash value, typically expressed as a 40-character hexadecimal number.

Key characteristics of SHA-1:

  • It's a one-way function - you cannot reverse the process to get the original text from the hash
  • The same input will always produce the same output hash
  • Even a small change in the input will produce a completely different hash
  • It was designed by the National Security Agency (NSA) and published by NIST
  • Like MD5, it's no longer considered cryptographically secure for sensitive applications due to vulnerabilities

Example

Original text

Hello World

SHA-1 Hash

0a4d55a8d778e5022fab701977c5d840bbc486d0

Common uses of SHA-1

  • Verifying file integrity (checking if a file has been modified)
  • Storing password hashes (though more secure algorithms are now recommended)
  • Digital signatures and certificates (though being phased out)
  • Version control systems like Git use SHA-1 to identify commits

SHA-1 vs. MD5

FeatureSHA-1MD5
Hash length160 bits (40 hex chars)128 bits (32 hex chars)
SecurityStronger than MD5, but still vulnerableVulnerable to collision attacks
SpeedSlightly slowerFaster
Current statusDeprecated for security applicationsDeprecated for security applications

Security Note:

SHA-1 is no longer considered secure for cryptographic purposes. In 2017, researchers demonstrated a practical collision attack against SHA-1. For security-sensitive applications, use stronger algorithms like SHA-256, SHA-512, or SHA-3.

How SHA-1 Hashing Works

SHA-1 hashing follows these steps:

  1. The input text is padded to ensure its length is divisible by 512 bits
  2. The algorithm processes the input in 512-bit blocks
  3. Five 32-bit variables (A, B, C, D, E) are initialized with specific values
  4. The algorithm performs a series of bit operations on these variables
  5. After processing all blocks, the final values of the five variables are concatenated to form the 160-bit SHA-1 hash
  6. The hash is typically represented as a 40-character hexadecimal string

Parameters

  • Input text: Any text you want to hash using the SHA-1 algorithm

Related Tools

All Tools

See all available tools