0

Recently I upraded to Ubuntu 16.04 and PHP7. I have encrypt and decrypt methods. It was working on previous version.

Now I have problem while decrypting the string. The error says

Warning: mcrypt_decrypt(): Key of size 21 not supported by this algorithm

I have done necessary steps like installing mcrypt extensions and adding extension in php.ini

user3226210
  • 1
  • 1
  • 3
  • 2
    dup: http://stackoverflow.com/questions/27254432/mcrypt-decrypt-error-change-key-size – Oli Jul 12 '16 at 07:26
  • Please don't jump to conclusion without thorough verification. I did complete test and posted this question. Don't you see PHP7. It is working fine on older version. When I changed to PHP7 mcrypt_decrypt has stopped working. – user3226210 Jul 12 '16 at 11:13
  • Were you on PHP 5.5 before? This key size change landed in PHP 5.6. Also, [don't use mcrypt](https://paragonie.com/blog/2015/05/if-you-re-typing-word-mcrypt-into-your-code-you-re-doing-it-wrong), which will be deprecated in PHP 7.1 and removed in 7.2/8.0. – Scott Arciszewski Jul 12 '16 at 19:26
  • @user3226210 It does not matter, this error comes from the fact that from version 5.6 and onward *Invalid key and iv sizes are no longer accepted.* – Oli Jul 14 '16 at 08:25

0 Answers0