Glossary

What Is SHA-256? Hash Functions Explained

SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that takes any input and produces a fixed 256-bit (64-character hex) digest. It is part of the SHA-2 family, standardized by NIST in 2002, and is one of the most widely deployed hash functions in the world.

How SHA-256 Works

SHA-256 processes input in 512-bit blocks through 64 rounds of bitwise operations, modular additions, and compression functions. Even a single bit change in the input produces a completely different output — a property called the avalanche effect. It is computationally infeasible to reverse the process or find two different inputs with the same hash.

Where SHA-256 Is Used

SHA-256 is used to verify file integrity (checksums), in TLS/SSL certificates to sign data, as the proof-of-work function in Bitcoin mining, in HMAC authentication schemes, for password hashing (as part of bcrypt and PBKDF2 internals), and in code signing to verify software authenticity.

SHA-256 vs MD5 vs SHA-1

MD5 (128-bit) and SHA-1 (160-bit) are both cryptographically broken — researchers have demonstrated practical collision attacks against them. SHA-256 has no known practical weaknesses. For any new security application, SHA-256 or SHA-512 should be used instead of MD5 or SHA-1.

Can SHA-256 Be Cracked?

SHA-256 cannot be reversed mathematically. However, weak inputs (short passwords, dictionary words) can be cracked via brute force or rainbow tables. This is why passwords should never be stored as raw SHA-256 hashes — use bcrypt, scrypt, or Argon2 with a random salt instead.