class PBKDF2 extends KDF (View source)

Class providing PBKDF2 functionality

Methods

__construct(string $hashAlgorithm, int $length, string $salt = null, int $iterations = 1000)

KDF constructor

int
getLength()

Get key length

from  KDF
bool
setLength(int $length)

Set key length

from  KDF
string
getSalt()

Get salt

from  KDF
bool
setSalt(string $salt)

Set salt

from  KDF
string
derive(string $password)

Deriver hash for password

int
getIterations()

Get iterations

bool
setIterations(int $iterations)

Set iterations

string
getHashAlgorithm()

Get hash algorithm

bool
setHashAlgorithm(string $hashAlgorithm)

Set hash algorithm

Details

__construct(string $hashAlgorithm, int $length, string $salt = null, int $iterations = 1000)

KDF constructor

Parameters

string $hashAlgorithm
int $length
string $salt
int $iterations

int getLength()

Get key length

Return Value

int

bool setLength(int $length)

Set key length

Parameters

int $length

Return Value

bool

string getSalt()

Get salt

Return Value

string

bool setSalt(string $salt)

Set salt

Parameters

string $salt

Return Value

bool

string derive(string $password)

Deriver hash for password

Parameters

string $password

Return Value

string

int getIterations()

Get iterations

Return Value

int

bool setIterations(int $iterations)

Set iterations

Parameters

int $iterations

Return Value

bool

string getHashAlgorithm()

Get hash algorithm

Return Value

string

bool setHashAlgorithm(string $hashAlgorithm)

Set hash algorithm

Parameters

string $hashAlgorithm

Return Value

bool