How to store passwords in your database
systemdesignbutsimple.com·12w·
Discuss: r/programming

It is essential to store passwords in a way that prevents an attacker from getting them, even if the database is compromised.

Never store passwords as plaintext.

According to the Open Web Application Security Project (OWASP), secure password storage requires two key ingredients:

A hash function is a one-way mathematical operation. You can turn a password into a hash, but you cannot reverse a hash back into the password.

But not all hashing functions are equal.

Common hash functions like MD5 and SHA-1 are fast - which sounds good, but is actually terrible for passwords. Fast hashing means attackers can try billions of password guesses per second using brute-force attacks.

Instead, use password-specific hashing algorithms that are intentionally sl…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help