PHP Class Neos\Flow\Security\Cryptography\Algorithms

Right now this class provides a PHP based PBKDF2 implementation.
显示文件 Open project: neos/flow-development-collection Class Usage Examples

Public Methods

Method Description
pbkdf2 ( string $password, string $salt, integer $iterationCount, integer $derivedKeyLength, string $algorithm = 'sha256' ) : string Compute a derived key from a password based on PBKDF2

Method Details

pbkdf2() public static method

See PKCS #5 v2.0 http://tools.ietf.org/html/rfc2898 for implementation details. The implementation is tested with test vectors from http://tools.ietf.org/html/rfc6070 . If https://wiki.php.net/rfc/hash_pbkdf2 is ever part of PHP we should check for the existence of hash_pbkdf2() and use it if available.
public static pbkdf2 ( string $password, string $salt, integer $iterationCount, integer $derivedKeyLength, string $algorithm = 'sha256' ) : string
$password string Input string / password
$salt string The salt
$iterationCount integer Hash iteration count
$derivedKeyLength integer Derived key length
$algorithm string Hash algorithm to use, see hash_algos(), defaults to sha256
return string The computed derived key as raw binary data