php - Hashing a password more than once -
this question has answer here:
- double password_hash php 2 answers
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
Post a Comment