diff --git a/phpseclib/Crypt/DES.php b/phpseclib/Crypt/DES.php index c249d6b6..b7a18928 100644 --- a/phpseclib/Crypt/DES.php +++ b/phpseclib/Crypt/DES.php @@ -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. diff --git a/phpseclib/Crypt/RC4.php b/phpseclib/Crypt/RC4.php index 75071d9f..c1daa370 100644 --- a/phpseclib/Crypt/RC4.php +++ b/phpseclib/Crypt/RC4.php @@ -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')) { diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 6d4b21ac..1809d592 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -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.