3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //82534 define('ENCKEY','w+2#)1FP&LIPTL2<8I2'); class CRYPT { public function encrypt($Str,$Key=ENCKEY) { srand(); $Str=str_pad($Str, 32-strlen($Str)); $IVSize=mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $IV=mcrypt_create_iv($IVSize, MCRYPT_RAND); $CryptStr=mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $Key, $Str, MCRYPT_MODE_CBC, $IV); return base64_encode($IV.$CryptStr); } public function decrypt($CryptStr,$Key=ENCKEY) { if ($CryptStr!='') { $IV=substr(base64_decode($CryptStr),0,16); $CryptStr=substr(base64_decode($CryptStr),16); return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $Key, $CryptStr, MCRYPT_MODE_CBC,$IV)); } else { return ''; } } } // class ENCRYPT() $e = new CRYPT; $s = urldecode("LnMWU28qggKQUzfPasr03NYEG%2FD2A5Zas1Ory9GfkZ7kIUDQ9XKG6vsYKI03WYhZML%2FZxvqlWHbeCAXJ4uuD0TuRKZY1Jt8NLgSnNCDwMQjAQN5NAwfv45eWiNg2r6l596Z75ZQC%2FOunu5QhHvF3CvxHso3n9i%2BTW2HzzbHn%2B2Q%3D"); $s = $e->decrypt($s); echo $e->decrypt($s);
based on 9GBPH
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in /in/o1qnj:21 Stack trace: #0 /in/o1qnj(31): CRYPT->decrypt('\xD6\x04\e\xF0\xF6\x03\x96Z\xB3S\xAB\xCB\xD1\x9F\x91...') #1 {main} thrown in /in/o1qnj on line 21
Process exited with code 255.
Output for 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
Warning: mcrypt_decrypt(): Key of size 19 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in /in/o1qnj on line 21
Output for 5.3.19 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_decrypt() in /in/o1qnj on line 21
Process exited with code 255.
Output for 5.4.0 - 5.5.34
n6ljh9ndnzub2sd1hm3txyv0qnka9w3x|~|68012|~|188.172.192.19