Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.0.17 in our server and there\'s no tell when they upgrade
In your specific example I've found that by changing aes-128-ecb to aes-256-ecb, it produces the same output as the legacy mcrypt_encrypt.
aes-128-ecb
aes-256-ecb
mcrypt_encrypt