php - Password_hash and Password_verify, store password too? -


maybe silly question...,

but i'm asking myself if it's useful store password (plain text) in database once have hashed using password_hash() function...

  • since password_verify() uses hashnsalt check if pass correct.

  • once "villain" obtain access db doesn't have plain text password (will ask him time bruteforce them)

  • if user forget password can't : way recreate new pass.

i'm on 50/50..

do not ever under circumstances store plaintext passwords. doing defeats entire purpose of hashing password in first place.

the entire purpose of using 1 way hasing algorithm if hacker gets site , steals database virtually impossible hacker obtain passwords users without using bruteforce or tables. (the tables risk mitigated salt introduced password_hash() function.)

you should never able retrieve users' passwords, site owner/operator (if can, hacker can too). that's why website send password instead of having reset red flag not storing credentials securely.

the correct way handle if user forgets password send temporary link allows user create new password.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -