Hashes show up in password storage, file verification, and git commits alike. Here's the one idea that explains all of it.
Hashing sounds like an encryption cousin, and it gets confused for one constantly, but it solves a genuinely different problem. Encryption is meant to be reversed by someone with the right key. A hash is designed to never be reversed by anyone, key or no key. Once you understand that one distinction, most of the places hashing shows up — password storage, file verification, git commit IDs — make a lot more sense.
A hash function takes an input of any size — a single word or an entire multi-gigabyte file — and produces a fixed-length string of characters, called the hash or digest. Feed it the same input twice, and you get the exact same output every time. Change even a single character of the input, and the output changes completely and unpredictably; this is called the avalanche effect, and it's intentional. A good hash function makes it computationally infeasible to work backward from the output to figure out the original input, and equally infeasible to find two different inputs that produce the same output (called a collision).
When you create an account somewhere, a well-built system never stores your actual password — it stores a hash of it. When you log in later, the system hashes what you typed and compares that hash to the one stored in the database. If they match, the passwords match, without the server ever needing to know or store your actual password. This matters enormously for breach scenarios: if a database of hashed passwords leaks, an attacker doesn't get your actual passwords, just hashes they'd have to try to crack — which, for a well-hashed and sufficiently complex password, is impractical. This is exactly why storing passwords hashed (rather than encrypted, which could theoretically be decrypted with the right key) is the standard practice.
The other major use case is confirming a file hasn't been corrupted or tampered with. Software downloads are frequently published alongside a hash (often SHA-256) of the installer file. After downloading, you hash the file yourself and compare it to the published value — if they match, you know the file is byte-for-byte identical to what the publisher released, with no corruption from a bad download and no tampering by anyone in between.
MD5 and SHA-1 are still fine for simple non-security tasks like a rough checksum, but avoid them for anything security-sensitive — both have known practical collision vulnerabilities that SHA-256 doesn't share.
A checksum is essentially a hash used specifically to detect accidental corruption rather than intentional tampering — the same underlying idea, applied to a narrower problem. The Checksum Generator is useful for confirming a file transferred correctly, especially over an unreliable connection where a byte or two getting flipped is a real possibility.
Because hashing is one-directional by design, it's the wrong tool anywhere you need to get the original data back — that's what encryption is for. If you're storing something you'll need to retrieve later (an API key, a message, a file), hash it and you've made it permanently unrecoverable, not secure-but-retrievable. Reaching for the wrong one of these two tools is a surprisingly common and consequential mistake in software design.
Not directly — a well-designed hash function is intentionally one-way. The main practical attack is trying many possible inputs and checking if any produce a matching hash, which is why long, unpredictable inputs (like strong passwords) resist this kind of attack.
The hash algorithm used to generate a value must match the one used to verify it — a SHA-256 hash will never match a file's MD5 hash, even if the file content is identical, since they're fundamentally different calculations.
No — encoding (like Base64) is fully reversible and isn't meant for security, just for representing data in a different format. Hashing is intentionally irreversible.
Email and text messages sit in plaintext in your history forever. Here's a better way to hand off a password or API key just once.
AES protects everything from your WiFi traffic to your password manager. Here's what it actually does, without the cryptography degree.
"Random" is doing a lot of work in that sentence. Here's what actually makes a generated password strong, and what still makes it weak.
The pattern of black and white squares explained — what's actually encoded, and why they're so reliable to scan.