Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

What Is a Hash Function? Checksums, Passwords, and Digital Fingerprints

A hash turns data into a fixed-length digest. Learn how hashes check files, why password storage needs a slower salted scheme, and what a plain hash cannot prove.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A hash function turns data of any length into a fixed-length value called a hash, digest, or message digest. That digest can act like a compact fingerprint for checking whether data has changed—but it is not encryption, and a plain hash does not prove who created a file or message. Hashes also serve different purposes: a fast general-purpose hash can help check files, while password storage needs a deliberately slower, salted password-hashing scheme.

What a hash function does

A hash function accepts an input bit string of arbitrary length and produces an output with a fixed length. The input might be a short message or a large file; the digest is a compact representation of it. NIST describes cryptographic hashes in these terms and identifies three security properties commonly used to assess them: preimage resistance, second-preimage resistance, and collision resistance.

As an Amazon Associate I earn from qualifying purchases.

  • Preimage resistance: given a digest, it should be computationally infeasible to find an input that produces it.
  • Second-preimage resistance: given one input, it should be computationally infeasible to find a different input with the same digest.
  • Collision resistance: it should be computationally infeasible to find any two different inputs with the same digest.

These are statements about computational difficulty, not mathematical impossibility. A hash has a finite output space, while inputs can be arbitrarily long, so some distinct inputs must share an output. The practical security aim is to make finding a useful collision infeasible for the intended use. Nor is a hash absolutely “impossible to reverse”: if an input is predictable, such as a common password, someone can guess it, hash the guess, and compare the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How hashes work as checksums and fingerprints

A checksum is a value used to detect changes in data. A cryptographic digest can play that role: calculate a file’s digest, transfer the file, calculate the digest again, and compare the two. If they differ, the data is not the same. NIST’s Secure Hash Standard describes message digests as a way to detect whether messages have changed, and its glossary characterizes a hash value as a file or message fingerprint (FIPS 180-4; NIST glossary).

Example: checking a download

  1. Get the file and its expected digest from a source you trust, such as the publisher’s authenticated website or a signed release notice.
  2. Use a local hash utility to calculate the digest of the downloaded file with the same algorithm the publisher specifies.
  3. Compare the complete digest values. A match is evidence that the file matches the reference; a mismatch means it does not.

The reference matters. If an attacker can replace both the file and the published checksum, the values can still match. A plain hash does not establish the publisher’s identity or authenticate the reference value. For authenticated integrity, use a keyed message authentication code (MAC) or a digital signature whose verification key is trusted.

Why SHA-256 is not enough for password storage

General-purpose hashes are designed to be computed efficiently. That is useful for files and many cryptographic operations, but it also lets an attacker test guesses quickly after stealing a database of password hashes. Password storage should instead use a password-hashing scheme that makes each guess more expensive, with a salt and a configurable work factor.

OWASP recommends Argon2id for new systems where available; it also discusses scrypt, bcrypt for legacy contexts, and PBKDF2 where compliance requirements apply. OWASP explicitly warns that fast algorithms such as SHA-256 are unsuitable for password storage (Password Storage Cheat Sheet).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What salt and work factor mean

  • Salt: a per-password value stored alongside the resulting hash. It helps prevent identical passwords from producing identical stored outputs and frustrates precomputed lookup tables. A salt is not a secret key.
  • Work factor: a cost setting that makes each password guess more expensive. It should be configured using current guidance and the system’s operating constraints.

NIST SP 800-63B-4 says password hashing schemes take a password, salt, and cost factor to increase the expense of guessing attacks; it specifies that the salt shall be at least 32 bits and chosen to minimize collisions among stored hashes. The salt and resulting hash are stored for each password (NIST SP 800-63B-4). Follow current standard and vetted library guidance rather than copying a parameter set without considering the implementation. Password hashing makes guessing costlier; it cannot make a weak password strong.

Hash vs. MAC vs. digital signature vs. encryption

Mechanism What it does When it fits
Hash Produces an unkeyed, fixed-length digest of data. Compact fingerprints or change checks against a trusted reference.
MAC Produces an authentication tag using a shared secret key. Checking integrity and that a message was created by someone holding the shared key.
Digital signature Uses a public-key protocol, often over a digest, to create a value verifiable with a public key. Checking integrity and supporting origin authentication relative to a trusted verification key.
Encryption Transforms data so it can be recovered with the appropriate key. Confidentiality. It is reversible with the key, unlike the intended use of a hash.

These mechanisms are not interchangeable. A checksum is not proof of sender identity, and passwords generally need password hashing rather than reversible encryption. For key-management considerations, OWASP provides a Key Management Cheat Sheet.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What NIST’s Secure Hash Standard says

NIST published FIPS 180-4, the Secure Hash Standard, in August 2015. It specifies SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256; its stated uses include generating message digests for change detection and supporting other cryptographic processes (FIPS 180-4).

On March 7, 2023, NIST announced a decision to revise FIPS 180-4, with plans to remove SHA-1, incorporate appropriate guidance, improve editorial quality, and update references. The announcement said the revision work had not yet begun at that time (NIST revision announcement). That announcement alone does not establish that a revised standard has since been issued; check NIST’s publication page for current status.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.