FlashGenius Logo FlashGenius
CompTIA Security+ Visual Study Guide

Hashing vs Encryption vs Encoding vs Digital Signatures

These four concepts are frequently confused on cybersecurity exams because all of them transform or process data, but they solve very different problems. Use this infographic to quickly identify which one protects confidentiality, verifies integrity, changes data format, or proves authenticity.

CompTIA Security+ infographic comparing hashing, encryption, encoding, and digital signatures

Fastest way to remember the difference

For Security+, associate each concept with the problem it solves. Hashing is about checking whether data changed. Encryption is about hiding data from unauthorized readers. Encoding changes how data is represented so systems can transport or interpret it. A digital signature helps prove that data came from the expected signer and was not altered.

Hash = Check
Encrypt = Hide
Encode = Format
Sign = Prove

Hashing vs encryption vs encoding vs digital signatures

Concept Main purpose Reversible? Uses keys? Confidentiality? Integrity? Authenticity?
Hashing Integrity verification No No No Yes No
Encryption Confidentiality Yes, with the correct key Yes Yes Not by itself Not by itself
Encoding Compatibility / transport Yes, by decoding No No No No
Digital signature Integrity + authenticity + non-repudiation Verification rather than secrecy Yes No Yes Yes

1. Hashing: verify that data was not changed

A hash function takes input data and produces a fixed-length digest. The process is designed to be one-way, so you do not recover the original data from the hash. Security+ questions commonly use hashing in file-integrity checks, password storage, and other situations where the goal is to detect modification rather than conceal content.

Common examples

SHA-256 and SHA-3 are common cryptographic hash examples. Password storage typically uses password-hashing techniques together with salting.

2. Encryption: protect confidentiality

Encryption converts plaintext into ciphertext using an algorithm and a key. Unlike hashing, encryption is designed to be reversible when the authorized party has the correct key. This makes encryption appropriate for protecting sensitive data at rest or in transit.

Security+ clue

When a scenario asks how to keep the contents of a file, database, disk, or network session secret from unauthorized users, encryption is usually the relevant concept.

3. Encoding: change the representation, not the security

Encoding converts data into a different representation so that another system, protocol, or application can safely transport or interpret it. It does not depend on a secret and is normally easy to reverse.

Classic Security+ trap: Base64

Base64 may make data look unreadable at first glance, but anyone can decode it. Treat it as a formatting or transport mechanism, not confidentiality protection.

4. Digital signatures: prove integrity and authenticity

A digital signature typically signs a hash using the signer's private key. A verifier then uses the corresponding public key to validate the signature. This supports integrity, authenticity, and non-repudiation.

What digital signatures do not do

A signature does not automatically hide the message. If confidentiality is also required, encryption must be used separately or as part of the overall protocol.

Common CompTIA Security+ exam traps

  1. Base64 is encoding, not encryption.
  2. Hashing verifies integrity; it does not hide the underlying data.
  3. Encryption protects confidentiality; it does not automatically prove who sent the data.
  4. Digital signatures support integrity and authenticity; they do not provide confidentiality by themselves.
  5. Password storage normally points toward hashing rather than reversible encryption.

Mini exam scenarios

Scenario 1:

A security administrator downloads a software image and wants to confirm that the file has not changed since the vendor published it.

Best concept: Hashing
Scenario 2:

An organization needs to prevent unauthorized users from reading customer data stored in a database.

Best concept: Encryption
Scenario 3:

A mail system converts a binary attachment into a transport-safe textual representation.

Best concept: Encoding
Scenario 4:

A company distributes software updates and needs recipients to verify that the update came from the company and was not modified.

Best concept: Digital signature

Frequently asked questions

What is the main difference between hashing and encryption?

Hashing is one-way and primarily supports integrity verification. Encryption is reversible with the correct key and primarily protects confidentiality.

Is Base64 encryption?

No. Base64 is encoding. It changes how data is represented but does not keep the data secret.

Does a digital signature provide confidentiality?

No. A digital signature verifies integrity and authenticity. Encryption is required when secrecy is also needed.

Why are passwords hashed instead of encrypted?

Hashing avoids storing a reversible plaintext equivalent. Proper password storage also uses additional protections such as salts and dedicated password-hashing methods.