Hash generator · Guide
MD5 Generator With Salt: Why Salting MD5 Is Still Not Enough
Adding a salt to MD5 is a genuine improvement over plain MD5 — and still not enough for passwords. Knowing exactly which problem a salt solves tells you why.
What a salt actually fixes
A salt is a unique random value stored alongside each hash and mixed into the input before hashing. Two users with the same password get different digests, so an attacker cannot spot repeated passwords by looking at the table.
It also kills precomputed lookup tables. A rainbow table for plain MD5 is useless against salted hashes, because the attacker would need a separate table per salt.
What it does not fix
Speed. MD5 is designed to be fast, and a modern GPU computes tens of billions of salted MD5 hashes per second. An attacker with your database simply brute-forces each salt separately — the salt costs them time linearly, and they have plenty.
Password hashing needs a function that is deliberately slow and memory-hard. That is the whole point of Argon2id, scrypt and bcrypt, and no amount of salting turns MD5 into one of them.
md5crypt and the Apache variant
Unix md5crypt ($1$) and the Apache variant ($apr1$) do try to slow MD5 down by iterating it 1000 times over the password and salt. In 1994 that was meaningful; today it is trivially parallel on a GPU.
You still meet $apr1$ in .htpasswd files. If you control the server, switch to bcrypt — htpasswd has supported it for years:
htpasswd -B -c .htpasswd alice # bcrypt, recommended
htpasswd -m -c .htpasswd alice # apr1 (MD5), legacyWhere salted MD5 is fine
Non-security uses where you want a keyed-looking identifier: a cache key that should not collide across tenants, an anonymised analytics id, a deterministic shard selector. None of these break if someone reverses them.
For anything an attacker benefits from cracking, use password_hash() in PHP, bcrypt or argon2 libraries elsewhere, and let the library manage the salt for you — hand-rolled salting is where most implementations go wrong.
Frequently asked questions
Does a longer salt make MD5 safe?
No. Salt length affects lookup tables, not brute-force speed. MD5 stays too fast regardless.
Should the salt be secret?
A salt does not need to be secret and is normally stored with the hash. A secret value mixed in is called a pepper and is a separate mechanism.
What replaces salted MD5 for passwords?
Argon2id if available, otherwise bcrypt or scrypt. All three are slow by design and handle salting internally.
Ready to try it?
Open the free browser-based Hash generator and apply what you just read — no sign-up, runs locally.
Open the Hash generator tool