Error: Undefined class constant 'MODE_CBC' in Civi\Crypto\PhpseclibCipherSuite->__construct() (line 51 of /vendor/civicrm/civicrm-core/Civi/Crypto/PhpseclibCipherSuite.php)
In case of phpseclib v1 the constants MODE_CBC and MODE_CTR are used in line 51 of /vendor/civicrm/civicrm-core/Civi/Crypto/PhpseclibCipherSuite.php
elseif (class_exists('Crypt_AES')) {
// phpseclib v1
$this->ciphers['aes-cbc'] = new \Crypt_AES(\Crypt_AES::MODE_CBC);
$this->ciphers['aes-cbc']->setKeyLength(256);
$this->ciphers['aes-ctr'] = new \Crypt_AES(\Crypt_AES::MODE_CTR);
$this->ciphers['aes-ctr']->setKeyLength(256);
But following https://github.com/phpseclib/phpseclib/blob/1.0.19/phpseclib/Crypt/AES.php#L99 the constants should be CRYPT_MODE_CBC and CRYPT_MODE_CTR
I'm also not sure is this piece of code is needed as normally you should not have phpseclib v1 as civicrm/civicrm-cxn-rpc requires version 2. In my case composer had not run that update so I'm just updating to phpseclib v2 to fix this issue.