Encryption, Encoding, and Hashing are kind of similar terms and are often confused with each other. So let’s discuss each term and how they are different from each other.
In the Encoding method, data is transformed from one form to another. The main aim of encoding is to transform data into a form that is readable by most of the systems or that can be used by any external process.
It can’t be used for securing data, various publicly available algorithms are used for encoding.
Encoding can be used for reducing the size of audio and video files. Each audio and video file format has a corresponding coder-decoder (codec) program that is used to code it into the appropriate format and then decodes for playback.
Example: ASCII, BASE64, UNICODE
Encryption in encoding technique in which message is encoded by using encryption algorithm in such a way that only authorized personnel can access the message or information.
It is a special type of encoding that is used for transferring private data, for example sending a combination of username and password over the internet for email login.
In encryption, data to be encrypted(called plain-text) is transformed using an encryption algorithm like AES encryption or RSA encryption using a secret key called cipher. The encrypted data is called cipher-text, and finally, the secret key can be used by the intended recipient to convert it back to plain-text.
There are two types of encryption algorithms – symmetric and asymmetric encryption.
In case of symmetric encryption data is encoded and decoded with the help of same key, for example AES encryption algorithm but in case of asymmetric encryption algorithm, data is encrypted with help of two keys, namely public and private key, for example. RSA algorithm
In hashing, data is converted to the hash using some hashing function, which can be any number generated from string or text. Various hashing algorithms are MD5, SHA256. Data once hashed is non-reversible.
Hash function can be any function that is used to map data of arbitrary size to data of fixed size. The data structure hash table is used for storing of data.
For example: When you send pictures and text messages over WhatsApp over StackOverflow(posting in questions), images are sent to different server and text is sent to a different server for efficiency purposes. So for verifying images that the images are not tampered in between data transfer over the internet, hashing algorithm like MD5 can be used.
Another purpose for hashing is for verifying passwords for login on various websites, as shown in the image.
- Encoding a word into Pig Latin
- Understanding Character Encoding
- Basic Type Base64 Encoding and Decoding in Java
- Program to implement Run Length Encoding using Linked Lists
- Hashing in Distributed Systems
- Node JS | Password Hashing with Crypto module
- How to Crack System Design Round in Interviews?
- 10 Tips to Protect Your Online Data Privacy in 2019
- If we delete cookies of a site, we can still logged in without logging again
- 7 Common Programming Principles That Every Developer Must Follow
- SOLID Principle in Programming: Understand With Real Life Examples
- Best Books to Learn Back-End Web Development
- Evolution of Foldable Smartphones
- Geek Week – Celebrate The Biggest Programming Festival With GeeksforGeeks
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai