Hashing Passwords in 2026: Argon2, bcrypt, and What Not to Use
If your application stores passwords, it should store only salted hashes of them, made with a function built for the job. The open questions are which function, what parameters, and how to move off an old scheme without forcing every user to reset.
The numbers below follow the OWASP Password Storage Cheat Sheet. It is updated from time to time, so check it directly before you set parameters.
The three properties that matter
A good password hash function has three properties beyond standard cryptographic hash properties:
- Salt support. A unique random salt per password defeats precomputed rainbow tables. This has been settled since the 1970s; if your hash function does not accept a salt, do not use it.
- Tunable cost. The hash should be expensive to compute, with a cost parameter you can increase as hardware improves. SHA-256 on a short input takes well under a microsecond. A password hash should be slow enough to hurt an attacker and fast enough for login to stay usable: OWASP's general rule is under one second per hash, and a few hundred milliseconds is a common target.
- Memory-hardness. An attacker building specialized hardware (GPUs, FPGAs, ASICs) gets a smaller speedup against memory-hard algorithms than CPU-only ones. Argon2 and scrypt are memory-hard; bcrypt and PBKDF2 are not.
Which algorithm to use
Use: Argon2id
Argon2 won the Password Hashing Competition in 2015. The "id" variant combines protections against GPU attacks (Argon2d) with protections against side-channel attacks (Argon2i). OWASP recommends Argon2id as the default choice for new applications. Most modern languages have a maintained Argon2 library.
A common starting point, matching one of OWASP's minimum configurations:
- Memory cost: 19 MiB (19456 KiB)
- Iteration count: 2
- Parallelism: 1
- Output length: 32 bytes
- Salt length: 16 bytes from a CSPRNG
OWASP lists equivalent trade-offs, such as 46 MiB with 1 iteration or 12 MiB with 3 iterations. These are minimums, so measure on your production hardware and go higher if you have headroom. Memory is usually the first thing to raise, but every concurrent login uses that much RAM, so a burst of logins can exhaust a small server.
# Python, argon2-cffi
from argon2 import PasswordHasher
ph = PasswordHasher(time_cost=2, memory_cost=19456, parallelism=1, hash_len=32, salt_len=16)
stored = ph.hash("user-password") # $argon2id$v=19$m=19456,t=2,p=1$...
ph.verify(stored, "user-password") # raises VerifyMismatchError on a wrong password
if ph.check_needs_rehash(stored): # True when stored parameters are out of date
stored = ph.hash("user-password")
Acceptable for existing systems: bcrypt (work factor 10 or higher)
bcrypt dates to 1999 and is widely deployed. It is not memory-hard, so attackers with GPUs get a bigger speedup than they do against Argon2id. OWASP now lists it for legacy systems, with a minimum work factor of 10 and the advice to use the highest value your servers can handle. 12 is a common choice.
bcrypt only processes the first 72 bytes of its input, so enforce a maximum password length of 72 bytes.
If you already use bcrypt at an adequate work factor, replacing it is not urgent, and you can move users over at login if you decide to. For new systems, use Argon2id.
Acceptable: scrypt
scrypt is memory-hard, and OWASP recommends it when Argon2id is not available. Its minimum configurations use r=8 and trade N against p, from N=2^17 with p=1 (128 MiB) down to N=2^15 with p=3 (32 MiB) and beyond. An existing deployment at those levels does not need to migrate.
Acceptable, with caveats: PBKDF2
PBKDF2 is the option to use when FIPS-140 compliance is required. It is not memory-hard, so attackers with custom hardware get a large speedup. OWASP's iteration counts depend on the hash: 600,000 for HMAC-SHA-256 and 220,000 for HMAC-SHA-512. HMAC-SHA-1 is legacy only and not for new systems.
Do not use, even with a salt
- Plain SHA-256, SHA-512, or any single-pass hash. Salt does not help when the function itself runs at billions of guesses per second on a GPU. Salt is necessary; it is not sufficient.
- MD5 in any form. Practical collisions have been known since 2004, and it is extremely fast on GPUs. For password storage, the speed alone rules it out.
- SHA-1. Practical collisions exist, and like MD5 it is very fast on GPUs.
- Custom homemade hashes. Including "MD5 of (salt + password + secret pepper)" patterns that crop up in old codebases.
- Two-way encryption (AES, blowfish, etc.). If you can decrypt, the attacker who steals your data and your encryption key can too. Hashing is one-way for a reason.
What to do with old hashes
Suppose your app uses bcrypt at a low work factor and you want to upgrade. OWASP describes the usual approach:
- Pick the target: Argon2id at the parameters above, or bcrypt at a higher work factor.
- When a user logs in and provides their password, verify against the existing hash. If verification succeeds, recompute with the target algorithm and overwrite the stored hash. The user does not notice.
- For users who do not log in often, do nothing. They will be migrated on their next login.
- After a year (or whatever window covers your active user base), audit the remaining old hashes and decide whether to force a password reset on those users.
This works because a successful login is the one moment you have the plaintext. Store the algorithm and parameters with each hash, as the PHC string format in the Argon2 example does, so old and new schemes can share a column during the move.
For very weak legacy hashes such as unsalted MD5, OWASP describes layering: hash the existing hash with a strong algorithm now, so nothing weak stays stored, then replace it with a direct hash at the user's next login.
Peppers and other "extra security" patterns
A "pepper" is a site-wide secret mixed into the password before hashing and stored outside the database, for example in a secrets vault or HSM. An attacker who dumps only the database cannot crack the hashes without it.
OWASP treats peppers as defense in depth, not a replacement for a strong hash. The operational cost is real: one pepper covers every password, so if it leaks you must change it, and because the old pepper cannot be removed without each plaintext password, all affected users have to reset. Add one only if you can manage the key properly.
Where the hash generator on this site fits in
The hash generator on BoltQuickTools is not a password storage tool. It produces single-pass digests (MD5, SHA-1, SHA-256, SHA-512) for file integrity checks, deduplication keys, and content addressing. If you need password hashing in an application, use Argon2id through a maintained library in your language.
Comparing a file against a checksum its publisher posted is a legitimate job for a fast hash. Password storage is not.
Quick reference checklist
- Use Argon2id for new applications.
- bcrypt at work factor 10 or higher is acceptable for existing systems. Remember its 72-byte limit.
- Never store passwords with single-pass hashes (SHA-256, MD5, SHA-1).
- Always use a unique random salt per password from a CSPRNG.
- Migrate old hashes on next login; do not force a global reset unless absolutely necessary.
- Revisit your parameters periodically and raise them as hardware improves.