3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $encryption_key="adfgjderuspmwzwt"; $encryptedText = "02eftQAHQKejcfMJYbm06GD21HqFCj55uhAMLqbdGEONSHWLVMn1dIchgEFCNZvCSW7oPM44qyqQ"; $key="adfgjderuspmwzwt"; $data = "02eftQAHQKejcfMJYbm06GD21HqFCj55uhAMLqbdGEONSHWLVMn1dIchgEFCNZvCSW7oPM44qyqQ"; /*$encryptionMethod = "AES-256-CBC"; // DEFINE our cipher define('AES_256_CBC', 'aes-256-cbc'); // Generate a 256-bit encryption key // This should be stored somewhere instead of recreating it each time $encryption_key = openssl_random_pseudo_bytes(32); $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($encryptionMethod)); $encrypted = $encryptedText . ':' . $iv; $parts = explode(':', $encrypted); $decrypted = openssl_decrypt($parts[0], $encryptionMethod, $encryption_key, 0, $parts[1]); echo "Decrypted: $decrypted\n";*/ /*function decrypt($data, $key) { $decode = base64_decode($data); return mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$decode,"MCRYPT_MODE_CBC","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); } decrypt($data, $key);*/ print("-- Start --<br />"); include("AES.class.php"); $z = $_POST['adfgjderuspmwzwt']; $data = $_POST['plaintext']; $mode = $_POST['CBC']; $iv = $_POST['1234567890abcdef']; $aes = new AES($z, $mode, $iv); $starte = microtime(true); $encrypted = $aes->encrypt($data); $ende = microtime(true); print "Execution time to encrypt: " . ($ende - $starte) . " seconds<br />"; print "Cipher-Text: " . $encrypted . "<br />"; print "Hex: " . bin2hex($encrypted) . "<br />"; print "Base 64: " . base64_encode($encrypted) . "<br /><br />"; $startd = microtime(true); $decrypted = $aes->decrypt($encryptedText); $endd = microtime(true); print "Execution time to decrypt: " . ($endd - $startd) . " seconds<br />"; print "Decrypted-Text: " . stripslashes($decrypted); print "<br />-- End --<br />";
based on mYgn6
Output for 7.0.0 - 7.2.1
-- Start --<br /> Warning: include(AES.class.php): failed to open stream: No such file or directory in /in/9mf0b on line 31 Warning: include(): Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Uncaught Error: Class 'AES' not found in /in/9mf0b:37 Stack trace: #0 {main} thrown in /in/9mf0b on line 37
Process exited with code 255.
Output for hhvm-3.22.0
-- Start --<br /> Warning: include(AES.class.php): File not found in /in/9mf0b on line -1 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line -1 Notice: Undefined index: plaintext in /in/9mf0b on line -1 Notice: Undefined index: CBC in /in/9mf0b on line -1 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line -1 Fatal error: Uncaught Error: Class undefined: AES in /in/9mf0b:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.13.2 - 3.21.3
-- Start --<br /> Warning: include(AES.class.php): File not found in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Uncaught Error: Class undefined: AES in /in/9mf0b:37 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.12.14
-- Start --<br /> Warning: File not found: AES.class.php in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Uncaught Error: Class undefined: AES in /in/9mf0b:37 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
-- Start --<br /> Warning: File not found: AES.class.php in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Class undefined: AES in /in/9mf0b on line 37
Process exited with code 255.
Output for 5.3.0 - 5.6.30
-- Start --<br /> Warning: include(AES.class.php): failed to open stream: No such file or directory in /in/9mf0b on line 31 Warning: include(): Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Class 'AES' not found in /in/9mf0b on line 37
Process exited with code 255.
Output for 5.1.0 - 5.2.17
-- Start --<br /> Warning: include(AES.class.php): failed to open stream: No such file or directory in /in/9mf0b on line 31 Warning: include(): Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Class 'AES' not found in /in/9mf0b on line 37
Process exited with code 255.
Output for 5.0.0 - 5.0.5
-- Start --<br /> Warning: main(AES.class.php): failed to open stream: No such file or directory in /in/9mf0b on line 31 Warning: main(): Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Class 'AES' not found in /in/9mf0b on line 37
Process exited with code 255.
Output for 4.3.2 - 4.4.9
-- Start --<br /> Warning: main(AES.class.php): failed to open stream: No such file or directory in /in/9mf0b on line 31 Warning: main(): Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Cannot instantiate non-existent class: aes in /in/9mf0b on line 37
Process exited with code 255.
Output for 4.3.0 - 4.3.1
-- Start --<br /> Warning: main(AES.class.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/9mf0b on line 31 Warning: main() [http://www.php.net/function.main]: Failed opening 'AES.class.php' for inclusion (include_path='.:') in /in/9mf0b on line 31 Notice: Undefined index: adfgjderuspmwzwt in /in/9mf0b on line 32 Notice: Undefined index: plaintext in /in/9mf0b on line 33 Notice: Undefined index: CBC in /in/9mf0b on line 34 Notice: Undefined index: 1234567890abcdef in /in/9mf0b on line 35 Fatal error: Cannot instantiate non-existent class: aes in /in/9mf0b on line 37