Explore SHA-256 message processing: padding, scheduling, 64 rounds of compression, and the avalanche effect where a single bit change alters half the hash.
SHA-256 is computationally infeasible to reverse. Given a hash, you cannot determine the original message. This makes it ideal for password storage and digital signatures.
Finding two different messages that produce the same hash is computationally infeasible. With 2^256 possible outputs, the birthday attack requires ~2^128 attempts.
The same input always produces the same 256-bit output. This property is essential for verification: you can check integrity by comparing hashes without revealing the data.
Each of the 64 rounds computes two temporary values:
Then the working variables shift:
| Algorithm | Digest Size | Block Size | Rounds | Status |
|---|---|---|---|---|
| MD5 | 128 bits | 512 bits | 64 | Broken |
| SHA-1 | 160 bits | 512 bits | 80 | Deprecated |
| SHA-256current | 256 bits | 512 bits | 64 | Secure |
| SHA-384 | 384 bits | 1024 bits | 80 | Secure |
| SHA-512 | 512 bits | 1024 bits | 80 | Secure |
| SHA-3 | Variable | Variable | 24 | Secure |
SHA-256 is used in Bitcoin's proof-of-work. Miners compute double-SHA-256 to find valid block hashes.
Digital certificates use SHA-256 to create signatures that verify authenticity of HTTPS connections.
Git uses SHA-1 (migrating to SHA-256) to create unique identifiers for every commit and object.
Passwords are hashed with SHA-256 (plus salt) before storage so plaintext is never kept.