class Algorithms (View source)

deprecated since 8.2, use PHPs `hash_pbkdf2`

Cryptographic algorithms

Right now this class provides a PHP based PBKDF2 implementation.

Methods

static string
pbkdf2(string $password, string $salt, int $iterationCount, int $derivedKeyLength, string $algorithm = 'sha256')

Compute a derived key from a password based on PBKDF2

Details

static string pbkdf2(string $password, string $salt, int $iterationCount, int $derivedKeyLength, string $algorithm = 'sha256')

Compute a derived key from a password based on PBKDF2

Parameters

string $password

Input string / password

string $salt

The salt

int $iterationCount

Hash iteration count

int $derivedKeyLength

Derived key length

string $algorithm

Hash algorithm to use, see hash_algos(), defaults to sha256

Return Value

string

The computed derived key as raw binary data