Have a legacy app that moved to Debian 11 stuck with PHP 8.2 (PHP 5.6 no longer available for use). Original application utilized the first version of phpseclib but after being moved to new php 8.2 machine, no longer works, nothing in the log, it just returns unrecognizable data upon encryption calls.
This works on the old server it was moved from (works on PHP5, but not PHP8):
$rijndael = new Crypt_Rijndael(CRYPT_RIJNDAEL_MODE_ECB);
$rijndael->setKey('akeyof32btyeslongabcdefghijklmop');
$keylen = 256;
$rijndael->setKeyLength($keylen);
$rijndael->setBlockLength($keylen);
$decrypted1 = $rijndael->decrypt($EncryptedDataOf256bytes);
Tried upgrading to phpseclib3 with PHP 8.2 – data also returned unrecognizable.
$rijndael1 = new phpseclib3CryptRijndael('ecb');
$keylen = 256;
$rijndael->setKey('akeyof32btyeslongabcdefghijklmop');
$rijndael1->setKeyLength($keylen);
$rijndael1->setBlockLength($keylen);
$rijndael1->disablePadding(); // tried with and without padding,
$decrypted1 = $rijndael1->decrypt($bindata)
Looking into phpseclib3 it looks to have support for rijndael ECB 256 bit keys but the earlier version phpseclib didn’t, so not even sure at this point how it worked.
Tried everything, need advice on where to look next.