MD5 and SHA-1 (and plain SHA-256) are far too fast for passwords. Attackers can try billions of guesses a second against a stolen database. Plain text or reversible encryption is worse.
Do this instead:
Use a slow, salted, purpose-built password hash: Argon2id, bcrypt, scrypt or PBKDF2 with a high iteration count. A salt (random value per user) is built into these, and stops identical passwords from having identical hashes.
Do not invent your own scheme. In ASP.NET Core, use ASP.NET Identity's PasswordHasher, which handles salt and the work factor.
Tune the cost factor so a login takes tens or hundreds of milliseconds, and raise it over the years.
Migrate gradually: when a user logs in, check the old hash, then re-hash the password with the new algorithm and save it.
Support multi-factor authentication, rate-limit login attempts, and check new passwords against lists of leaked passwords.
Never log, email or display a password, and never offer a "show my password" feature.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
MD5 and SHA-1 (and plain SHA-256) are far too fast for passwords. Attackers can try billions of guesses a second against a stolen database. Plain text or reversible encryption is worse.
Do this instead:
Never log, email or display a password, and never offer a "show my password" feature.