Cybersecurity

SHA-256

Updated: September 19, 2026

SHA-256 (Secure Hash Algorithm 256-bit) is a member of the SHA-2 family, developed by the NSA and published by NIST in 2001. It accepts input of any length and produces a digital fingerprint exactly 256 bits (64 hexadecimal characters) long. Like all cryptographic hash functions, it is one-way: it is computationally infeasible to reconstruct the original input from the hash value alone.

SHA-256 was designed to replace earlier hash functions like MD5 and SHA-1, which were found to have practical collision attacks (two different inputs producing the same hash). As of 2026, no practical collision attack exists against SHA-256, which is why it remains widely deployed. SHA-3, published by NIST in 2015, uses a different internal structure (Keccak) and provides an alternative, but SHA-2 continues to be the dominant family in production systems.

Critical Properties

Deterministic — the same input always produces the exact same hash, every time. This makes verification possible: anyone can recompute the hash and compare.

Avalanche effect — a tiny change to the input (even a single bit) produces a completely different hash. For example:

SHA-256("hello") = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
SHA-256("Hello") = 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969

Despite differing by only one character, the outputs share no visible pattern. This property makes it impossible to guess what input produces a specific hash.

Collision resistance — it is computationally infeasible to find two different inputs that produce the same hash. While collisions must theoretically exist (there are infinitely many possible inputs but only 2^256 possible outputs), finding one would require roughly 2^128 operations — far beyond current computational capability.

Key Applications

Bitcoin’s Proof of Work — miners repeatedly hash block data combined with a varying number (nonce) until the resulting hash falls below a target value. This is computationally expensive to produce but trivial to verify, forming the basis of Bitcoin’s security model.

Digital signatures — before signing a document, the content is hashed with SHA-256. The hash (not the full document) is then encrypted with the signer’s private key. Verifiers compute the same hash and compare, confirming both authenticity and integrity.

Password storage — systems never store passwords in plaintext. Instead, they store SHA-256 hashes combined with a unique random value per password called a salt. When a user logs in, the system hashes the provided password with the stored salt and compares the result.

File integrity verification — software distributors publish SHA-256 checksums alongside downloads. Users can recompute the hash of the downloaded file and compare it to confirm the file was not corrupted or tampered with in transit.