php - Hashing a password more than once -


this question has answer here:

if hash example password twice:

$psw1= password_hash($password,password_default); $psw2=password_hash($psw1,password_default); 

is more secure or useless?

p.s.: new php

this prevent verifying password, since won't able reproduce first hash, since you've discarded random salt of first hash. instead, increase security of single hash, adjust cost factor:

password_hash($password, password_default, ['cost' => 12]) 

the higher cost, more rounds of hashing done. pick cost doesn't slow process down much, isn't low either. in fact, should keep increasing cost factor on time better server hardware becomes available, , rehash users passwords on time stronger algorithm. that's password_needs_rehash for.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -