mcrypt_decrypt() error change key size

后端 未结 8 1659
慢半拍i
慢半拍i 2020-12-06 05:17

mcrypt_decrypt(): Key of size 15 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported

How Can I fix this issue? my

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 05:34

    You don't need to pad the key with "\0".

    I had the same issue when migrating to a new PHP 7 server and I got the message :

    mcrypt_decrypt(): Key of size 19 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported.

    The key I had in the code was a string of 19 characters, I simply changed it to a string of 32 characters and everything was fine again.

    So as the error message suggests, use a valid size key.

提交回复
热议问题