The PASSWORD function in MySQL can be translated to the code in php:
function mysql_password($string){
$pass = strtoupper(
sha1(
sha1($string, true)
)
);
$pass = '*' . $pass;
return $pass;
}
which returns a 41 character hash.
I am worried about this function because if I run:
SELECT PASSWORD('securepassword');
on any device it returns the same hash:
*214C2FAF32F109AE748170BFABDDFB9B05889E64
Surely that means that if my database is breached an infiltrator can easily create a rainbow table with a load of popular passwords and match the hashes - is this not something I should be worried about?
I was hoping that the PASSWORD function was unique to every device? How would I go about making it unique for every device?