I have to transfer a very old application from an old server with PHP 5.4 to a server with PHP version 5.6.
When using the PHP crypt()
function outputting data on a server with PHP version 5.4.39 looks like this:
$2a$08$suUW14s06.5.us82.$$$$.iOPijt4Dzhwyw.2
Which is correct. And a server with PHP version 5.6.16 outputs this:
$2a$08$suUW14s06.5.us82.$
The code and input data is exactly the same. It looks like the prepended salt is only outputted, but not the given value to hash?
This is the hashing function:
function hash($string)
{
return crypt($string, '$2a$08$' . ENCRYPTION_SALT . '$');
}
Where ENCRYPTION_SALT is a 17 character long string:
zgUo92vv6.9.ww33.