🔗
Cryptography Basics
March 7, 20269 min read

SHA-256 Hashing Explained: What It Does and What It Does Not Do

SHA-256 is a cryptographic hash function used to create a fixed-size fingerprint of data. It is essential for integrity checks, signatures, and verification workflows, but it is not encryption and it cannot restore the original message.

Deterministic

The same input always produces the same digest.

One-Way

You can verify a hash, but you cannot meaningfully reverse it to recover the input.

Sensitive

A tiny input change creates a completely different output.

Hashing vs Encryption

Hashing

Produces a fingerprint for comparison and integrity checks. It is designed to be one-way.

Encryption

Protects confidentiality by transforming data into ciphertext that can later be decrypted with the right key.

Where SHA-256 Is Actually Used

  • Verifying file integrity after download or transfer.
  • Supporting digital signature workflows where data fingerprints must be signed.
  • Blockchain and ledger systems that depend on chained data fingerprints.
  • Message integrity checks in security tooling and deployment pipelines.

Where Developers Get It Wrong

  • Using raw SHA-256 alone for password storage instead of password-hashing algorithms like Argon2, bcrypt, or PBKDF2.
  • Assuming a hash hides sensitive information in a reversible or access-controlled way.
  • Comparing hashes without protecting the source file or transfer path.
  • Forgetting that integrity is not the same as authenticity unless signing or trusted distribution is involved.

A Practical Integrity Workflow

If you publish or exchange files, generate the SHA-256 digest when the file is finalized, then provide the digest through a trustworthy reference point such as a signed release page, deployment manifest, or authenticated communication channel. The recipient computes the same hash locally and checks whether the values match.

If the hash matches, the file is very likely unchanged. If it does not, something about the file, transport, or reference data is wrong and should be investigated before use.