The Wayback Machine - https://web.archive.org/web/20240902021359/https://www.geeksforgeeks.org/what-is-salted-password-hashing/
Open In App

What is Salted Password Hashing?

Last Updated : 25 Aug, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Salted password hashing can be used to improve password security by adding additional layers of randomness on top of the hashing process. Salt is a cryptographically secure random string that is added to a password before it’s hashed, and the salt should be stored with the hash, making it difficult for an attacker to know the original plaintext without having access to both sources. This process is often used in combination with bcrypt, another function that adds computing requirements for each and every attempt by an attacker who doesn’t have access to either source. Salted hashing is a much more complex and secure process because each hash requires the use of a different and random ‘salt’, that acts as an additional layer of encryption. This means that every known salt (or collection) is required to perform the password hashing function.

Salted Password Hashing

 

E-mail Attachments:

A sample E-mail containing an attachment is used to demonstrate how salted password hashes are applied in combination with bcrypt to create a secure, yet time-consuming, process for attackers. Bcrypt takes the input and produces a string of numbers that can then be converted into a password hash using various algorithms.

Attacking Unsalted Passwords: 

Since the salt is not stored with the hash, attackers typically cannot determine which hashing scheme was used and therefore cannot reverse engineer the hash. Without an outside source of plaintext to compare a password hash with, attackers will be forced to guess brute force style. In order to brute force an unsalted password hash, you need both plaintext and password hashes. The hashes with the same plaintext must have the same salt so that there are only 2 choices, either you match both or you don’t match either. It’s much easier than guessing passwords one by one to find a matching hash pair, as it can be done in parallel.

Cracking Unsalted Hashes with Tables:

  • Create a lookup table from O(1) to 2^(n/2)-1: A table of all the possible salt values can be found by simply generating random text strings and storing them. 
  • For example, in PHP you can do: echo md5(shuffling($salt))
  • Generate all possible password hashes for your salt value and pipe it into your lookup table.
  • Pick the number of hashes that match your original plaintext, and you will have the correct password for your salt value.
  • To understand salted password hashing, you first need to understand how bcrypt works and what it does to generate a secure hash. Bcrypt is a function that takes an input string and produces one of many possible password hashes, depending on how much processing is required to generate each hash (similar to how MD5 has become outdated).

Mitigation and prevention:

  • The value of the salt should be about as long as the maximum password length allowed by your application.
  • The salt should be non-deterministic, a random string appended to each password before hashing is recommended.
  • Salted passwords can be stored in a database rather than encrypted with a key since the hash will be different for each combination of salt and password, even though they use the same plaintext input string.
  • To make it harder for attackers to reverse engineer the hashing, the salt should remain dynamic. Instead of using a single random string, you can use a random hash algorithm such as sha512 or bcrypt and store the pre-hashed password in a database.
  • It is possible to have multiple salts for each user by using public/private keys for every account and salting each password separate from its corresponding public key (the private key is required to generate salted hashes).
  • If the attacker has access to plaintext, they can still attack your salted hashes. This usually isn’t an issue because attackers typically have access to only one input source for all their attacks anyway.

Previous Article
Next Article

Similar Reads

