Password Hashing
What Is Password Hashing?
Password hashing is a security technique that turns a password into a one-way value for storage and login checks. Instead of saving the original password, software stores a derived verifier. A hash is not encrypted password text, because it is designed not to be reversed.
How Password Hashing Works During Sign-Up and Login
The application verifies a password by repeating the same protected calculation, not by recovering the original.
- A user creates a password during sign-up.
- The application generates a unique random salt for that password.
- A password-hashing algorithm derives a verifier and stores it with the salt and algorithm settings.
- At login, the application applies those stored settings to the submitted password.
- It uses a timing-safe comparison to check whether the new verifier matches the stored one.
Password Hashing vs. Encryption vs. Fast Hashes
These techniques solve different security problems.
| Method | Purpose | Suitable for passwords? |
|---|---|---|
| Password hashing | One-way login verification | Yes, with a modern password-specific algorithm |
| Encryption | Recoverable confidential data | No, applications should not need to recover passwords |
| SHA-256 alone | Fast integrity checks | No, it is too fast for password storage |
Why Salt, Work Factors, and Memory Cost Matter
A unique salt means identical passwords produce different stored values, which limits precomputed lookup attacks. A configurable work factor and memory cost make each offline guessing attempt more expensive. A server-side pepper can add protection, but it must be stored separately from the password database.
Which Password Hashing Method Is Appropriate?
Argon2id is generally the preferred modern choice when available. The NIST digital identity guidance also supports using salted, iterated password derivation.
| Method | When to use it |
|---|---|
| Argon2id | New applications needing memory-hard protection |
| bcrypt | Established systems with compatible libraries |
| PBKDF2 | Platforms that require it for standards or compatibility |
| MD5, SHA-1, plain SHA-256 | Never for password storage |
Benefits of Password Hashing
Correct implementation reduces the damage of a database exposure.
- Stored passwords are not readable by staff or ordinary application code.
- Salts prevent duplicate passwords from sharing a stored value.
- Applications can rehash successfully authenticated users with stronger settings over time.
Practical Limits of Password Hashing
Hashing is essential, but it is only one authentication control.
- It cannot protect a password captured through phishing, malware, or an insecure connection.
- Weak passwords can still be guessed from stolen hashes.
- It does not replace rate limits, multi-factor authentication, secure reset flows, or breach response.
Password Hashing in Modern App Development
Use maintained authentication libraries rather than custom cryptography. Store each hash with its salt and parameters, then rehash after a successful login when settings become outdated. Test registration, login, reset, and migration paths together. Teams building an AI web app builder project with Emergent should treat secure authentication as a core feature, alongside thoughtful app design and development.
on Emergent today

