Difference between Hashing and Encryption
Key Difference: Encryption deals with the transformation of data in order to keep it confidential or secret from others. On the other hand, Hashing is based on the concept of integrity. In hashing, a new message is created from the original message in a particular way by which it cannot be reversed. Unlike encryption, it does not require a key to unlock the message, as there is no way to get back the original message from the new message.
include("ad4th.php"); ?>Encryption deals with the transformation of data in order to keep it confidential or secret from others. It is basically a process that involves encoding the information in a way that it cannot be read by the unauthorized parties. In the receiver’s end, the encrypted message is again decrypted in order to get the original message.
It is an important way of providing security to the information. It makes use of a mathematical formula known as a cipher and a key to convert plain text into the cipher text. The important entity in this process is key which makes the encrypted data unique. Generally, keys are a long sequence of numbers and are protected by mechanisms like passwords, tokens, etc. In symmetric encryption, only a single key is used for encryption and decryption. On the other hand in asymmetric encryption, separate keys are used for encryption and decryption.
Hashing is based on the concept of integrity, where it ensures that if something is changed then it is brought into the notice. In hashing, a new message is created from the original message in a particular way by which it cannot be reversed. Unlike encryption, it does not require a key to unlock the message. It is used for verifying files, etc. In this way, it ensures that the integrity is maintained. Once the message is hashed, its hash is used for comparisons. If the hash is same for any message then it is regarded as the same as original message.
include("ad3rd.php"); ?>Hash algorithms are written in ways such that collisions can be avoided. These collision occur when the same digest gets generated by different messages. Therefore, the primary difference between encryption and hashing is that encryption is the process of converting plain text into cypher by using an algorithm. The encrypted message can only be read by knowing the encryption key. On the other hand, hashing involves the conversion of plaintext into a hash or digest. A digest cannot be reversed into the original message. It is used for ensuring integrity of the data.
Comparison between Hashing and Encryption:
|
Hashing |
Encryption |
Defintion |
Hashing involves the conversion of plaintext into a hash or digest. A digest cannot be reversed into the original message. It is used for ensuring integrity of the data. |
Encryption is the process of converting plain text into cypher by using an algorithm. The encrypted message can only be read by knowing the encryption key. |
Protection of |
Integrity |
Confidentiality |
Unlocking |
No key can be used for unlocking |
Requires key for unlocking |
Example |
Major Linux distributions gives an MD5 hash for their downloads to verify that the file was not corrupted during transmission. |
Skype-to-Skype voice, video, file transfers and instant messages are encrypted. This provides the protection from potential eavesdropping by malicious users. |
Channel |
One way |
Two way |
Action |
Relatively light |
Relatively heavier |
Input/Outpul |
Variable-length piece of data/fixed length of message digest |
Variable-length piece of data/fixed length encrypted string |
Image Courtesy: unixwiz.net, packetlife.net
Add new comment