Secure Hash Algorithm - The cornerstone of modern cryptographic security
Original Data
Message Preprocessing
512-bit Blocks
80 Rounds Processing
Fixed-Length Hash
The input message is padded to ensure its length is congruent to 448 modulo 512. A '1' bit is appended followed by zeros, then the original message length is appended as a 64-bit integer.
The padded message is parsed into 512-bit blocks. Each block is then divided into sixteen 32-bit words for processing in the compression function.
Five 32-bit working variables (A, B, C, D, E) are initialized with predefined constant values that serve as the initial hash values.
The 16 words are expanded into 80 words using a specific algorithm involving XOR operations and left rotations to create the message schedule.
Each 512-bit block undergoes 80 rounds of processing using logical functions, constants, and the message schedule to update the working variables.
After processing all blocks, the final values of the working variables are concatenated to produce the final hash digest.
Computationally infeasible to find two different inputs that produce the same hash output
Given a hash value, it's computationally infeasible to find the original input message
Given an input and its hash, it's computationally infeasible to find another input with the same hash
Small changes in input produce drastically different hash outputs, enhancing security
| Version | Output Size | Block Size | Rounds | Security Level | Status |
|---|---|---|---|---|---|
| SHA-1 | 160 bits | 512 bits | 80 | Low | Deprecated |
| SHA-256 | 256 bits | 512 bits | 64 | High | Recommended |
| SHA-384 | 384 bits | 1024 bits | 80 | Very High | Recommended |
| SHA-512 | 512 bits | 1024 bits | 80 | Very High | Recommended |
SHA algorithms provide the foundation for digital signature schemes, ensuring document authenticity and non-repudiation in legal and business contexts.
Passwords are hashed using SHA algorithms before storage, protecting user credentials even if databases are compromised.
Bitcoin and other cryptocurrencies use SHA-256 for proof-of-work mining and transaction verification, securing billions of dollars in digital assets.
HTTPS connections rely on SHA algorithms for certificate validation, ensuring secure communication between web browsers and servers.
Software downloads and file transfers use SHA checksums to verify data integrity and detect corruption or tampering.
SHA-2 family algorithms are approved by NSA and used in classified government communications and military applications.