Understanding Encryption, Encoding, Hashing, Compression, and Obfuscation

Viral Vaghela
3 min readSep 30, 2023

In the world of data manipulation and security, several key terms often come up: encryption, encoding, hashing, compression, and obfuscation. Each serves a unique purpose and has its own characteristics. Let’s explore these concepts in simpler terms:

1. Encryption:

Purpose: Encryption is like a secret code for your data. It’s a way of transforming information into a format that only someone with a special key can understand. The main aim here is to keep sensitive data safe from prying eyes.

Reversibility: If you have the key, you can turn encrypted data back into its original form. Without the key, though, it just looks like gibberish.

Examples: Think of encryption methods like AES (Advanced Encryption Standard) or RSA. These are used to secure everything from your online banking transactions to your email communication.

2. Encoding:

Purpose: Encoding is like translating data from one language to another, but not for secrecy. It’s about making sure data can be correctly understood in a particular context, like when sending it over the internet or storing it.

Reversibility: Encoding is reversible. You can decode it and get your original data back, as long as you know the encoding method and have the right decoder.

Examples: URL encoding and Base64 encoding are commonly used for this. They help ensure special characters in URLs or binary data are handled properly.

3. Hashing:

Purpose: Hashing is like turning a message into a unique fingerprint. It’s a one-way process where you take some input (like a document or a file) and turn it into a fixed-size string of characters. This is mainly used to check if data has been altered.

Reversibility: Hashing is not reversible. Once you’ve hashed something, you can’t get the original data back. However, the same input will always produce the same hash.

Examples: SHA-256 and MD5 are common hash functions. They’re used for data verification and ensuring data integrity.

4. Compression:

Purpose: Compression is like squeezing the air out of a balloon to make it smaller. It’s used to reduce the size of data, making it easier to store or send over the internet. The goal is to save space or bandwidth without losing important information.

Lossless vs. Lossy: There are two types of compression. Lossless compression keeps all the original data intact when you decompress it, while lossy compression sacrifices some data to achieve higher compression ratios. Think of JPEG and MP3 for images and audio.

Examples: ZIP for lossless compression and JPEG for lossy compression. Text documents and program files often use lossless compression.

5. Obfuscation:

Purpose: Obfuscation is like putting on a disguise. It’s a way of making data or code harder to understand or reverse engineer. This is often used to protect software source code or valuable algorithms from unauthorized access or theft.

Techniques: Obfuscation techniques involve things like giving variables and function cryptic names, adding meaningless code, or changing the flow of the code. These tactics make it tough for someone to figure out what’s going on.

Security vs. Legibility: While obfuscation boosts security by making reverse engineering difficult, it can also make code less readable for developers. Finding the right balance between security and maintainability is crucial when using obfuscation techniques

--

--

Viral Vaghela

𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 Researcher • Software Developer •