3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = 'a16byteslongkey!'; $data = base64_decode('LsCH4nvvGPKN67v94Ig9BweQgOk9rtDdK7ZugeJkTS8='); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = substr($data, 0, $iv_size); $iv = str_repeat("\x00", 16); function aes256_cbc_decrypt($key, $data, $iv) { if (32 !== strlen($key)) { $key = hash('SHA256', $key, true); } $data = mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv ); $padding = ord($data[strlen($data) - 1]); return substr($data, 0, -$padding); } $result = aes256_cbc_decrypt($key,$data,$iv); var_dump($result);
based on eJTOM
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/DqUbs:5 Stack trace: #0 {main} thrown in /in/DqUbs on line 5
Process exited with code 255.
Output for 5.4.12 - 5.5.34, 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
string(18) "anil.mnd@gmail.com"
Output for 5.3.22 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_get_iv_size() in /in/DqUbs on line 5
Process exited with code 255.