4 ms·
This is indeed pretty terrible. It indicates that this library was not adequately studied by security experts at the time it was abandoned. If you're writing c
by CiPHPerCoder 11y ago
This is indeed pretty terrible. It indicates that this library was not adequately studied by security experts at the time it was abandoned.
If you're writing code with libmcrypt (for example, in PHP), strongly consider switching to OpenSSL or, if the upcoming RFC passes for 7.1, libsodium. (An RFC passed this week that will deprecate then remove libmcrypt support for PHP.)
Further reading:
* If you're typing MCRYPT into your PHP code, you're doing it wrong: https://paragonie.com/blog/2015/05/if-you-re-typing-word-mcrypt-into-your-code-you-re-doing-it-wrong https://paragonie.com/blog/2015/05/if-you-re-typing-word-mcr...
* Mcrypt deprecation/removal RFC (accepted): https://wiki.php.net/rfc/mcrypt-viking-funeral https://wiki.php.net/rfc/mcrypt-viking-funeral
* Libsodium RFC (soon): https://wiki.php.net/rfc/libsodium https://wiki.php.net/rfc/libsodium
* Cryptographic Right Answers: https://gist.github.com/tqbf/be58d2d39690c3b366ad https://gist.github.com/tqbf/be58d2d39690c3b366ad
(Note: Although libmcrypt is terrible, it's worth noting that PHP's own ext/mcrypt code, mostly mcrypt_create_iv(), is actually not bad.)
- kijin 11y agoI'm a regular contributor to a FOSS project that supports fairly old versions of PHP. We use defuse/php-encryption where possible, but fall back to an mcrypt wrapper on older platforms. The wrapper implements key splitting, PKCS#7 padding, HMAC, and constant-time string comparison in a way that is fully compatible with defuse/php-encryption, and we have unit tests to ensure that data encrypted with the former can be decrypted with the latter and vice versa. Still, I'm not thrilled by having to keep this wrapper around. Our next major version will finally drop support for PHP < 5.5, and I'm very much looking forward to it. On the other hand, using OpenSSL doesn't feel all that safer, either, given its terrible codebase and frequent vulnerabilities. Can't wait for libsodium!
- CiPHPerCoder 11y agoNone of the OpenSSL vulnerabilities that were published in the past few years affected its AES implementation.