The asymmetry that decides everything
When a user logs in, they type a password once. Your server has to hash it once. An attacker with a stolen database hashes candidates as fast as their hardware allows, for as long as they like. The only lever you have is making each guess expensive.
MD5 and SHA-256 are engineered for the opposite: maximum throughput. A single high-end graphics card computes on the order of tens of billions of MD5 hashes per second. That turns a dictionary of a billion common passwords into a sub-minute job, and it means an eight-character password offers essentially no protection regardless of how random it looks.
| Algorithm | Guesses per second on one GPU | Designed for passwords? |
|---|---|---|
| MD5 | ~10⁹–10¹⁰ | No |
| SHA-256 | ~10⁹ | No |
| bcrypt, cost 12 | ~10³ | Yes, since 1999 |
| Argon2id, 19 MiB | ~10³ | Yes, current recommendation |
The numbers are approximate and move with hardware, but the ratio — six or seven orders of magnitude — is the point. That gap is the whole reason password hashing is a separate field.
What a salt does, and what it does not
A salt is a random value stored next to the hash. It is not secret. Its job is to make precomputation useless: an attacker cannot build one table of hashes and reuse it across your entire user base, because every user's input is different.
Salt does not make a fast hash acceptable. It removes the shortcut, so the attacker has to brute force each account individually — but with MD5, each account still falls at ten billion guesses per second. Salt and slowness are orthogonal defences; you need both.
Two related mistakes worth naming: using the same salt for every user (equivalent to no salt), and using a predictable salt like the username or email (better than nothing, far worse than random).
What to use in 2026
The order of preference is stable: Argon2id first, scrypt second, bcrypt third, PBKDF2 if a compliance standard requires it. All four are memory-hard or iteration-hard, which is the property that matters.
| Algorithm | Baseline parameters | Notes |
|---|---|---|
| Argon2id | 19 MiB memory, 2 iterations, 1 lane | Best default. Tune memory up until hashing takes 100–500 ms on your hardware. |
| scrypt | N=2¹⁷, r=8, p=1 | Well understood, widely available in standard libraries. |
| bcrypt | Work factor 12 | Silently truncates input at 72 bytes — pre-hash long passwords or reject them. |
| PBKDF2-HMAC-SHA256 | 600,000 iterations | Only choose this when a standard mandates it. It is not memory-hard. |
The right way to pick a cost parameter is measured, not copied: raise it until one hash takes about 250 ms on your production hardware at peak load, then leave headroom. Too high and a login flood becomes a denial-of-service vector against yourself.
Doing it with a library
Never implement Argon2 or bcrypt yourself, and never build the salt handling by hand. Every mainstream language has a maintained binding.
// Node.js — npm i argon2
const argon2 = require('argon2');
const hash = await argon2.hash(password, { type: argon2.argon2id });
const ok = await argon2.verify(hash, password);
# Python — pip install argon2-cffi
from argon2 import PasswordHasher
ph = PasswordHasher()
hash = ph.hash(password)
ph.verify(hash, password)
<?php
// PHP 8.4+ — built in
$hash = password_hash($password, PASSWORD_ARGON2ID);
if (password_verify($password, $hash)) { /* ok */ }
Note that all three store the algorithm, parameters and salt inside the output string. That is
what the $argon2id$v=19$m=19456,t=2,p=1$… prefix encodes, and it is why you can
raise the cost later without a schema change. The hash
identifier decodes these prefixes.
Migrating a store full of MD5 hashes
You cannot convert the existing values — you do not have the plaintext. You upgrade them as users log in, which is the only moment you see a password.
- Add a column for the new hash and an
algomarker. Do not overwrite the old column yet. - On login: verify against the old MD5, and if it succeeds, compute the new Argon2id hash and store it with
algo = argon2id. - On login, new path: if
algois set, verify with the new algorithm only. - Force a reset for accounts that have not logged in after a defined window — 90 to 180 days is typical. Those are the accounts an attacker will target precisely because they are stale.
- Delete the old column once the fallback path has not fired for a full cycle.
While the old hashes still exist, they remain crackable. If the breach risk is active rather than theoretical, skip the lazy migration and reset every password now.
"MD5 with a salt" is not a fix. It is the single most common well-intentioned mistake in this area. Salt removes rainbow tables; it does nothing about ten billion guesses per second. Neither does hashing twice, or hashing MD5 then SHA-256.
Where this site's tools fit
The MD5 generator and SHA-256 generator are for checksums, cache keys and API signatures. If you are using them to inspect a password hash you found — for example, to check whether a system still uses unsalted MD5 — the hash identifier will tell you which format you are looking at, and therefore how urgently it needs replacing.