DEV Community

Bpass25
Bpass25

Posted on

What is the difference between encryption, hashing, obfuscation, and encoding?

Hello everyone! Today we'll be discussing several topics.

1- Encoding: Simply put, it's the process of converting data from one format or shape to another, such as BASIC64 or URL encoding.

Benefit: Not for protection or encryption, but because some systems require it to handle complex images or text. #Anyone can easily reconfigure the data.

Where it's used: Mostly on websites.

Example: From "Hello World" to "Hello%20World%21"

2- Encryption: This process converts data into a known text or shape. A key is used to decrypt it.

Benefit: It encrypts data, making it unreadable by anyone.

Where it's used: In many applications, such as WhatsApp, for encryption. When a message is sent, it's encrypted with a key and decrypted when it reaches the recipient with a specific decryption key. (Note: If someone manages to obtain the decryption key, the message is lost. This is difficult and requires extensive expertise.)

Example: hi ali will be converted to Ax7#92!kzQ

3 - Hashing: Converts data into a fixed form or number, such as using the SHA-256 hash type.

Benefit: Ensures that the data has not been tampered with or modified, as it will be subject to matching.

Note: It cannot be reverted to its original state as in encoding, but it can be broken, meaning it is one-way, unlike binary encryption.

Where it is used: It is used in storing passwords. Databases do not store data as numbers like 1234, but as hashes, and even the website programmer cannot decipher it.

For example: The password MyPassword123 is converted to 48503dfd58720bd5ff35c102065a52d7

4 - Obfuscation: A process that converts data into a very complex and incomprehensible form, although this code will function normally when executed. Benefit: It's used to protect the application from reverse engineering, hacking, or other operations aimed at damaging or cracking it in general. Hackers also use it to bypass security measures, antivirus software, and so on. So it's useful for both sides 😂😂😂. However, the type of interference varies because it can also reveal [something].

Example: PrintPassword() to a1_x9()

Or another example using JavaScript:


From `function checkLogin(user) {
if (user == "admin") return true;

}
To `function _0x2b(_0x1){if(_0x1==\x61\x64\x6d\x69\x6e){return!![];}}`
Enter fullscreen mode Exit fullscreen mode

Top comments (0)