What is the difference between hashing and encryption ? What is their uses ?

These days i see a lot of queries about hashing and encryption. A lot of newcomers are misjudged or misinterpreted the concepts about these two. I write this post because of a mistake that i made earlier on my schooling, and i prefer no one should get confused anymore. In this post i’m going to tell you about the application rather than the science behind encryption and hashing.

What is encryption ?

Encryption provides confidentiality

Encryption is a process of conversion, where a message is converted into an another form which is not meant to be read unless it is decrypted into its original form. When we are looking on the history we can see a lot of wars. These wars had many messengers who carried a lot of information to and from the battlefields. These messages were strictly confidential and only the author and the reader should understand the content. An intruder or the messenger himself are not allowed or meant to read the message. So these messages are converted into a non readable (gibberish) format. The encryption process accepts a secret word which is a ‘key’ and this key is used for both encryption and decryption, which is known as symmetric encryption. A private-public key encryption uses two keys, ones for encryption and another for decryption.

What is hashing ?

Hashing provides integrity

Hashing is a one way conversion technique, which is not meant to be converted back. Now you may wonder, why hashing ? if it cant converted back. Questioning is a good  habit which can be used to gather new information same as it can be used to enhance your thinking skills.

Why hashing ?

Let’s consider a scenario, there are three persons named Alice, Bob and Eve (Aahh, always stick with our tradition). Alice sends a message to Bob and Eve is trying to intrude. So how Bob can know the integrity of the message ? How can  he confirm that the message is not being got tampered ?. Here we use hashing techniques. Alice sends the message to Bob with a hash of that message. According to the theory the hash can not be converted back to the original message (but its possible, using techniques like rainbow tables or using dictionary attacks), at least let’s not question it for now. One message will have only one hash, put this information on your head and process with the help of that. Lets come back to Alice and Bob, now our Bob has the message and the hash. Now our Bob will rehash the message that he received and make a comparison with the hash that originated with Alice. If the two hashes seems to be same then the Bob can ensure that the Eve couldn’t tamper the message, if its not then Bob conclude that their communication got compromised.

Can i use hashing techniques on my academic project ?

Of course you can. For example you can use hashing techniques on the user login process. Once the user got registered on your system the hash of the password is calculated and being stored on database instead of storing the password as plain text. When the user tries to login, the password that he put on the text field is being hashed and compared against the one that we have already in the database.

Conclusion

Encryption is two way where hashing is one way function. Let’s encrypt…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s