Skip to content
DDevToolery

Hashing, encryption or encoding?

Which tool you need depends on whether the data must be readable again.

These three get used interchangeably in conversation and never in code.

  • Encoding — reversible by anyone, no key. Base64, URL encoding, hex. Use it to move bytes through a text channel.
  • Encryption — reversible with a key. Use it when the data must be read again later.
  • Hashing — not reversible at all. Use it to check whether two things are identical without storing one of them.

Which tool

  • Verifying a downloaded file — File Checksum with SHA-256.
  • Proving a message came from someone with a shared secret — HMAC Generator.
  • Putting binary data in a JSON field — Base64 Encoder.
  • Assessing a password — Password Strength.

What DevToolery does not do

There is no encryption tool. Encrypting something usefully requires key management, and a web page is the wrong place to hold a key. There is also no hash reversal tool, because hashes cannot be reversed — sites offering it are searching a table of precomputed common inputs.

MD5 and SHA-1

Both are offered and both are marked as legacy. They are fine for detecting accidental corruption and unsuitable anywhere an adversary might choose the input.