DEV Community

kehinde
kehinde

Posted on

Data Protection: Major differences between Encryption, Hashing and Salting.

Web security is an important concept that a developer must have in consideration when building a website. It's a parameter for assessing the quality of the site built. Web security simply means ensuring that business and users data are protected and the integrity of the site is not easily compromised.

Ensuring web security and users' data protection can be achieve in so many ways. In this article, we will explore the concept of encryption, hashing and salting as methods of data protections and highlight the differences between these concepts.

Encryption
Encryption is the process by which a piece of data/information is converted into secret code that hides the information's true meaning. The science of encrypting and decrypting information is called cryptography.

In computing, unencrypted data is also known as plaintext, and encrypted data is called ciphertext. The formulas used to encode and decode messages are called encryption algorithms, or ciphers.

In programming, encryption can be done in several ways and the most popular form of encryption are hashing and salting. Encryption helps us hide the user passwords by converting the plain text into secret keys that can not be easily decoded.

Hashing
Password hashing is used to verify the integrity of your password, sent during login, against the stored hash so that your actual password never has to be stored.

Salting
Password salting is a technique to protect passwords stored in databases by adding a string of 32 or more characters and then hashing them. Salting prevents hackers who breach an enterprise environment from reverse-engineering passwords and stealing them from the database.

Encryption Packages.

Popular packages used for achieving this are JsonWebtoken, Crypto and Passport. These are the popular packages used in Node, there are others that can be explored depending on the project and programming language being used.

Conclusion

In this short article, we have try to explain the difference between encryption, hashing and salting. We have identified them as methods of ensuring web security and means of protecting user and business data. However, while Encryption is a broad term that refers to the process of hiding data by converting data from plain text to ciphertext, salting and hashing are instances of encryption that apply to password encryption.

Top comments (0)