diff --git a/phpseclib/Crypt/DES.php b/phpseclib/Crypt/DES.php index 5b141d18..b274495b 100644 --- a/phpseclib/Crypt/DES.php +++ b/phpseclib/Crypt/DES.php @@ -674,9 +674,11 @@ class Crypt_DES extends Crypt_Base */ function isValidEngine($engine) { - if ($engine == CRYPT_ENGINE_OPENSSL) { - $this->cipher_name_openssl_ecb = 'des-ecb'; - $this->cipher_name_openssl = 'des-' . $this->_openssl_translate_mode(); + if ($this->key_size_max == 8) { + if ($engine == CRYPT_ENGINE_OPENSSL) { + $this->cipher_name_openssl_ecb = 'des-ecb'; + $this->cipher_name_openssl = 'des-' . $this->_openssl_translate_mode(); + } } return parent::isValidEngine($engine);