CodePark/ questions / Passwords, hashing & MFA
START PRACTICINGPRACTICE
Backend question · Auth & security › Passwords, hashing & MFA

Why is sha256(salt + password) a poor way to store passwords?

SHA-256 is fast, so attackers with GPUs can test billions of guesses per second

The problem is speed. SHA-256 is fast, so attackers with GPUs can test billions of guesses per second. Password hashes should be slow on purpose, and ideally memory-hard (each guess needs a lot of memory). Argon2id, scrypt and bcrypt give you this.

"SHA-256 is broken and has practical collisions" is the wrong reason. SHA-256 is still a sound general-purpose hash, and it has no practical collisions.