Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Hash Function

Direct answer

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.

When to use this

Use this when using hash functions correctly.

First 30 seconds

1. A hash function maps input to fixed-size output.

2. One-way and collision-resistant (cryptographic).

3. Small input change → completely different output.

4. Not encryption.

5. Choose modern algorithms.

Operational verification

input → hash → digest

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Treating a hash as encryption — it cannot be reversed, but short inputs (phone numbers, CPR numbers) can be brute-forced.
  • Assuming hashes show who created a file (use signatures).
  • Comparing hashes visually by the first few characters only.
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
Key commandGet-FileHash file.iso -Algorithm SHA256
Scope / prerequisiteUse this when using hash functions correctly.
What next?2 suggested next steps
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
Key points
  • A hash is one-way and fixed length.
  • A tiny input change gives a different hash.
  • Hashing is not encryption.
Key checks
  • sha256sum file — digest
  • Properties: preimage, second-preimage, collision resistance — security goals
  • Algorithm choice — SHA-2/3, BLAKE2/3
ReferenceWhy it matters1 section · depth on demand

Properties and uses

A cryptographic hash must be:

  • Pre-image resistant: from a digest you cannot find the input.
  • Second pre-image resistant: you cannot find another input with the same digest as a given one.
  • Collision resistant: you cannot find any two inputs with the same digest.
UseAlgorithm
File integrity, signatures, certificatesSHA-256, SHA-384, SHA-3
Message authenticationHMAC-SHA-256
Password storageArgon2id, scrypt, bcrypt (never a plain fast hash)

sha256sum file (Linux) or Get-FileHash file -Algorithm SHA256 (PowerShell) computes a file hash.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

A hash function maps input data of any size to a fixed-size output. Cryptographic hash functions add security properties — preimage, second-preimage and collision resistance — that make them suitable for integrity checks and signatures; non-cryptographic hashes (CRC32, MurmurHash) are only for error detection and data structures.

PropertyMeaning
DeterministicSame input → same output
Avalanche effectSmall change → completely different digest
Preimage resistanceCannot find input from digest
Second-preimage resistanceCannot find another input with the same digest as a given input
Collision resistanceCannot find any two inputs with the same digest

Use SHA-256 or stronger for security purposes; use dedicated password hashing functions for passwords.

ReferenceConfiguration & state1 section · depth on demand
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 → Hash Function. 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?