diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index e5c819c76..8f53eb319 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -98,7 +98,7 @@ static function 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; } }