I am getting the warning in PHP Version 5.6.15. What does mean by Key of size 26 not supported by this algorithm.
Asked
Active
Viewed 983 times
-1
-
If this is an issue from upgrading your MySQL version, the [changelog](http://php.net/manual/en/function.mcrypt-encrypt.php#refsect1-function.mcrypt-encrypt-changelog) says the following: Invalid key and iv sizes are no longer accepted. `mcrypt_encrypt()` will now throw a warning and return `FALSE` if the inputs are invalid. Previously keys and IVs were padded with '`\0`' bytes to the next valid size. – Phylogenesis Jul 21 '16 at 12:24
1 Answers
2
26 was never a valid key size, but PHP versions <5.6 used to transparently deal with this for you. From the documentation
Invalid key and iv sizes are no longer accepted. mcrypt_encrypt() will now throw a warning and return FALSE if the inputs are invalid. Previously keys and IVs were padded with '\0' bytes to the next valid size.
So you can replicate the old behaviour by padding your key with null bytes, using strpad
.

iainn
- 16,826
- 9
- 33
- 40