Skip to content

Encoding, encryption, and hashing

Distinguish three commonly confused transformations by purpose, reversibility, and required secrets.

This lesson adapts the learning objective in the University of Oviedo Cryptography Applications lab: understand what encoding is for and distinguish it from encryption and hashing.

Learning objectives

By the end, you should be able to:

  • Explain why Base64 is not encryption
  • Predict whether a transformation is reversible
  • Identify when a secret key is required
  • Use a hash for comparison without claiming it hides the input
  • Save a reproducible Serialize workflow

Part 1: encoding preserves data

Install Decode Base64 and run the included sample. Anyone who knows the alphabet can reverse the representation; no secret is involved.

Try the same idea with:

Check yourself: If two people have the same Base64 text, do they need a shared secret to recover the bytes? Why not?

Part 2: a classical cipher uses a key

Install Decode a Vigenère cipher. The operation needs the key LEMON; changing that key changes the recovered text.

Vigenère is useful for teaching key-dependent transformation, but it is not suitable for modern confidentiality. A real encryption workflow must also specify mode, nonce or IV handling, authentication, key encoding, and key management.

Part 3: hashing is one way

Install Calculate a SHA-256 digest. Change one character in the input and observe the completely different digest.

Then install Calculate HMAC-SHA256. HMAC adds a secret key so a receiver can authenticate a message. It still does not encrypt the message.

Comparison

Property Encoding Encryption Hashing
Main purpose Compatibility and representation Confidentiality Integrity fingerprint
Reversible Yes Yes, with the key No practical inverse
Secret required No Yes No for plain hash; yes for HMAC
Example Base64 AES-GCM SHA-256

Assignment

Create three tabs with the same input sentence:

  1. Encode it as Base64 and decode it again.
  2. Calculate its SHA-256 digest.
  3. Calculate HMAC-SHA256 with a clearly labeled demonstration key.

Write one sentence explaining what assurance each output does—and does not—provide.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close