mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 02:11:20 +00:00
Crypt: some of the minimum key lengths were off
This commit is contained in:
parent
354666c36d
commit
c340d62548
@ -367,7 +367,7 @@ class Crypt_Blowfish extends Crypt_Base
|
|||||||
function setKeyLength($length)
|
function setKeyLength($length)
|
||||||
{
|
{
|
||||||
if ($length < 32) {
|
if ($length < 32) {
|
||||||
$this->key_length = 7;
|
$this->key_length = 4;
|
||||||
} elseif ($length > 448) {
|
} elseif ($length > 448) {
|
||||||
$this->key_length = 56;
|
$this->key_length = 56;
|
||||||
} else {
|
} else {
|
||||||
|
@ -369,7 +369,7 @@ class Crypt_RC2 extends Crypt_Base
|
|||||||
function setKeyLength($length)
|
function setKeyLength($length)
|
||||||
{
|
{
|
||||||
if ($length < 8) {
|
if ($length < 8) {
|
||||||
$this->default_key_length = 8;
|
$this->default_key_length = 1;
|
||||||
} elseif ($length > 1024) {
|
} elseif ($length > 1024) {
|
||||||
$this->default_key_length = 128;
|
$this->default_key_length = 128;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user