- PBKDF2 updates

This commit is contained in:
terrafrost 2012-06-16 16:42:54 -05:00
parent 9d0b172103
commit ccd2b6ae78
3 changed files with 7 additions and 10 deletions

View File

@ -371,7 +371,7 @@ class Crypt_DES {
*
* Depending on what $method is set to, setPassword()'s (optional) parameters are as follows:
* {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2}:
* $hash, $salt, $method
* $hash, $salt, $count
*
* @param String $password
* @param optional String $method
@ -389,7 +389,7 @@ class Crypt_DES {
}
// WPA and WPA use the SSID as the salt
if (!isset($salt)) {
$salt = 'phpseclib';
$salt = 'phpseclib/salt';
}
// RFC2898#section-4.2 uses 1,000 iterations by default
// WPA and WPA2 use 4,096.

View File

@ -234,7 +234,7 @@ class Crypt_RC4 {
*
* Depending on what $method is set to, setPassword()'s (optional) parameters are as follows:
* {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2}:
* $hash, $salt, $method, $dkLen
* $hash, $salt, $count, $dkLen
*
* @param String $password
* @param optional String $method
@ -252,18 +252,15 @@ class Crypt_RC4 {
}
// WPA and WPA use the SSID as the salt
if (!isset($salt)) {
$salt = 'phpseclib';
$salt = 'phpseclib/salt';
}
// RFC2898#section-4.2 uses 1,000 iterations by default
// WPA and WPA2 use 4,096.
if (!isset($count)) {
$count = 1000;
}
if (!isset($count)) {
$count = 1000;
}
if (!isset($dkLen)) {
$count = 1000;
$dkLen = 128;
}
if (!class_exists('Crypt_Hash')) {

View File

@ -582,7 +582,7 @@ class Crypt_Rijndael {
*
* Depending on what $method is set to, setPassword()'s (optional) parameters are as follows:
* {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2}:
* $hash, $salt, $method
* $hash, $salt, $count
* Set $dkLen by calling setKeyLength()
*
* @param String $password
@ -601,7 +601,7 @@ class Crypt_Rijndael {
}
// WPA and WPA use the SSID as the salt
if (!isset($salt)) {
$salt = 'phpseclib';
$salt = 'phpseclib/salt';
}
// RFC2898#section-4.2 uses 1,000 iterations by default
// WPA and WPA2 use 4,096.