Hashing vs Encryption vs Encoding
Subtitle: Three words. Three jobs.
- Left column - HASHING:
- One way. No key. No undo.
- Same input, same digest
- Fixed length output
- Verify, never recover
- SHA-256, bcrypt, Argon2id
- Middle column - ENCRYPTION:
- Two way. Needs a key.
- Same input, new ciphertext
- Undo only with the key
- Hide data from others
- AES-GCM, RSA, ChaCha20
- Right column - ENCODING:
- Two way. No key at all.
- Not security. Just format.
- Anyone can reverse it
- Move data safely
- Base64, URL, hex, UTF-8
- Simple difference:
- Hash = a fingerprint
- Encrypt = a locked box
- Encode = a new alphabet
Use it when - HASHING: passwords, file integrity, signatures
Use it when - ENCRYPTION: secrets in transit or at rest Use it when - ENCODING: binary in JSON, URLs, email
Sticky note - Common beginner mistake:
Base64 is not encryption. It hides nothing; anyone decodes it in one line. And never encrypt a password when you only need to verify it - hash it.
