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-gcm', $key, OPENSSL_RAW_DATA, $iv ); $decrypted = openssl_decrypt( $ciphertext, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv ); var_dump(bin2hex($ciphertext)); var_dump($decrypted);
based on 9TNTp
Output for 7.1.5 - 7.2.0
Warning: openssl_encrypt(): A tag should be provided when using AEAD mode in /in/JW5lp on line 20 string(0) "" bool(false)
Output for 7.1.0
Warning: openssl_encrypt(): A tag should be provided when using AEAD mode in /in/JW5lp on line 19 string(0) "" bool(false)
Output for 7.0.20
string(90) "fcb99d1aa74e875ce0a0f4369d81914ef6aab8bb6779d93d9f6eaaf8f612c09d5d55789a797a76b608c61fff3e" bool(false)
Output for 7.0.8
string(90) "4a465ec45373097df38fe5e4873e1b1961887732f069ba89c744864a21ff04f771acba5acf7e1d5cf277db966f" bool(false)
Output for 7.0.7
string(90) "e8ed0fdbc5cca59a9fa03dc1bb34f95948337608ddd5417ee0b8d9ecb1f48a302e4e931de92cdff619b6c700df" bool(false)
Output for 7.0.6
string(90) "71347beca0cb1ebe6383ebef6e3327361a3fb648167354ccb1bdb5ad06ac0d5d1b3d22d567c3b7d46440567ff7" bool(false)
Output for 7.0.5
string(90) "1fd452b965e4d7a3a64d8f8ece984ee45b4b7b39b83d620f4a724243f80bd2f54f2995c79ec583d6ff3f3d4569" bool(false)
Output for 7.0.4
string(90) "5f5161c3f32cfd75051509ae6d05b5d97100a8d7191c8989da8260d3068633b312e4d51f95670c8fdfe2c96152" bool(false)
Output for 7.0.3
string(90) "3909dfea7fb9f41376b517ca6452a011da8a5d48c2e6b3905e7b1dfd93c7837a867427e07f7a17da8d01b1a998" bool(false)
Output for 7.0.2
string(90) "99306f7ff8ba03c09f8c2403d6aef62c84d5eca39c91bc739fcf43ed4fad00add387c2708c5f69504901876cd8" bool(false)
Output for 7.0.1
string(90) "191e3abfeb3a748f7b0be4337518e0cd3615630c4215267f2880fcbe5e14eef57ff2fcd5f92a03d50a49cd3d52" bool(false)
Output for 7.0.0
string(90) "5f20ab51d4aec201696accc701999676c832814cb149dcd0fd7be600e79e0f6b578c6c9b9dd671f23b274526bc" bool(false)
Output for 5.5.0 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/JW5lp on line 11
Process exited with code 255.
Output for 5.0.0 - 5.4.45
Fatal error: Call to undefined function hash_pbkdf2() in /in/JW5lp on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: hash_pbkdf2() in /in/JW5lp on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: hash_pbkdf2() in /in/JW5lp on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: hash_pbkdf2() in /in/JW5lp on line 2