diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index b7874ea11..6230a55e0 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -106,7 +106,7 @@ function crypt_random_string($length) } if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() $temp = fread($fp, $length); - if (strlen($temp) != $length) { + if (strlen($temp) == $length) { return $temp; } }