Sorry, I would comment on the post, but have not yet received enough reputation.
I would use SHA256 for my hash algorithm and continue to iterate around 25. More than that, and this is really redundant. I use a very similar framework solution that I applied to half a dozen sites. I chose to create a too complex random symbol generator, but I used it in many other places, including those with financial data symbols.
Other editing: use a random character generator, for example, for salt:
function randomChar($length) { $characters = array("A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "~", "!", "@", "#", "%", "^", "&", "(", ")", ":", "{", "[", "]", "}", "|", "<", ">", ".", ",", "/", "?", "_", "+", "-", "="); $charactersNumber = count($characters); $charactersNumber--; $randomLength = 0; while ($randomLength < $length) { $currentCharacter = $characters[rand(0,$charactersNumber)]; if ($currentCharacter == $previousCharacter) { $currentCharacter = $characters[rand(0,$charactersNumber)]; } $random .= $currentCharacter; $previousCharacter = $currentCharacter; $randomLength++; } return $random; }
The answer to the iteration question: If x = hash (password + salt), then x = hash (x + salt)
and 1 estimate x takes 10 ms, then 2 takes 20 and so on. So ... 25 ratings = 250 ms and 1000 = 10 000 ms.
Until it takes 10 ms for each of them, even .5 ms for more than 1000 is still half a second.
If you only accepted alphanumeric passwords and the password was 8 characters long, each iteration would add 62 ^ 8 (if they had not found the password) more hashes because they had to do another, for each combination they tried.