Skip to content
Getting Digital

Hashing

Also: hash function, cryptographic hash, password hashing, checksum

A hash function turns input of any size into a fixed-size fingerprint in a way that cannot be reversed, so that the fingerprint can verify data or store a password without holding the original.

Our take. If a system can tell you your password, it is storing it wrongly, full stop. The only acceptable way to hold a password is a slow, salted hash designed for the purpose, and a service that emails you your password back has already failed the test that matters.

A hash function has three properties that make it useful. The same input always gives the same output, so a fingerprint can be compared later. A tiny change in the input gives a completely different output, so tampering shows. And the output cannot be worked backwards to the input, so publishing the fingerprint reveals nothing about the data. Those properties make hashes the tool for verifying a downloaded file, detecting a changed record, and storing a password in a form that lets you check a login without ever holding the password itself.

  • Integrity: a file's published hash lets you confirm the copy you downloaded is the one the author released.
  • Passwords: the system stores the hash, hashes what you type at login, and compares; the password itself is never stored.
  • Deduplication and indexing: identical content produces identical hashes, so a system can spot duplicates without comparing the content.
  • Signatures: a digital signature is made over the hash of a document rather than the document, because the hash is small and the document may not be.

The password case has its own rules, and general-purpose hash functions fail them. A fast hash like SHA-256 is designed to be quick, which is exactly what an attacker with a stolen database wants: billions of guesses a second. Password hashing uses deliberately slow functions such as bcrypt, scrypt or Argon2, tuned so that each guess costs real time, and adds a salt, a random value stored with each hash, so that two users with the same password have different hashes and precomputed tables are useless. Older functions such as MD5 and SHA-1 are broken for collision resistance and should not appear in new systems for any security purpose.

Hashing is not encryption, and the difference is the point

Encryption can be reversed by whoever holds the key; that is what it is for. A hash cannot be reversed by anyone, including the system that made it. A service that offers to recover your original password is either storing it in the clear or encrypting it with a key it also holds, and in either case a breach exposes every password at once.

In practice

A team inherits a login system that stores passwords as unsalted SHA-1 hashes. It looks hashed and it is, and it is also trivial to attack: a stolen copy of the table can be run against precomputed tables of common passwords in minutes, and every user who chose the same weak password shares the same hash, so cracking one cracks all of them. The fix does not require anyone to reset a password. On each successful login the system already has the plaintext for a moment; it re-hashes it with a salted, slow function, stores the new hash, and marks the row as migrated. Within a few weeks the active accounts are safe, and the dormant ones can be forced to reset.

Often confused with

Encryption
Encryption is reversible with a key and protects data you need back. Hashing is irreversible and protects data you only need to check, which is why passwords are hashed and messages are encrypted.
Public Key Infrastructure (PKI)
A digital signature in a PKI is made over a hash, but the hash on its own proves nothing about who produced the data; the signature and the certificate chain supply that.

Key takeaways

  • A hash is a one-way fingerprint: same input, same output, no way back.
  • Passwords need a slow, salted hash built for the purpose, never a fast general one.
  • A service that can show you your password is storing it wrongly.

Certifications that test this

Vendor exams whose syllabus covers this concept — facts, cost and a preparation path on each page.

More courses from these shelves

A rotating selection from the course directory, drawn from the subcategories where this concept is taught rather than picked for it. Details, price and the provider link are on the course page.

Ultimate Openshift (2025) Bootcamp by School of Devops

Just like how real world shipping containers revolutionised the way goods are packaged, handled and transported across…

Udemy

Complete course on Tree - Data Structures

Welcome to my crash course on Binary Trees which is one of the pivotal concepts in Advanced Data Structures and Algorit…

Udemy

Introduction to Chaos & Reliability Engineering [Hands-On]

Chaos Engineering Bootcamp: A Hands-On Guide to Building Resilient Systems with Chaos ExperimentsChaos Engineering is t…

Udemy

EXIN Agile Scrum Foundation Quiz - Sharpen Your Skills

Are you preparing for the EXIN Agile Scrum Foundation certification? Do you want to strengthen your understanding of Ag…

Udemy

Data Communication Networking Masterclass:TCP/IP, OSI & More

This is a masterclass on data communication and computer networking. The basic concepts from the beginning to the end a…

Udemy

GCP Google Cloud Professional DevOps Engineer Certification

Google Cloud Platform GCP is Fastest growing Public cloud. Professional Cloud DevOps certification is the one which hel…

Udemy

FAQ

Is SHA-256 secure?
For integrity and signatures, yes, and it is the common choice. For passwords, no, because it is fast by design and an attacker with a stolen database can test enormous numbers of guesses. Passwords need bcrypt, scrypt or Argon2.
What does a salt do?
It is a random value stored alongside each hash and mixed into it, so two identical passwords produce different hashes and precomputed tables of common passwords are useless. It does not need to be secret; it needs to be unique per record.
Can two different files have the same hash?
In principle yes, because the output is fixed-size and the inputs are not; in practice a good modern function makes finding such a pair infeasible. MD5 and SHA-1 are retired for security use precisely because collisions were found.

Sources

The primary text this definition rests on. Read it before you trust ours.

Last reviewed 13 September 2026 · Getting Digital