Cybersecurity glossary
What is Password Hashing?
Learn what password hashing is, why passwords must never be stored in plaintext, how salts and adaptive algorithms like bcrypt Argon2 and scrypt work, and how to verify passwords safely.
Definition
Password hashing is the practice of transforming a password into a one-way cryptographic digest—using a slow, salted, adaptive algorithm—so systems can verify login attempts without storing recoverable plaintext passwords.
Why password hashing matters
Databases get breached. If passwords are stored in plaintext or reversible encryption, every account becomes immediately usable for stuffing attacks across the internet. Password hashing ensures that even after a dump, attackers must spend significant compute guessing candidates against slow, salted digests.
Good hashing does not make weak passwords strong. It makes offline guessing expensive and prevents identical passwords from looking identical in storage.
How password verification works
User creates a password
The application receives the password over HTTPS and never logs it.
Generate a unique salt
A cryptographically random salt is created for that password.
Apply an adaptive hash
Argon2id/bcrypt/scrypt/PBKDF2 derives a digest using the salt and cost parameters.
Store hash parameters
Persist algorithm id, cost settings, salt, and digest—not the password.
Verify on login
Hash the submitted password with the stored salt/params and compare in constant time.
Rehash when policy changes
Upgrade cost factors or algorithms transparently after successful authentication.
Hashing vs encryption vs plain SHA
| Method | Reversible? | Password storage fit |
|---|---|---|
| Plaintext | Yes | Never acceptable |
| Encryption | Yes with key | Not for password verification storage |
| Fast hash (MD5/SHA) | One-way but too fast | Inadequate alone for passwords |
| Adaptive password hash | One-way and intentionally slow | Recommended approach |
Practical algorithm guidance
Argon2id
Modern memory-hard choice recommended by many current guides when libraries are mature.
bcrypt
Widely deployed and battle-tested; mind password length limits in some implementations.
scrypt
Memory-hard alternative with tunable parameters.
PBKDF2
Acceptable when required by standards; use high iteration counts and proper HMAC settings.
Storage checklist
- Use a dedicated password-hashing algorithm—not raw MD5/SHA for storage.
- Generate a unique salt per password; never reuse a global salt.
- Tune work factors to your hardware and threat model; revisit annually.
- Compare digests with constant-time functions to avoid timing leaks.
- Never log passwords or hash inputs; redact authentication debug carefully.
- Support transparent rehashing after algorithm or cost upgrades.
- Combine with breached-password checks, rate limits, and MFA.
- Protect hash dumps with database access control and encryption at rest as defense in depth.
The practical takeaway
Password hashing stores one-way, salted, slow digests so breaches do not immediately yield usable passwords. Encryption and fast hashes are the wrong tools for this job.
Pick a modern adaptive algorithm, unique salts, sensible costs, and pair hashing with MFA and stuffing defenses. Hashing raises attacker cost—it does not forgive Password123.
Related security terms
Salt (Cryptography)
Random per-password data mixed into hashing to defeat precomputed attacks.
Credential Stuffing
Reuse attacks that become catastrophic if password databases are stored weakly.
Brute-Force Attack
Offline guessing against stolen hashes depends heavily on hash strength.
Broken Authentication
Weak password storage is a core authentication failure mode.
Frequently asked questions
What is password hashing in simple terms?
Hashing turns a password into a scrambled value that is hard to reverse. When you log in, the system hashes what you typed and checks it against the stored hash instead of saving your real password.
Is hashing the same as encryption?
No. Encryption is designed to be reversed with a key. Password hashing is one-way verification. If you can decrypt passwords, you are not hashing them correctly for storage.
Why are salts required?
Salts ensure identical passwords hash to different values and defeat rainbow tables. Each password should have a unique salt stored with the hash.
Which algorithms are recommended?
Modern guidance favors memory-hard adaptive algorithms such as Argon2id, with bcrypt and scrypt also widely used. Avoid plain MD5/SHA-1 for password storage.
What does adaptive or keyed work factor mean?
You configure cost parameters (time/memory/iterations) so hashing stays slow for attackers even as hardware improves, while remaining acceptable for legitimate logins.
Can hashed passwords still be cracked?
Yes. Weak passwords can be guessed offline against stolen hashes. Strong algorithms and unique salts make cracking expensive, but breached-password checks and MFA still matter.
Should I hash passwords on the client before sending?
Client hashing is not a substitute for TLS and server-side hashing. Always hash on the server with a proper password algorithm; protect transit with HTTPS.
References
Explore authoritative guidance and frameworks related to password hashing.
Explore every security definition
Return to the glossary to search by term, alias, starting letter, or security category.