Encoding, Encryption, and Hashing

Encoding, encryption, hashing…

Image by http://bit.ly/11i4VRC
Image by http://bit.ly/11i4VRC

Those three can easily be confused since they serve roughly the same purpose. Yet, there are drastic differences between them. This article will serve the purpose of telling you, which method to use for which purpose, and what distinguishes them from one another.

Yet, all differences aside, encoding, encryption, and hashing do share some similarities:

  • All three methods transform data into another format
  • Encoding and encryption are reversible, while hashing is not

Now, let’s have a look at the three methods of data transformation one by one before you will presented a short summary of the differences and when to use which method.

Encoding

Encoding is mainly used in data storage, computation or the sending of data in form of texts.

It is used to transform a set of characters (numerals or letters) in a way so another system is able to read the information contained in the encoding. Publicly available encoding systems are used to do so, transforming the initial data into bit patterns, numbers, electrical impulses, or any other kind of code. The encoded messages can easily be decoded by using the algorithm that has been used to encode the data.
Thanks to internationally deployed encoding standards, an exchange of textual information worldwide via email or cloud storage is possible.

Encoding does not serve the purpose of keeping the encoded data private! Since the different algorithms are available to the broad public, encoded data can easily be read in many systems. It’s purpose is to transform data into a format that is readable by many systems.

Examples of Encoding include: ASCII code, Unicode, base64, or sending files via email

Encryption

Encryption is a special kind of encoding that is used to send secret data like letters and passwords over the internet, using a secret key that ensures that only the people intended to read the content can access it. Thus, contrary to encoding, the purpose of encryption is to keep data secret from those that are not supposed to see or read it. Thus, the usability does not play a major role in encryption.

The data that is subject of the encryption is referred to as plaintext, the result generated by using an algorithm is known as being the cyphertext. During the encryption process, data is transformed into another format as well, using a special key. Without using the exact same key, the ciphertext, and the alogrithm used, the recipient of the secret data can not reverse the encryption process. The encrypted message is not safe from interception, yet the content of the message is.

Popular algorithms for encryption are: AES, RSA, or Blowfish

Hashing

Hashing or the resulting hashes are widely used in computer software since they simplify the lookup of big data to detect duplicate strings. It is used in cryptography as well since it provides a fast and easy way to ensure that some kind of input data matches the value stored in the hash. Hashes can also be used to validate the integrity of data, by comparing two hashes and looking for obvious and drastic differences which would define two input contents as being different as well.

Reconstructing the data used to generate a hash is near impossible. Furthermore, two hashes created from almost the same data will always differ from one another and not generate an identical hash. Since the same input will always create the same output though, create a hash from a large set of data allows you to check if this set of data has been altered by creating a new hash after some time, and comparing both hashes. Thus, if a change has taken place in the input data, the second hash differs drastically from the first one.

Examples for Hashing include: BlowFish, SHA-3 and other hash generators

Conclusion

Now that we know what each method does and what it’s used for, it’s time to give a quick overview and comparison of the functions:

Encoding Encryption Hashing
Data Security Not secure Secure Secure
Reversibility Reversible Reversible Not reversible