php - Secure hashing method -


this question has answer here:

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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -