From f91c4ccf60be4cb3f0e85595bd52a1810cdec806 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 20 Dec 2014 11:14:29 -0600 Subject: [PATCH] DES: apparently TripleDES extends DES this was not always the case: See https://github.com/phpseclib/phpseclib/commit/c4752cbeba6389e8abbc8ee8b8b1a066c2c1634a --- phpseclib/Crypt/DES.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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);