Lesson 2

Hash vs Encryption vs Encoding

Learn how hashing differs from encryption and encoding.

Developers often mix up hash, encryption, and encoding because all three transform data into another representation. They solve different problems.

Encoding: representation, not protection

Encoding formats data for transport or storage. Base64, for example, turns binary into printable ASCII. Anyone who receives the encoded text can decode it back. Encoding is reversible by design.

Encryption: secrecy with a key

Encryption protects confidentiality. With the correct key, ciphertext can be decrypted back to plaintext. Without the key, decryption should be impractical. Encryption answers: "How do I keep this readable only to authorized parties?"

Hashing: fingerprint, not secrecy

Hashing produces a digest for comparison and integrity checks. It is one-way under normal use. Hashing answers: "Do these bytes match a known fingerprint?" It does not hide data from someone who already has the input.

Quick comparison

MechanismReversible?Typical goal
EncodingYesTransport / display format
EncryptionYes (with key)Confidentiality
HashNo (practically)Integrity / comparison

A common mistake

Teams sometimes Base64-encode sensitive values and assume they are protected. Base64 is not encryption. Likewise, publishing an MD5 of a file helps others verify integrity, but it does not stop anyone from reading the file if they already have it.

When you want to practice, use the related DevCove tool — optional, not part of this lesson.

Open related tool

Back to course overview