I'm trying to add "bcrypt" encryption for my passwords. But when executing the code, i got error like this
Fatal error: Call to undefined function password_hash() in E:\wamp\www\test\passwords\index.php on line 5
My code is
<?php
$options = ['cost' => 11, 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM)];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."
";
I dont know much about this, just copied the code from the tutorial. Am I missing something?
I don't really know why this function doesn't work for you but to be sure confirm you PHP version with phpinfo()
Actually, there is an alternative that produces the same hash for PHP >= 5.3.7