Python

Password Salting/Hashing Technique

Password salting is a technique of adding large amounts of random data to passwords before they are stored, making them much more difficult to decrypt. This article will explain how password salting does this and why it helps strengthen the security of your data.

First, let’s find out what makes up a password. A password consists mostly of numbers and letters, with varying degrees of complexity. For instance, “password” would be an easy-to-remember four-letter word that is easy to guess or crack through brute force methods (testing every possible combination).

A hacker might crack this word by guessing all combinations until they hit the right one. However, if the password were “password10” then the hacker would have to try all combinations of ten letters and numbers. Note that the number used in each word must be between 1 and 40, or they will miss.

The purpose of a salt is to make a password much more difficult to crack through brute force methods. A common salt is called MD5 (pronounced “mit-dah”). An MD5 has 160 bits of data that are randomly generated, and are used as the seed for producing a very long string (in this case, an MD5 hash). But there are many variations on this basic idea that have been created by cryptographers.

For instance, the following hashes are based on the same seed, but they have different salts: MD5(saltsa), MD5(md5salts0), MD5(md5salts1), and MD5(md5salts2). Therefore, each hash has a different difficulty level to crack. If a hacker already has the password, then they know that it is salted. But if the hacker does not have a table of all possible salts for every possible password, then any new password is considered always-hashed and cannot be cracked by brute force methods.

The process of salting a password is very simple. Two different methods are widely used and both are open source. The first method is called PBKDF2, which stands for Password-Based Key Derivation Function 2, and is used by bcrypt.php on Drupal. These processes essentially use the MD5 hashes created by MD5() and the salt to generate a longer string, called a “salt.” This new salt value is then passed to MD5() again with the original password value as some sort of input, thus creating a shortened hash that does not match the original one in length. This new hash (the salted version) is then compared against the original one using hash_equals().

Password Salting Techniques are quite important when it comes to Web Application development and its user privacy concerns. Python Django developer training in Kochi will help develop the coding skills from the beginner’s level to the most advanced. Choose a Python full stack training in Kochi that will help you to reach the heights in your career.

Author: STEPS