🔐Hashing (Cryptography)
Also known as Hash, Hash Function, Cryptographic Hash, SHA-256, Checksum
Turning any data into a short code. It can never be turned back.
Think of it like
Think of it like a fingerprint for a file. A tiny change makes a whole new print.
Example
Jack downloads a 2 GB file and its published SHA-256 hash. He hashes his copy, the two match, so the file arrived unchanged.
Why it matters
It lets you prove data was not changed, and store secrets you never need to read back.
Definition
Example code
console
$ echo -n hello | sha256sum
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 -
$ echo -n Hello | sha256sum
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 -Common mistake
Key takeaways
- 1One way. No way back.
- 2Same in, same out. Every time.
- 3Small change, new hash. Changes are easy to spot.