Password Hashing

What is Password Hashing?

Digital access control systems must maintain records of user credentials (e.g. usernames and passwords) to effectively authenticate users and authorize access to secure systems. If these sensitive records were stored in plaintext format, any digital adversary gaining illicit access to the system of record could steal those credentials and either use them to improperly access secure systems or sell them to the highest bidder.

Password hashing is an information security technique that uses password hashing algorithms to transform a plaintext password into a cryptographic ciphertext - an unintelligible series of numbers and letters - before saving it in a database. If a security breach occurs after password hashing, any exposed passwords are unintelligible to the digital adversary and can’t be sold or used to access user accounts.

How Does Password Hashing Work?

Password hashing algorithms can be implemented as part of an access control system. 

When a user first creates a password for their account, that password is run through a hashing algorithm, converted from plaintext into ciphertext, and stored in a database.

When a user attempts to log in to the system using their access credentials, the password they provide is converted to ciphertext using the same password hashing algorithm. If this ciphertext matches the ciphertext password stored in the database, the user is authenticated and authorized to access the system.

A password hashing algorithm will convert a specific plaintext password into the same ciphertext every time, but even minor changes to the plaintext will produce a completely different ciphertext. Ciphertexts generated by the same algorithm will be the same length, regardless of the length of the password.

Password Hashing vs. Encryption: What’s the Difference?

The key difference between password hashing and encryption is reversibility. 

Password hashing is irreversible, such that a plaintext password that has been converted to ciphertext cannot be converted back to plaintext. This means that a digital adversary cannot convert ciphertext passwords back into their plaintext format, even if they know which password hashing algorithm was used.

Encryption is another cryptographic method that uses algorithmically-generated encryption keys to convert plaintext data (e.g. passwords) into ciphertext. But unlike password hashing, encryption is a reversible process. A digital adversary who obtains the relevant encryption key can convert encrypted ciphertext back into plaintext format, a process known as decryption.

What are the Benefits of Password Hashing?

Protecting Sensitive Data

Password hashing is often used to safeguard user credentials for online banking, email, credit, and other types of accounts. Password hashing ensures that the plaintext passwords for these secured systems remain hidden from digital adversaries in the event of a data breach.

Minimizing the Impact of a Data Breach

Without password hashing, a successful data breach could allow digital adversaries to penetrate hundreds or even thousands of bank, email, or credit accounts belonging to employees and/or customers of the targeted organization. From there, digital adversaries might attempt to steal financial resources or additional data, launch impersonation attacks, commit fraud, or engage in identity theft.

Password hashing helps mitigate the impact of a data breach by ensuring that digital adversaries don’t gain access to user credentials and launch further attacks that increase the cost of remediation and multiply damage to the target’s reputation/brand.

What is Password Salting?

A potential weakness of password hashing is its consistency. If the same plaintext password, run through the same hashing algorithm, produces the same ciphertext each time, then digital adversaries might be able to guess passwords using brute force attacks. This possibility can be mitigated with password salting.

Password salting is the practice of adding some additional random characters to a plaintext password before feeding it to a hashing algorithm and converting it to ciphertext. This use of randomization produces novel ciphertexts and makes it more difficult for adversaries to guess passwords using brute force or dictionary attacks.

4 Password Hashing Algorithms You Should Know

How Do Cybercriminals Defeat Password Hashing?

Safeguard Your Organization’s Security Posture with ZeroFox

ZeroFox provides digital risk protection, threat intelligence, and adversary disruption services to dismantle external threats to brands, people, data, and assets across the public attack surface.

ZeroFox Email Protection automatically detects and alerts on phishing and other malicious emails, actively protecting your organization against credential theft attacks.

Ready to learn more?

Watch our on-demand webinar Keep Your Enemies Close: Playing Offense on the Dark Web to learn how digital adversaries are leveraging the dark web to deploy credential theft attacks - and how you can take action to protect your organization.