🔒

SHA-256

SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that produces a 256-bit value from any input. It's part of the SHA-2 family designed by the NSA and is the current standard for data integrity, digital signatures, SSL certificates, and blockchain.

Examples

  • echo -n 'hello' | sha256sum → 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
  • Bitcoin genesis block hash → 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
  • File + SHA-256 → integrity verification in Linux distributions

FAQ

Is SHA-256 secure for passwords?

SHA-256 alone is not sufficient. It's very fast, facilitating brute-force attacks. For passwords use bcrypt, scrypt, or Argon2, designed to be slow and with built-in salt.

What's the difference between SHA-256 and SHA-2?

SHA-2 is the family that includes SHA-224, SHA-256, SHA-384, and SHA-512. SHA-256 is the most used member of that family, with ideal balance between security and performance.

Can SHA-256 be cracked?

Not with current technology. Finding a SHA-256 collision would require more energy than the sun will produce in its lifetime. Practical attacks are based on weak passwords, not breaking the algorithm.