intermediatePassword Security: Encoding, Encryption & Hashing

Why shouldn't you use encryption instead of hashing to store passwords?

Encryption is reversible given the right key — if the encryption key is ever leaked or compromised, every stored password can be decrypted instantly. Applications never legitimately need to read a user's original password back (only verify a match), so a one-way hash is both sufficient and far safer: even a full database leak doesn't directly expose plain-text passwords.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Why shouldn't you use encryption instead of hashing to store passwords?

Next Step

Continue to What's wrong with using plain SHA-256 to hash passwords?← Back to all Spring Security questions