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.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchHow 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).
#1 Best Overall
Example: checking a download
- Get the file and its expected digest from a source you trust, such as the publisher’s authenticated website or a signed release notice.
- Use a local hash utility to calculate the digest of the downloaded file with the same algorithm the publisher specifies.
- 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).
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWhat 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.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).
Rank #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.
Quick Recap
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.




