password_get_info returning unexpected results

153 Views Asked by At

Usually, you can use password_get_info($string); to get some information about a hashed password which will return something like this:

[
    'algo' => int,
    'algoName' => 'name of algorithm|unknown',
    'options' => [/*options for algo, or empty if unknown */]
]

If the string isn't a hash, you'll get a result like this:

[
    'algo' => 0,
    'algoName' => 'unknown',
    'options' => []
]

Some widespread authentication methods are build around this.

What I'm experiencing right now is, that I'm getting the following result where the value for algo is NULL instead of the usual 0:

[
    'algo' => NULL,
    'algoName' => 'unknown',
    'options' => []
]

Now the problem ist, that I can't figure out why it's returning NULL instead of 0 which breaks the package that handles authentication in the project I'm building. Has anyone ever experienced something like this?

For reference, I'm running the official php:7.4-apache Docker image with PHP 7.4.3.

0

There are 0 best solutions below