What is a Default Password Attack Threat?
The term “attack” is used here to denote performing a variety of hacks, including brute force and social engineering, that require access to the target's computer system or network. Here are some terms and processes related to this skill boot camp: Brute ForcingPassword HashingCapture The Flag (CTF)PhishingBrute Forcing:Brute forcing is the process
3 min read
What is Elcomsoft Distributed Password Recovery?
Elcomsoft Distributed Password Recovery is software to help you break the password on various types of computers, including standard Windows and Linux PCs. In order to use Elcomsoft Distributed Password Recovery, you will need a Home Agent application installed on your computer. The Home Agent is a free download that eases the installation process
4 min read
What is Password Guessing Attack?
There are a number of methods to crack a user's password, but the most prominent one is a Password Guessing Attack. Basically, this is a process of attempting to gain the system's access by trying on all the possible passwords (guessing passwords). If the attacker manages to guess the correct one, he has complete access to the remote system, can ma
4 min read
What is Non-Electronic Password Attack on a System?
Non-electronic password attacks are forms of hacking that seek to bypass any form of authentication or authentication system. Typically, a non-electronic password attack will use an automated script to probe for passwords on the network. One way this may be done is by placing port scanning software on an access point, expecting to gain access witho
3 min read
How to Defend Against Password Cracking of Systems?
To Defend against Password Cracking of systems in Ethical Hacking, you need to know how password cracking functions. Password cracking is the act of using a computer program to try to guess an inputted password. There are many forms of attacks that can be used in this process, but they all result in the same goal of trying to gain access to an acco
6 min read
Password Auditing With L0phtcrack 7 Tool
In essence, password auditing programs make guesses about the credentials being used on your network. They accomplish this using a combination of brute force and dictionary assaults, among other techniques, and then inform you of any other ways the passwords may be compromised, such as by being pwned. L0phtCrack:An application called L0phtCrack is
5 min read
How To Use Ophcrack for Windows Password Recovery?
Ophcrack is a free, open-source tool that can be used to recover lost Windows passwords. It works by using pre-computed tables to crack password hashes, allowing users to recover their forgotten passwords quickly and easily. In this article, we will take a look at how to use Ophcrack for Windows password recovery, with step-by-step instructions and
5 min read
Sniffing of Login Credential or Password Capturing in Wireshark
Wireshark is a free and open-source packet analysis tool that lets you capture and analyze network traffic in real-time. It is available for Windows, macOS, and Linux operating systems. Wireshark captures network packets and displays the captured data in a human-readable format for easy analysis and troubleshooting of network issues. It can scan a
3 min read
5 Most Popular Methods Used By Hackers To Crack Password
In today's world, almost ÐĩvÐĩryonÐĩ has bank accounts, Ðĩmail and social mÐĩdia accounts that rÐĩquirÐĩ passwords to accÐĩss. HowÐĩvÐĩr, many pÐĩoplÐĩ ÐĩithÐĩr storÐĩ thÐĩir passwords on thÐĩ dÐĩvicÐĩ or choosÐĩ wÐĩak passwords that can bÐĩ Ðĩasily guÐĩssÐĩd. HackÐĩrs arÐĩ always trying to stÐĩal passwords that give thÐĩm access to thÐĩsÐĩ accounts. ThÐĩy usÐĩ diffÐĩrÐĩnt mÐĩthods t
6 min read
Cyber Security Interview Questions
Cybersecurity is the act of protecting computer systems, networks, programs, and data from digital attacks, unauthorized access, damage, or theft. Cybersecurity is a critical aspect of modern technology, with its importance growing as digital systems become increasingly integrated into our daily lives. With threats ranging from data breaches to mal
15+ min read
Introduction to Dirb - Kali Linux
Dirb is an online directory scanner that searches web servers for hidden files, directories, and pages. It is a free and open-source utility included in the Kali Linux distribution, a popular operating system for penetration testing and ethical hacking. Dirb may be used to detect typical web server folders and files, such as admin pages, backup fil
7 min read
How to hack android phones with Phonesploit
Understanding how to hack android phones with Phonesploit has become a topic of interest and concern. Phonesploit is a powerful tool that allows users to remotely access and control Android devices, offering capabilities ranging from retrieving sensitive information to executing commands on the target device. This tool leverages vulnerabilities in
6 min read
Cyber Security Tutorial
Cyber security, also known as information technology security, refers to the practice of protecting systems, networks, and programs from digital attacks. These cyber-attacks are usually aimed at accessing, changing, or destroying sensitive information, extorting money from users, or interrupting normal business processes. This cybersecurity tutoria
6 min read
What is Google Dorking?
Google Dorking is a technique used by hackers and security researchers to find sensitive information on websites using Google's search engine. It is also known as Google hacking or Google Dorking. Search FiltersGoogle Dorking involves using advanced search operations in Google to search for specific keywords, file types, or website parameters. Thes
4 min read
Ethical Hacking Tutorial
This Ethical Hacking tutorial covers both basic and advanced concepts of Ethical Hacking. Whether you are a beginner or an experienced cybersecurity professional, this tutorial is the perfect resource to learn how to tackle vulnerabilities and weaknesses in systems before malicious hackers can exploit them. From understanding the hacking basics to
11 min read
Difference Between Conventional Crime and Cybercrime
Pre-requisites: Cybercrime, Cybercrime Causes, And Measures To Prevent It Crime generally refers to an illegal act that's punishable by law and regulation. According to Merriam-Webster, wordbook crime is described as “an act or the commission of an act that's interdicted or the elision of a duty that's commanded by a public law and that makes the l
3 min read
How To Install Super Bluetooth Hack on Android?
Super Bluetooth Hack is a very impressive app and will certainly come in handy if you need to know what that unknown phone is doing near you. However, if you don't feel the need for it anymore, then be sure to simply uninstall it from your phone through your App Manager. Steps of Preparing to HackThe first step of installing Super Bluetooth Hack on
4 min read
How to Hide Payloads and Backdoor Inside Images?
In this article, we are going to use ExifTool to hide our payloads or a Backdoor inside an Image. You can learn about the basics of ExifTool from the above article and its functionality, and commands to make the best use of the tool. This tool is best for Hiding payload and extracting metadata from the images. It is an open-source and popular tool
2 min read
Nmap Cheat Sheet
Nmap (Network Mapper) is a free and open-source network detection and security scanning utility. Many network and system administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring server or service availability. Nmap uses raw IP packets in a novel way to determine the hosts available o
4 min read
How To Extract rockyou.txt.gz File in Kali Linux?
The first thing that comes to mind when we think of brute-forcing a login with word lists is rockyou.txt. There is a lot of talk on the internet about rockyou.txt being the most popular file used by hackers and crackers to extract passwords. The interesting thing about this is that ethical hackers can use it to breach the security of any web applic
2 min read
I/O Graphs Window in Wireshark
One of the really handy parts of the Wireshark is being able to see all the data that we have captured in really useful ways such as a graph. This can be very useful if we want to see how much traffic is flowing across our network and is very useful if we have a huge amount of data to sift through. The Wireshark's I/O graph is one of the basic grap
3 min read
SMTP Enumeration
SMTP (Simple Mail Transfer Protocol) is a set of communication guidelines that allow web applications to perform communication tasks over the internet, including emails. It is a part of the TCP/IP protocol and works on moving emails across the network. SMTP enumeration allows us to identify valid users on the SMTP server. This is done with the buil
2 min read
What is ARP Spoofing Attack?
Spoofing is a type of attack in which hackers gain access to the victim's system by gaining the trust of the victim (target user) to spread the malicious code of the malware and steal data such as passwords and PINs stored in the system.In Spoofing, psychologically manipulating the victim is the main target of the hacker. Address Resolution Protoco
3 min read
How Hackers Use Social Engineering to Get Passwords on Facebook?
Social engineering is a powerful method for hackers to exploit computer systems without the use of malware or computer hacking tools. To carry out a successful social engineering hack, ethical hackers need to understand how to effectively use social media and human interaction to obtain sensitive information. Social engineering is an essential skil
4 min read
Direct Sequence Spread Spectrum in Wireless Networks
Direct-sequence spread spectrum in Wireless Networks is a technique that transmits a data signal over a range of frequencies, spreading it uniformly across the allocated spectrum. Direct-sequence spread spectrum is used to ensure that a particular frequency band (and its corresponding range of frequencies) is kept free from interference. This techn
7 min read
TCP Analysis using Wireshark
TCP or Transmission Control Protocol is one of the most important protocols or standards for enabling communication possible amongst devices present over a particular network. It has algorithms that solve complex errors arising in packet communications, i.e. corrupted packets, invalid packets, duplicates, etc. Since it is used with IP(Internet Prot
5 min read
Remote Access in Ethical Hacking
Remote access is a vulnerability through which attackers can control any device. Most commonly, payloads are used for remote control. Payloads are sent through social engineering or phishing attacks. Once the payload is injected, the actual attack begins. The payload will provide a reverse connection. Most commonly, Metasploit framework is used for
5 min read
Frequency-Hopping Spread Spectrum in Wireless Networks
Frequency-hopping spread spectrum is designed for robust operation in noisy environments by transmitting short packets at different frequencies across wide portions of channel bandwidth. The receiver correlates these "near" signals against each other and selects the best signal for demodulation, which typically gives better performance compared wit
3 min read
How to Brute-Force SSH in Kali Linux?
The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its applications are remote login and command-line execution. SSH protocols are based on the client-server architecture, i.e the SSH client and the SSH server. This article explains the SSH Bruteforce attack. In thi
2 min read
What is CTFs (Capture The Flag)
With the ever-rising need for cybersecurity experts, there has never been a better time to become an ethical hacker. If you have ever grown up wanting to be a hacker, now is the time to start working on your dream. Companies hire ethical hackers to find and patch up security flaws in their systems, so as to prevent cybercriminals from being able to
3 min read