by kijin · 10y ago · 0 comments
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!