What is a Hash?
Hashing, told as a story about the short fingerprint every thing gets.
How do you know a book was changed?Swap a single page and it still looks the same from outside.
To compare them, you'd read every page.A thousand-page book takes all day.
A hash is the short fingerprint every thing gets.However big the book, the print is the same size. Change one letter and it's completely different. And you can't rebuild the book from it.
Fingerprints get used in three places.Checking for changes, storing prints instead of passwords, spotting the thief's things. All three are about recognizing, not hiding.
The same password gives the same print.A hundred apples, a hundred identical prints — thieves keep a table and match them. So each person gets a pinch of salt. And a print isn't a seal (encryption).
A hash = a short fingerprint for every thing. One letter changed and it differs; and you can never rebuild the thing from it.
Today's machine is SHA-256. For passwords, add salt and use a deliberately slow machine (bcrypt, argon2). It's not encryption — it recognizes, it doesn't hide.
When grown-ups say it
- Hash function
- The fingerprint machine. SHA-256 is the current one. Same input, same print, every time.
- Digest
- The print. Always the same length — 64 characters for SHA-256.
- One-way
- No way back. Which is why it isn't encryption. There's no key at all.
- Integrity · checksum
- Did it change? Does the received book's print match the sender's.
- Salt
- A pinch of salt per person. So the same password gives different prints, beating the lookup table.
- Collision
- Different things, same print. MD5 and SHA-1 retired once this became possible.
- bcrypt · argon2
- A deliberately slow machine. For passwords — slows a thief trying a million guesses.
- IOC hash
- The print of the thief's things. The print written on the wanted poster. → the footprint