Encryption, Hashing and Encoding

Randhir Ray
Computer Security
3 min readNov 9, 2019

--

In my school days I always somehow believed that Encryption and Encoding are just synonyms of one another. With time I realised how different these words where from one another. But then I got introduced to a new word ‘hashing’. It was almost similar to ‘encryption’ again.

Today in this 1st part of security series, let us discuss the basic difference between them. Then we will understand the use of each of them.

Encoding:

Encoding is the process of converting data into some other format for proper and correct communication. If we encode a message and send it, it guarantees that same message will be interpreted by the receiver. Data travels through wire in binary format ie. 0 & 1. When we send a binary data (such as image) over the network to some other computer, and we don’t encode it, the receiving computer might interpret a few characters differently. Since the sender and receiver didn’t agree on any encoding/decoding techniques, some special characters are interpreted differently by the receiver.

So Encoding is basically used for proper communication techniques, so that data should not be interpreted to something else.

Encryption:

It is the process of converting data into some other format so that only authorised user can be able to read the original content from that converted format. Its basically a way of converting plaintext to cipher text. Ciper text is the result of an algorithm/mathematical computation applied on the plain text in amalgamation with a secret key.

Suppose I have to encrypt the word ‘Hello’. Let’s say I will use the word ‘Hi’ as the secret key . After performing a basic computation I can come up with the word ‘HHieHilHilHioHi’. This final word was nothing than the cipher text. Anybody who knows that a secret key ‘Hi’ was used to form the cipher text, could derive the word ‘Hello’ from it. This process of deriving the original message is called Decryption.

There can be a situation when somebody doesn’t know the secret key, but by any mean comes to know that (It can be simple guess in our immature example), he/she can decrypt our encrypted message. Such people are called as ‘Adversary’ in Computer Security paradigm. (More on this later)

Hashing:

Hashing in a layman term can be called as one way encryption. By one way we mean that we cannot decrypt the cipher text back again. Remember we are talking about Cryptographic Hashing here, not to be confused with hashing used in Hash data structure.

Hashing is the process of applying a mathematical computation on a piece of data of arbitrary size and converting into a fixed length random unreadable data. This fixed length data can be called as hash, Message Digest or Digital Fingerprint. This Message Digest cannot be converted back to the original content unlike it can be done with Encryption.

Let wrap up this 1st part here. I have holistically tried to explain the basic difference between these three terminologies used in computing. Since this is a Security topic, we will discuss more on Encryption and Hashing later.

If you have any question, do write to me.

--

--