What is Password Hashing (and How Does It Work)?

2025-10-24

If you are a frequent denizen of the Internet like myself, there is a good chance you have received an email that goes something like this:

Dear valued customer,

Recently, our website fell victim to a cyberattack on our corporate network. All passwords were encrypted, but as a precaution we are requiring all of our customers to reset their passwords immediately.

Thank you.

So, there was a breach, some of your information, including your encrypted password, was leaked. Is your account at risk?

Short answer: YES, but why?

To understand this, you must understand the concept of “password hashing.”

What is a Hash?

A hash is just a way to represent any data as a unique string of characters. You can hash anything: music, movies, your name, or this article. Metaphorically speaking, hashing is a way of assigning a “name” to your data. It allows you to take an input of any length and turn it into a string of characters that is always the same length. Obviously, there are many methods (algorithms) to do this.

A few of the most popular hashing algorithms:

  • MD5 – Given any data will return a unique 32 character hash.
  • SHA1 – Given any data will return a unique 40 character hash.
  • SHA256 – Given any data will return a unique 64 character hash; designed by the National Security Agency.

Lets look at a simple example:

My name is “Jamin Becker”

The MD5 hash representation of my name is:

eeb7048c69b088739908f5f5144cd1f5

hashing-diagram-illustration1

The SHA1 hash representation of my name is:

ae480b717c08b6ab36a85075864e35b9c528d7c5

The SHA256 hash representation of my name is:

a477cc14eae5fd94fe4cb20b36ec80ac6983bad44973ae7f4f230010f01289b0

Why is Hashing Secure?

The reason hashing is secure is simple: hashing is a one way operation. They cannot be reversed. Given a string “eeb7048c69b088739908f5f5144cd1f5”, there is no way to reverse the MD5 hash to return “Jamin Becker”. This is because of the way the mathematicians and programmers structured the MD5 hashing algorithm, and it comes back to a fundamental computer science problem called “P vs NP.” P and NP are just two classes of algorithms.

Most hashing algorithms fall under NP which means they can be quickly calculated. However, the un-hashing algorithms (i.e “eeb7048c69b088739908f5f5144cd1f5” -> “Jamin Becker”) fall under the P class and can only efficiently be solved in polynomial time (i.e using a quantum computer significantly more advanced then the ones available today).

So why is this good for security?

hashing-diagram-illustration2

Say you subscribe to a website and choose password “12345”. Immediately, that website will hash your password, probably with SHA1, and store it in a database. Now every time you login, the website will rehash your password and compare it to the one stored in the database. If they match, you will be successfully authenticated. If the website is ever breached, and the password database is leaked your password will appear as “8cb2237d0679ca88db6464eac60da96345513964” and not “12345”.

Hash Attack Strategies

So, the attacker has the hashed version of my password and there is no way to reverse it to 12345. I have nothing to worry about, right? WRONG!

One method that is commonly used to get the plain text password from a hash is called a brute force attack. In this attack, the attacker will run through a giant wordlist and hash each word with the appropriate hashing algorithm. They can then compare the hashes in the wordlist to the ones they have obtained from the database. If a hash from the wordlist matches the one in the database, they can simply find the corresponding plain text password in the original wordlist they hashed. Experienced attackers will use extremely large wordlists combined with powerful software to run through millions of password possibilities a second.

wordlist-bruteforce-hash-cracking

Another method of attack attempts to exploit the hashing algorithm itself by creating a hash collision. A hash collision occurs when two different sets of data resolve to the same hash, and while this is rare, it can be deadly. This would allow the attacker to generate a string of characters that is not your password, but still able to log in to your account since it generates the same hash.

Conclusion

Hashing algorithms are becoming more and more advanced. Mathematicians and computer scientists are constantly designing cryptographic hashing algorithms with lower probabilities of collisions. However, it is important to remember that no matter how strong the hashing algorithm is, it can always be cracked using a brute force attack. The good news is that you can easily defend against these attacks as well by simply following best-practice password policy.

  1. Size does matter – the longer the original password the less likely it will appear on a wordlist
  2. Do not be predictable – avoid using words like “password” and “myname123”
  3. Use a mixture of special characters, numbers, upper and lowercase letters

What’s your thoughts on hashing? Share your views in the comment below.

Image credit: Magnifying Glass Online Fingerprint byBigStockPhot

Comments on " What is Password Hashing (and How Does It Work)?" :

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Related Article

    You Will Surely Have A Corrupted WordPress Database Issue. Here Is How You Fix it
    INTERNET

    You Will Surely Have A Corrupted WordPress Database Issue. Here Is How You Fix it

    The database is the most important component in the whole WordPress CMS. Being a database-driven CMS

    Can Tor Really Protect Your Online Privacy From The NSA (And Other Government Organizations)?
    INTERNET

    Can Tor Really Protect Your Online Privacy From The NSA (And Other Government Organizations)?

    Not too long ago, a wonderful thing called onion routing (OR) has been invented. It was meant to pro

    How to Quickly Close Multiple Tabs in Browser
    INTERNET

    How to Quickly Close Multiple Tabs in Browser

    There are times when you opened too many tabs in your browser and it is causing the whole system to

    How to Enable Two-Step Verification for Evernote
    INTERNET

    How to Enable Two-Step Verification for Evernote

    Recently, Evernote added an extra layer of security to their service: two-step verification. This wi

    Understanding the Various Copyright Licenses
    INTERNET

    Understanding the Various Copyright Licenses

    Internet users come across many different different sources of images, audio and video while surfing

    Big List of Tools and Services to Help You Read Everything Faster
    INTERNET

    Big List of Tools and Services to Help You Read Everything Faster

    Refresh your Twitter, pull down your facebook news feed, visit your favorite sites, and find yoursel

    3 Things to Do to Make Your Internet Life More Secure
    INTERNET

    3 Things to Do to Make Your Internet Life More Secure

    The Internet is a maze. It is full of hackers, wannabes, and thieves. As a user, we have to do every

    Three Ways To Educate Yourself Right Now About Internet Censorship
    INTERNET

    Three Ways To Educate Yourself Right Now About Internet Censorship

    The idea that someone else can decide what you can or can’t access on the Internet is abhorring. Y

    About Netverse

    We are a premier digital platform committed to delivering high-quality content to our readers. Our mission is to provide accurate, reliable, and engaging information that adds value to our audience's daily lives.

    Our team consists of experienced content creators and subject matter experts who uphold the highest standards of professionalism. In an era of information overload, we curate content with care, ensuring our users receive only the most relevant and trustworthy information.

    Beyond just reporting facts, we focus on depth and context. Through expert analysis, comprehensive research, and clear presentation, we help our audience gain meaningful insights and make informed decisions.

    We take pride in being a trusted information source for our growing community of readers. Our user-first approach means we continuously adapt to provide content that meets our audience's evolving needs and interests.

    Innovation and excellence drive everything we do. We're committed to improving our platform and services to deliver the best possible experience for our users.