Security

Encoding vs Hashing

Encoding vs hashing explained: why anyone can reverse Base64, why a SHA-256 hash can't be undone, and which one to use when you store users' passwords.

  • 7 min read
  • 5 questions
  • +35 XP
Transcript

Encoding vs hashing, explained by cats. Kitty has a note with instructions. The note must travel safely between systems. So Kitty encodes it. The note changes shape. Different symbols. Different format. Same meaning. Nothing is protected. Any kitty who understands the format can read it.

Encoding is for compatibility. For transport. And for storage. The original note can always be restored. Because encoding is reversible. Now. Hashing. Kitty takes the note and drops it into a magic mixer. The mixer always spits out a short code.

The same note always produces the same code. But the code can never turn back into the note. Hashing is one way. No undo. No reverse. Encoding changes representation. Hashing creates identity. One preserves the message. The other proves it once existed.