Php can't blowfish hash with cost over 17
<p>I'm using php's crypt() to hash passwords. I decided to go with blowfish algorithm and use salt. Salts in crypt() determine algorithm so blowfish's salt begins with $2y$xx$ where xx is cost parameter in range 4-31 (Refer to <a href="http://php.net/manual/pl/function.crypt.php" rel="nofollow">http://php.net/manual/pl/function.crypt.php</a>). I'm also using bin2hex and openssl random generator to get random salt. As I understand it setting it higher will require more computing time and make brute-force attack longer.</p>

<p>My problem is that I can't get my script to work with cost parameter set over 17. When ran from the browser page is loading approx 1min and then stops with blank page. Not even echo. Why is that? How could I use 30 instead of 17? Is this a matter of my php server settings ?</p>

<p>Here's code:</p>

<pre><code>&lt;?php
    $reps=17;
    echo 'pre';
    echo crypt('passwdMike',"$2y$".$reps."$".bin2hex(openssl_random_pseudo_bytes(22)));    
    echo 'post';
?&gt;
</code></pre>

<p>Edit: I can go with higher factors from command line. 18 was under minute. 30 waiting over 10minutes now. So it's obviously too much and 12 will suffice.</p>