gg
Home › Blog › Hashing is one-way, and that is the whole point

Hashing is one-way, and that is the whole point

2026-08-26 · 3 min read
securityprivacyweb

A hash function takes any amount of data and returns a short fixed-size fingerprint. SHA-256 returns 256 bits, written as 64 hexadecimal characters. A single letter and a four-gigabyte disk image both come out as 64 characters, because the output size has nothing to do with the input size.

That last sentence contains the answer to the question people most often ask about hashes. If every input, of every length, maps to the same 64 characters of output, the output cannot possibly contain the input. There is no reverse operation, and none is missing: one-wayness is the design goal, not a limitation someone forgot to fix.

Two properties that make it useful

It is deterministic. The same input always produces the same output, on any machine, in any language, this year and next. That is what makes a hash a comparable fingerprint at all.

It scatters. Change one character of the input and the output does not shift slightly — it comes back looking entirely unrelated. There is no partial resemblance to read, which is why you cannot infer anything about an input by squinting at a hash, and also why two hashes are only ever equal or not equal. There is no such thing as nearly matching.

What it is genuinely for

Checking that something arrived intact. Hash the file you downloaded and compare it against the hash the publisher printed. If they match, your copy is the copy they described, and no transfer error or substitution happened in between. The check is only as trustworthy as where you got the published hash, though: a checksum listed on the same page as the download, and served the same way, is verifying that page against itself.

Comparing without keeping the original. If you only need to know whether two things are the same — is this the file we already stored, has this record changed since we last saw it — you can store the fingerprint and discard the content. Deduplication, cache keys, change detection and content addressing all rest on this.

Detecting change over time. Hash a config, a document or a directory listing now, and the same hash later means nothing was altered. This is the honest version of "nothing changed", because it does not depend on a modification date that anything can rewrite.

What it is not

It is not encryption. Encryption is two-way for someone holding a key; hashing has no key and no way back. So a hash is not a way to store something you will later need to read.

It is also not anonymisation, and this one catches people out. Because hashing is deterministic, hashing a phone number or an email address gives the same fingerprint every time — which means it still links records together, and if the set of possible inputs is small and predictable, a fingerprint identifies its input just as well as the input did. Hashed identifiers are pseudonymous, not anonymous, and treating them as anonymous is a privacy decision made by accident.

The one job to use a different tool for

Storing passwords. It sounds like the ideal fit — one-way, deterministic, compare the fingerprints — and for many years it was done exactly that way. The problem is that SHA-256 was designed to be fast. Fast is precisely what you want for checksumming a large file, and precisely what you do not want standing between a stolen database and the passwords in it, because anyone in possession of that database can test candidate passwords as quickly as their hardware allows, and a bare hash puts no cost in the way.

The answer is purpose-built password hashing: functions such as bcrypt, scrypt and Argon2, which are deliberately slow and memory-hungry, tuned to a cost you choose, and salted per user so that identical passwords do not produce identical stored values. They exist for this one job and they are the correct thing to reach for. If you are storing passwords, that is the family to use, in a well-maintained library, with the defaults it ships rather than parameters you invented.

The tool

The SHA-256 tool hashes whatever text you paste and returns the 64 hex characters, on your device, with nothing uploaded. It is the right tool for a checksum, a fingerprint or a cache key. There is no companion tool that turns a hash back into text, and there never will be, because that is not a feature anybody is withholding.

Try it free — with the steps shown

The SHA-256 runs in your browser and shows exactly how it got the answer, so the method sticks.

Open SHA-256

More from the blog