PHP 7.2 with mcrypt in Windows

天大地大妈咪最大 提交于 2019-12-04 09:42:05

Basically I think you have mentioned all possibilities and you do not have a choice. Do not downgrade to PHP 5.6 this approach has no future.

MCrypt was removed from PHP for one of the main reasons why you want to upgrade PHP: Security. The MCrypt library is not maintained anymore. Therefore installing the MCrypt extension is also a bad idea. But it can be a temporary solution (follow e.g. those instructions https://serverpilot.io/community/articles/how-to-install-the-php-mcrypt-extension.html).

The only good solution is migrating from mcrypt to something else. There are questions regarding this topic on Stackoverflow already (e.g. Upgrading my encryption library from Mcrypt to OpenSSL). Alternativly you could use some encryption library. Migrating a large amount of code/data might be a pain but this is the most future-oriented approach in this case.

Note that no code or information about the mcrypt options/code.

Probably the only problems non-standard null padding used by mcrypt. To decrypt with another implementation that does not support null padding (it is non-standard) just decrypt with no padding and then remove the null padding.

If you also must encrypt the same as mcrypt just add null padding and encrypt with no-padding.

Really consider migrating the current encryption or adding some flag that the encryption is (or not) mcrypt compatible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!