php - Secure hashing method -
this question has answer here:
- secure hash , salt php passwords 14 answers
in mvc style web app, what's best/most secure way of setting hashing method that's available globally?
i've been doing within core controller extended rest of scaffolding:
class core{ protected function salt($string=null){ $salt = 'dsjflk32osdjshewy8327rtewyrkjfdhdsgnmbcxvsgfyew3287'; $this->data = md5($salt.$string); return $this->data; } }
is practice, or should doing different?
it depends on want hash. if create unique identifier larger/grouped datasets, use md5. using salt isnt realy needed then, cant harm either.
if want use passwords, dont use hashing function optimized speed @ all, because not realy secure. passwords recommend bcrypt , this question has lot of information on why should use it.
if need hashing function disquise parameters, cannot altered, md5 hash sufficient aswell. since need store link between hash , actual value somewhere, can try bruteforce md5 change parameter, still can enter values allowed , have in link table.
Comments
Post a Comment