What are the differences between encryption, salting and hashing?

These security techniques have different applications but work together to get higher levels of data protection.

Written by Vaultree Team

April, 07 2022 in Encryption

There are many techniques for data protection; encryption, salting, and hashing work together with their particularities to help protect data, but they're not the same. Instead, each has specific characteristics that make them perfect for working together whilst achieving different goals.

Encryption, for example, is the encoding of data so that the "readable" file is only accessible by those who have a specific key. This protects data even if there are leaks. Hashing involves calculations that can't be reversed, with unique properties that make them perfect for authentication. Finally, salting adds a special seasoning, if we may say so, to your data before it is hashed to help keep it safe during storage.

What is encryption?


In simple terms, encryption means converting data from one form (usually the understandable form) to another (incomprehensible) using an encryption key. It is done to scramble and hide information and protect it from those who don't hold the decryption key.

If any malicious user intercepts the data in its encrypted form, it will be incomprehensible. So, encryption ensures data confidentiality, and it is regularly used in web applications that use SSL, for example, but for many other processes of securing data. It can be especially useful for making sure that sensible information cannot be "read" by third-parties.

Encryption is a two-way process and can be asymmetric or symmetric. Different encryption algorithms are used to scramble the data, such as AES, the most commonly used symmetric block cipher. 

What is hashing?


Hashing is the process of converting data to a fixed length called a "hash value". Different from encryption, it is a one-way process. While with encryption, data is converted with the plan to decrypt it eventually, hashing is a one-way function - it will not be dehashed. This makes it the perfect tool for authentication. 

Hashing also protects data, but not in the way encryption does. Since every hash value is unique, two different files cannot produce the same hash value, and it cannot be dehashed, this technique is perfect for verifying that a piece of data hasn't been altered. Hashing, therefore, is commonly used to detect errors in a process called check-sum.

Some types of hashing are used, like MD5, SHA1, and SHA256, for example, referring to the fixed-length output. 

What is salting?


In simple terms, salting is adding random data when converting it using hashing. This is where everything comes together.

By salting data, usually a password, a new layer of security to the upcoming hashing process is added, mainly to prevent a botnet from attempting every possible combination until a password is found. 

So, for example, if your password is 1234 (which, if you have been reading our blog, it shouldn't be), your salt could be the word SALT.  Before the hashing process, you do the salting process, creating 1234SALT. This will change the hash value created later, as the data is now different. 

When you salt the password, you basically hide the real hash value, further protecting it. 

All three processes serve different purposes, but all work together to protect your data in a world where cybersecurity is one of the most significant issues for companies, governments, and individuals. 

More from our blog

May, 12 2023 in Encryption

ISO 27001, GDPR Compliance and Encryption: What you need to Know

A Guide to Understanding the Relationship between Encryption, Compliance, and Security Requirements

Author: Vaultree Team

May, 03 2023 in Encryption

What is Confidential Computing and What are its Limitations

Vaultree's Fully Functional Data-in-Use Encryption Solution vs Confidential Computing: A Revolutionary Approach to Data Security

Author: Vaultree Team

April, 14 2023 in Encryption

Tokenisation vs Encryption: which one is better?

When it comes to data protection, be aware of the most functional technology already available

Author: Vaultree Team