3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = hash_pbkdf2( 'sha256', 'foot assay palsy levin sn tenney slap rap sepoy sturm fine hue knox han pawn erro', "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\1e\x1f", 86000, 32, true ); $iv = random_bytes(openssl_cipher_iv_length('aes-256-gcm')); $data = 'Obscene artwork possibly from furaffinity.jpg'; $ciphertext = openssl_encrypt( $data, 'aes-256-ctr', $key, OPENSSL_RAW_DATA, $iv ); $decrypted = openssl_decrypt( $ciphertext, 'aes-256-ctr', $key, OPENSSL_RAW_DATA, $iv ); var_dump(bin2hex($ciphertext)); var_dump($decrypted);
based on JW5lp
Output for 7.2.0
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "ec745eba48f872ed891c1895ca8bdb7c10912d83fed5218baee27b2a50ec6dbe052220ef1d95df30b98e6ff52b" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.1.10
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "655ba42d97eda4517418409d2a7980c1561d5f6f40d4449fb20a4499f85974fc46b8140dffdd4ad840db168385" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.1.7
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "b9cf03315bd6a70df590eab8727cc4ba1db8c03c748b27d1cbbec0e2bedd2b699d902a49969a158c9c683a7a2d" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.1.6
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "e3741d658739135a16c592fe5b63d7e979c0affc82e0e0a1197164355f3bc52902fe76f760460a1a5e8ecfdb22" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.1.5
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "de140aeda1aa5285178b4e53601c629a9c8eca6d2b776b3d46ddb2930b6c4a807fdb3d770c3ea0175868334ff8" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.1.0
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "5c8882d9720cae2e9534322f8314c0e2d082a44efbea7b957a1a5a5c36cf2655c9ab916ef2a84c15376259e13f" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.20
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 20 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 28 string(90) "b24926fffd60c56c0d84fc4d192a12ef22e2262fd1ee5973350749d650a69051e7d41cc3d081ecae3224eed1e3" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.6
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "18c015d5efd1f6a683a8eabf4a9c4715dd0d5b23212d05c783cc380a3cfa9cc838f4c7eaf4a85aea9b9cedb5ee" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.5
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "a1529a513e072c8d27a9ae898fdc5026b8a8efd9d072e4ebf8eeafcdf0f073448123859b34b9f29e13fb1826c7" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.4
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "85f3922f55bc35054c28535840573ef06851300a653e48fd6ecaef934e485fa877ae8c318a7a715ac9b33e3736" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.3
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "5fefe545971e92a9a67666ff7ee106e50bab946e62bdb171a8f51ae4d86e5136895a80f3cf7337c155959f5b56" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.2
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "f3416d3e61b6f63113e60d204af9d658c55f08e5313f99eda5b7e341cb52058e3ad8f80aee0ed2181427ca6e46" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.1
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "f58020156ca8e23a9c670f87f6182293a8098bd335aed33092faeae620ffb7d7481bec6d40c981ca775a59de4a" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 7.0.0
Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 19 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/TeHct on line 27 string(90) "69ca440b1066fc100bc7da09545a8c65b959bd4e0734862f0bc6a29de8fcce5cb082a7ae39454ed4948888c766" string(45) "Obscene artwork possibly from furaffinity.jpg"
Output for 5.5.24 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/TeHct on line 11
Process exited with code 255.
Output for 5.3.20 - 5.4.45
Fatal error: Call to undefined function hash_pbkdf2() in /in/TeHct on line 2
Process exited with code 255.