We often see or hear the words such as encoding / encryption / hashing. These are related to techniques meant for data transformation from one format to another and used to enable data privacy or proper consumption of data by electronic devices such as computers.
Lets have a quick look at the differences between these techniques...
Encoding means converting of data from one format to another so that it can be easily consumed by different types of systems. Encoded data can easily be decoded / reversed by knowing the technique used.
Example use cases : i) url encoding by browser for ensuring proper usage of special characters such as space, single quote, double quote etc. ii) encoding of special characters such as &,>,< for ensuring proper usage by browser while rendering of content.
Examples of encoding techniques : Base64, URL Encoding, Unicode etc.
Encryption means converting of data from one format to another so that it can be kept secret or secured. Here, encryption ensures that the data is transmitted to intended recipient. Encrypted data can be decrypted / reversed only by using the key and algorithm used.
Example use cases : i) securely sending a password over the internet ii) securely sending secret data to recipient over the internet.
Examples of encryption algorithms : AES, DES, RSA etc
Hashing of data produces a fixed length string which can be used in ensuring the data integrity. Hashing is a one way transformation of data from one format to another which cannot be reversed.
Example use cases : i) Sending the encrypted data along with hash produced from data is used to detect any change in data at recipient side.
Example algorithms : SHA-3, MD-5 etc.