Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Application Security

// // //
5/12/2021
01:00 PM
Keira Stevens
Keira Stevens
Commentary
Connect Directly
LinkedIn
RSS
E-Mail vvv

Hashes, Salts, and Rainbow Tables: Confessions of a Password Cracker

Understanding a few basics about how password crackers think and behave could help you keep your users safer.

If you've ever watched TV and movies about cybersecurity, you probably envision someone sitting in a dark room trying to guess someone else's password based on a few facts like their kids' names or favorite sports team. 

Even Mr. Robot, renowned for its realistic portrayal of technology, is guilty of showing password cracking this way

While targeted attacks on individuals using personal information and social engineering do happen, they are not the norm. These portrayals might give people a false sense of security because they don't think their accounts are valuable or they would get locked after a few wrong guesses.

Related Content:

Farewell, Dear Password? The Future of Identity and Authorization

Special Report: Assessing Cybersecurity Risk in Today's Enterprises

New From The Edge: Planning Our Passwordless Future

In reality, cybercriminals generally aren't guessing passwords for one person, and accounts do get locked after inputting the wrong password. That wouldn't be a very effective or efficient way to break into enough accounts to make a substantial profit. 

Once a site has been breached, threat actors often share the leaked users' files from that site. The file typically contains each line in the database associated with a user — e.g., email, username, password_hash, etc. The leaks to many sites, large and small, are posted on hacking forums where other criminals and ethical security researchers race to analyze and crack the hashes in the file.  

A hash is a representation of the password created after running it through a hashing algorithm. There are a variety of these algorithms (including SHA1, MD5, and Bcrypt), and they vary in their complexity. When the password "123456" is hashed, it may be stored as "e10adc3949ba59abbe56e057f20f883e." Every unique password has a unique hash, but each algorithm converts each password to the same hash, assuming it's not salted. In other words, "123456" will always be hashed as "e10adc3949ba59abbe56e057f20f883e" with MD5.

Sometimes this gets explained as encryption, but encryption works in two directions — encryption and decryption. If you know the cipher for something that is encrypted, you can reverse it to decrypt the data. Hashes only go one direction. You can't take the hash "e10adc3949ba59abbe56e057f20f883e" and reverse the code to get back to "123456."

Instead, password cracking compares two hashes to find matches. You generate hashes using known plaintext words to see if the hash ever matches the hash that you are trying to crack. When the hash matches, you have cracked the password. 

In the early days, crackers relied on rainbow tables, which are lists of hashes and associated plaintext passwords. If they knew a hash and wanted to see the associated password, they simply compared the known hashes in their rainbow table with hashes in the database to find matches. But rainbow tables are incredibly large and require a lot of hard drive space. 

One tactic companies use to deter rainbow table attacks is to add additional characters, called a salt, to the beginning or end of the password before it gets hashed. The salt is typically unique to each user, so if two people on that site have the same password, their salts would be different, resulting in different hashes. 

In addition to salts, there are also peppers, a random bit of data added to the password before it gets hashed. Unlike salts, peppers are not stored in the database with the hash. They are hardcoded into the website's source code. 

Even with salts and peppers, passwords can be cracked. Password crackers' success often comes down to time and computing power. Nearly any password, regardless how long or complex, can be cracked with enough time and processing strength. 

In its infancy, password cracking worked like I explained above. Password crackers used CPUs to mathematically generate possible hashes. Or they'd match known hashes to the passwords on the rainbow table.

Today, brute force attacks are more common. Crackers use GPUs, which are often associated with gamers and cryptocurrency miners because, while they can't do complicated math, they can run simple calculations on a large scale. A CPU can do complex calculations very fast but is limited by cores and threads. A GPU has thousands of less complex cores or mini-processors that can generate a hash very quickly. Where a CPU could guess 20,000 combinations per second, a GPU can do 6 million per second. 

In a brute-force attack, the cracker would use the GPU to run all the combinations of letters, numbers, and characters until it figures out the right one. Even with a salt making it more difficult, a GPU with enough time will crack it if the salt is known.

If you started reading with the idea that your password is solid and unbreakable, I hope that you have a more realistic opinion now. No one can predict when an attacker might steal data from a site where you have an account. The best thing you can do is be ready for when it does — and it is a matter of when, not if. Protect yourself with unique passwords at least 16 characters and a combination of letters, numbers, and symbols for each account, and keep track of your logins in a password manager. And when you find out a site that you use has been breached, take it seriously and change your password immediately. 

Keira Stevens is manager of the Human Intelligence (HUMINT) team at SpyCloud. For over 10 years, she has worked in information security on both red and blue teams and assisting law enforcement to identify criminals. Password cracking is a hobby and passion for Keira, as well ... View Full Bio
Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
Edge-DRsplash-10-edge-articles
I Smell a RAT! New Cybersecurity Threats for the Crypto Industry
David Trepp, Partner, IT Assurance with accounting and advisory firm BPM LLP,  7/9/2021
News
Attacks on Kaseya Servers Led to Ransomware in Less Than 2 Hours
Robert Lemos, Contributing Writer,  7/7/2021
Commentary
It's in the Game (but It Shouldn't Be)
Tal Memran, Cybersecurity Expert, CYE,  7/9/2021
Register for Dark Reading Newsletters
White Papers
Video
Cartoon
Current Issue
Everything You Need to Know About DNS Attacks
It's important to understand DNS, potential attacks against it, and the tools and techniques required to defend DNS infrastructure. This report answers all the questions you were afraid to ask. Domain Name Service (DNS) is a critical part of any organization's digital infrastructure, but it's also one of the least understood. DNS is designed to be invisible to business professionals, IT stakeholders, and many security professionals, but DNS's threat surface is large and widely targeted. Attackers are causing a great deal of damage with an array of attacks such as denial of service, DNS cache poisoning, DNS hijackin, DNS tunneling, and DNS dangling. They are using DNS infrastructure to take control of inbound and outbound communications and preventing users from accessing the applications they are looking for. To stop attacks on DNS, security teams need to shore up the organization's security hygiene around DNS infrastructure, implement controls such as DNSSEC, and monitor DNS traffic
Flash Poll
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2023-33196
PUBLISHED: 2023-05-26
Craft is a CMS for creating custom digital experiences. Cross site scripting (XSS) can be triggered by review volumes. This issue has been fixed in version 4.4.7.
CVE-2023-33185
PUBLISHED: 2023-05-26
Django-SES is a drop-in mail backend for Django. The django_ses library implements a mail backend for Django using AWS Simple Email Service. The library exports the `SESEventWebhookView class` intended to receive signed requests from AWS to handle email bounces, subscriptions, etc. These requests ar...
CVE-2023-33187
PUBLISHED: 2023-05-26
Highlight is an open source, full-stack monitoring platform. Highlight may record passwords on customer deployments when a password html input is switched to `type="text"` via a javascript "Show Password" button. This differs from the expected behavior which always obfuscates `ty...
CVE-2023-33194
PUBLISHED: 2023-05-26
Craft is a CMS for creating custom digital experiences on the web.The platform does not filter input and encode output in Quick Post validation error message, which can deliver an XSS payload. Old CVE fixed the XSS in label HTML but didn’t fix it when clicking save. This issue was...
CVE-2023-2879
PUBLISHED: 2023-05-26
GDSDB infinite loop in Wireshark 4.0.0 to 4.0.5 and 3.6.0 to 3.6.13 allows denial of service via packet injection or crafted capture file