Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sorry, I would've commented on the post but haven't got enough rep yet.</p> <p>I'd use SHA256 for my hash algo and keep the iterations around 25. Any more than that and it's really overkill. I use a very similar solution for a framework that I've applied to half a dozen sites now. I chose to create an overly complicated random character generator, but I've used it in a lot of other places, including tokenizing financial data.</p> <p>Another edit: Use a random character generator like this for your salt:</p> <pre><code>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", "~", "!", "@", "#", "%", "^", "&amp;", "(", ")", ":", "{", "[", "]", "}", "|", "&lt;", "&gt;", ".", ",", "/", "?", "_", "+", "-", "="); $charactersNumber = count($characters); $charactersNumber--; $randomLength = 0; while ($randomLength &lt; $length) { $currentCharacter = $characters[rand(0,$charactersNumber)]; if ($currentCharacter == $previousCharacter) { $currentCharacter = $characters[rand(0,$charactersNumber)]; } $random .= $currentCharacter; $previousCharacter = $currentCharacter; $randomLength++; } return $random; } </code></pre> <p>Response to iteration question: If x = hash(password + salt) and from then on x = hash(x + salt)</p> <p>and 1 evaluation of x takes 10ms, then 2 would take 20 and so on. So... 25 evaluations = 250ms and 1000 = 10,000ms.</p> <p>While it's not going to take 10ms for each one, even .5ms over 1000 is still half a second.</p> <p>If you only accepted alphanumeric passwords, and a password was 8 characters long, each iteration would add 62^8 (if they hadn't yet found the password) more hashes because they would have to do another has for every single combination they tried.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload