Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Hashing

Direct answer

Hashing turns data of any size into a fixed-length digest with a one-way function. It is used for integrity checks, digital signatures and, with slow salted algorithms, for storing passwords.

When to use this

Use this when choosing hash functions for integrity, signatures or password storage.

First 30 seconds

1. Hashes verify integrity and identify data.

2. SHA-256/512 for integrity.

3. Slow KDFs for passwords.

4. MD5/SHA-1 not for security.

5. Verify downloads against signed checksums.

Operational verification

data → hash → compare with trusted value

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Using fast hashes (SHA-256, MD5) for passwords.
  • Building MACs as hash(key || message) instead of HMAC.
  • Trusting a downloaded file's hash taken from the same compromised site.
  • Comparing hashes with non-constant-time functions in security checks.
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when choosing hash functions for integrity, signatures or password storage.
What next?2 suggested next steps
Child topics (this level)11
Evidence1
On this pageJump to a specific section
Evidence references

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.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Hash Function

A hash function maps any input to a fixed-size digest. A cryptographic one is one-way, collision-resistant and changes completely when the input changes by one bit.

Subtopic SHA-256

SHA-256 is part of the SHA-2 family and produces a 256-bit hash.

Subtopic SHA-512

SHA-512 is the SHA-2 variant with a 512-bit digest. It is often faster than SHA-256 on 64-bit CPUs and is used where a longer hash or higher security margin is wanted.

Subtopic SHA-1

SHA-1 produces a 160-bit hash. Practical collisions have been shown, so it is deprecated for certificates and signatures, though it still appears in legacy systems and Git.

Subtopic MD5

MD5 produces a 128-bit hash and is broken for security, since collisions can be created easily.

Subtopic Collision Resistance

Collision resistance means it is practically impossible to find two different inputs with the same hash.

Subtopic Password Hashing

Password hashing stores passwords with a slow, salted algorithm — Argon2id, bcrypt, scrypt or PBKDF2 — so stolen hash databases are expensive to crack.

Subtopic PBKDF2

PBKDF2 derives keys or password hashes by running HMAC many times with a salt.

Subtopic bcrypt

bcrypt is a well-established password hashing algorithm with a salt and adjustable cost factor, such as cost 12.

Subtopic scrypt

scrypt is a memory-hard password hashing and key derivation function, tuned with N, r and p parameters, designed to make large-scale hardware cracking costly.

Subtopic Argon2

Argon2 (Argon2id) is the recommended modern password hashing algorithm.

Key points
  • MD5 and SHA-1 are broken for security use.
  • Passwords need slow, salted hashes, not plain SHA-256.
  • Hashes prove integrity only if the hash itself is trusted.
Key checks
  • sha256sum <file> — compute
  • sha256sum -c SHA256SUMS — verify list
  • Get-FileHash <file> -Algorithm SHA256 — Windows
ReferenceWhy it matters1 section · depth on demand
ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

A cryptographic hash function turns any input into a fixed-length digest. The same input always gives the same digest, a tiny change gives a completely different one, and it is infeasible to find the input from the digest or two inputs with the same digest.

UseAlgorithm guidance
Integrity (files, downloads)SHA-256, SHA-512, SHA-3
Digital signaturesSHA-256 or stronger
Password storageSlow, salted functions: Argon2id, scrypt, bcrypt, PBKDF2
Message authenticationHMAC-SHA-256
AvoidMD5, SHA-1 (collisions found)

A plain fast hash is wrong for passwords: attackers can test billions of guesses per second. Password hashing functions are deliberately slow and memory-hard.

Hash functions at a glance

FunctionOutputStatus
MD5128 bitsBroken (collisions)
SHA-1160 bitsBroken (collisions)
SHA-256 / SHA-512256 / 512 bitsRecommended
SHA-3224–512 bitsRecommended
BLAKE2 / BLAKE3variableFast, secure

For passwords use Argon2id, scrypt, bcrypt or PBKDF2 — not plain hashes.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Hashing. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://csrc.nist.gov/pubs/fips/180-4/upd1/final · confidence 94%
Confirmation

Confirm action

Continue?