Use this when choosing a standard secure hash.
SHA-256
SHA-256 is part of the SHA-2 family and produces a 256-bit hash. It is the standard choice for certificates, signatures, file integrity and HMAC, and is not considered broken.
1. SHA-256: 256-bit SHA-2 digest.
2. Standard for integrity, certificates, signatures.
3. Length extension: use HMAC for MACs.
4. Fast — not for passwords alone.
5. Widely supported.
data → SHA-256 → 32-byte digest
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-FileHash .\file.iso -Algorithm SHA256Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verifying a download Verify boundary
sha256sum -c SHA256SUMS --ignore-missing
gpg --verify SHA256SUMS.gpg SHA256SUMS
Get-FileHash .\file.iso -Algorithm SHA256
The hash file itself must be signed or come from a different trusted channel; otherwise an attacker who replaces the download replaces the hash too.
Step 2 Common mistakes Narrow the fault
- Using SHA-256 alone for password storage (too fast).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- SHA-256 gives a 256-bit digest.
- It is the standard for certificates and integrity.
- On its own it is too fast for password storage.
sha256sum file— SHA-256openssl dgst -sha256 file— OpenSSLGet-FileHash file -Algorithm SHA256— PowerShell
ReferenceWhy it matters1 section · depth on demand
Where it is used
- TLS certificates and code signing.
- File and package integrity (download checksums, container image digests).
- Git (moving from SHA-1 to SHA-256), Bitcoin, HMAC in JWT (HS256).
SHA-256 is fast, which is good for integrity but bad for passwords; use it inside HMAC or with a KDF, never alone for password storage. It is vulnerable to length-extension, so use HMAC instead of sha256(secret + message).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
SHA-256 is part of the SHA-2 family and produces a 256-bit (64 hex character) digest. It is the standard general-purpose cryptographic hash: used in TLS certificates, code signing, file integrity, blockchain, HMAC and forensic verification.
sha256sum image.bin
echo -n 'text' | sha256sum
openssl dgst -sha256 file.iso
Get-FileHash .\file.iso -Algorithm SHA256
SHA-256 is fast by design, which is right for integrity checks but wrong for password storage — use Argon2id, scrypt, bcrypt or PBKDF2 for passwords. For message authentication, use HMAC-SHA256 rather than hashing a secret concatenated with data.
Length extension
SHA-256 (Merkle–Damgård) allows length-extension: knowing H(secret || msg) lets an attacker compute H(secret || msg || padding || extra). Never build a MAC as SHA256(key || message); use HMAC-SHA256, which is immune.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hashing → SHA-256. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/180-4/upd1/final · confidence 94%