Hashing vs Encryption vs Encoding: Do Not Mix These Up
Security+ loves this distinction: encryption protects confidentiality, hashing checks integrity, and encoding changes representation without being security.
Quick answer
Encryption is reversible with the right key and protects confidentiality. Hashing is one-way and is used to verify integrity. Encoding is reversible formatting for compatibility or representation and should not be treated as a security control by itself.
Start with reversibility and purpose
If the goal is to hide readable data from unauthorized viewers, the cue is encryption.
If the goal is to detect whether data changed, the cue is hashing.
If the goal is to change format so data can be stored or transmitted, the cue is encoding, not security.
- Encryption: reversible with a key, protects confidentiality.
- Hashing: one-way digest, supports integrity checking.
- Encoding: reversible representation, not a security control alone.
- Obfuscation may slow understanding but should not be treated as strong protection.
Transformation terms compared
Encryption
Best for
Confidentiality when data must be recovered later.
Exam cue
Key, decrypt, protect data at rest/in transit.
Common mistake
Using it when the scenario only needs tamper detection.
Hashing
Best for
Integrity checks and password verification workflows.
Exam cue
Digest, one-way, hash mismatch, verify unchanged.
Common mistake
Saying a hash can be decrypted.
Encoding
Best for
Changing representation for compatibility.
Exam cue
Base64, format conversion, display/transmission compatibility.
Common mistake
Calling encoding encryption.
Obfuscation
Best for
Making content harder to read casually.
Exam cue
Masking, hiding implementation detail, slowing analysis.
Common mistake
Treating it as equivalent to strong encryption.
Scenario cues to look for
A downloaded file has a published digest and the user compares it after download.
Answer: Hashing
The digest is used to verify integrity.
Why not the distractor: Encryption would hide content, but the cue is detecting change.
A database field must be unreadable if the storage is stolen but recoverable by authorized systems.
Answer: Encryption
The data must be hidden and later recovered.
Why not the distractor: Hashing is one-way and would not recover the original field.
A string is converted into Base64 so it can travel safely through a text-only channel.
Answer: Encoding
The purpose is representation compatibility.
Why not the distractor: Base64 is reversible and not a confidentiality control.
Common exam mistakes
Saying hashes are decrypted.
Hashes are one-way; you compare digests rather than decrypt them.
Treating encoding as security.
Encoding changes representation and is easily reversed.
Choosing encryption when integrity is the only goal.
If the prompt says verify unchanged, think hash.
Quick practice questions
Answer each question to reveal the explanation. The full app adds tracked results and weak-area review.
Q1.Which technique creates a one-way digest to verify integrity?
Q2.Which technique is reversible with the correct key and protects confidentiality?
Q3.Why is Base64 not enough to protect sensitive data?
Ready to test your knowledge?
Try the free CompTIA Security+ practice test, or use the app for tracked weak-area review.