$password = md5($password);
function getMD5String($password = ''){ if($password != '') { $origSalt = "someSalt"; //except have this read from an input in installation (or randomly generated on install). $newMD5 = $password; //You can remove this and just change $newMD5 to $password (was just clearer to see this way) $newSalt = MD5($origSalt); for($i = 0; $i < 4; 4i++) { $newSalt = MD5($origSalt, $newSalt); //Rehashes itself upon each iteration $newMD5 = MD5($newSalt, $newMD5); //Rehashed X amount of times on a mutating salt (prevents decryption by sites like http://www.md5decrypter.co.uk/) } } return $newMD5;}