![]() |
In the world of computer science and data security, terms like encoding, hashing, and encryption are often used incorrectly or confused. Even though they may seem similar, they serve very different purposes. Understanding the difference is essential for designing secure and efficient systems.
Let's look at them one by one.
Encoding: changing format, not protecting
What is encoding?
Encoding is the process of converting data from one format to another to make it compatible, transmissible, or readable by different systems.
👉 It has no security purpose.
Key features
- It is reversible
- It does not use secret keys
- It serves to improve compatibility, not protection
Common examples
- Base64 (used in emails or APIs)
- UTF-8 / ASCII (character encoding)
- URL encoding (
%20for space)
Example
"Ciao" → Base64 → "Q2lhbw=="
Anyone can easily decode it.
Hashing: digital fingerprints of data
What is hashing?
Hashing transforms data into a fixed-length string called an hash. It is designed to be irreversible.
👉 You cannot trace back to the original data starting from the hash.
Key features
- Non-reversible
- Same input → same hash
- Small variations → completely different hash
- Does not use keys (usually)
What is it for?
- Storing passwords securely
- Verifying file integrity
- Digital signature of data
Common algorithms
- SHA-256
- SHA-3
- bcrypt, scrypt, Argon2 (for passwords)
Example
"password123" → SHA-256 →
ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f
Encryption: protecting data with a key
What is encryption?
Encryption is the process of transforming data to make it unreadable to anyone who does not possess a key.
👉 Unlike hashing, it is reversible, but only with the correct key.
Key features
- Reversible
- Uses one or more keys
- Main purpose: security and confidentiality
Types of encryption
- Symmetric: same key for encrypting and decrypting
(AES, ChaCha20) - Asymmetric: public / private key pair
(RSA, ECC)
Example
"Secret message" → AES + key → "x8F!kL9..."
Quick comparison
| Feature | Encoding | Hashing | Encryption |
|---|---|---|---|
| Reversible | ✅ | ❌ | ✅ |
| Uses keys | ❌ | ❌ | ✅ |
| Purpose | Compatibility | Verification and Security | Data Protection |
| Security | ❌ | ✅ | ✅ |
When to use what?
- Encoding → when you need to transmit or represent data
- Hashing → when you need to compare or verify data without storing it in plain text
- Encryption → when you need to protect sensitive data and retrieve it later
Conclusion
Even though encoding, hashing, and encryption all transform data, they do so for completely different reasons. Using the wrong method can lead to serious security or design problems.
If there is one golden rule to remember, it is this:
🔴 Encoding → does not protect and can be reversed 🔙
🔵 Hashing → cannot be reversed and can protect 🔣〰️
🟢 Encryption → protects and requires a key 🗝️✔️
Follow me #techelopment
Official site: www.techelopment.it
facebook: Techelopment
instagram: @techelopment
X: techelopment
Bluesky: @techelopment
telegram: @techelopment_channel
whatsapp: Techelopment
youtube: @techelopment
