Salted S2K key generation (OpenPGP document, RFC 2440)

package Default

 Methods

Generate the new key

calc(string $hash, string $password, string $salt, integer $bytes) : string
Static

Parameters

$hash

string

The hash algorithm to be used by HMAC

$password

string

The source password/key

$salt

string

The salt of the algorithm

$bytes

integer

The output size in bytes

Exceptions

\Zend\Crypt\Key\Derivation\Exception\InvalidArgumentException

Returns

string

 Properties

 

$supportedMhashAlgos

$supportedMhashAlgos 

Default

array('adler32' => MHASH_ADLER32, 'md2' => MHASH_MD2, 'md4' => MHASH_MD4, 'md5' => MHASH_MD5, 'sha1' => MHASH_SHA1, 'sha224' => MHASH_SHA224, 'sha256' => MHASH_SHA256, 'sha384' => MHASH_SHA384, 'sha512' => MHASH_SHA512, 'ripemd128' => MHASH_RIPEMD128, 'ripemd256' => MHASH_RIPEMD256, 'ripemd320' => MHASH_RIPEMD320, 'haval128,3' => MHASH_HAVAL128, 'haval128' => MHASH_HAVAL128, 'haval160,3' => MHASH_HAVAL160, 'haval160' => MHASH_HAVAL160, 'haval192,3' => MHASH_HAVAL192, 'haval192' => MHASH_HAVAL192, 'haval224,3' => MHASH_HAVAL224, 'haval224' => MHASH_HAVAL224, 'haval256,3' => MHASH_HAVAL256, 'haval256' => MHASH_HAVAL256, 'tiger' => MHASH_TIGER, 'tiger128,3' => MHASH_TIGER128, 'tiger128' => MHASH_TIGER128, 'tiger160,3' => MHASH_TIGER160, 'tiger160' => MHASH_TIGER160, 'whirpool' => MHASH_WHIRLPOOL, 'snefru256' => MHASH_SNEFRU256, 'gost' => MHASH_GOST, 'crc32' => MHASH_CRC32, 'crc32b' => MHASH_CRC32B)
Static