3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Secret for encryption from PAY.ON webhook configuration $encryptionKey = "2AAF35485A2BBB9196CE58DE0C88E2D3C7735A43A609A5ED9C868D17EFB8D67D"; // Headers received from webhook $ivHex = "1EDC4E012C572E7DE66EE839"; $authTagHex = "FC35831EDF2EE0C25AC2A10240CA8B97"; // Encrypted body received from webhook.site $cipherTextHex = 'PASTE_THE_COMPLETE_ENCRYPTED_BODY_HERE'; // Convert HEX values to binary $key = hex2bin($encryptionKey); $iv = hex2bin($ivHex); $authTag = hex2bin($authTagHex); $cipherText = hex2bin($cipherTextHex); // Decrypt $result = openssl_decrypt( $cipherText, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv, $authTag ); // Output result if ($result === false) { echo "Decryption failed"; echo PHP_EOL; echo openssl_error_string(); } else { echo "Decrypted Payload:"; echo PHP_EOL; echo $result; } ?><?php // Secret for encryption from PAY.ON webhook configuration $encryptionKey = "2AAF35485A2BBB9196CE58DE0C88E2D3C7735A43A609A5ED9C868D17EFB8D67D"; // Headers received from webhook $ivHex = "1EDC4E012C572E7DE66EE839"; $authTagHex = "FC35831EDF2EE0C25AC2A10240CA8B97"; // Encrypted body received from webhook.site $cipherTextHex = 'PASTE_THE_COMPLETE_ENCRYPTED_BODY_HERE'; // Convert HEX values to binary $key = hex2bin($encryptionKey); $iv = hex2bin($ivHex); $authTag = hex2bin($authTagHex); $cipherText = hex2bin($cipherTextHex); // Decrypt $result = openssl_decrypt( $cipherText, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv, $authTag ); // Output result if ($result === false) { echo "Decryption failed"; echo PHP_EOL; echo openssl_error_string(); } else { echo "Decrypted Payload:"; echo PHP_EOL; echo $result; } ?>
Output for 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Warning: hex2bin(): Input string must be hexadecimal string in /in/ikTtT on line 17 Fatal error: Uncaught Error: Call to undefined function openssl_decrypt() in /in/ikTtT:20 Stack trace: #0 {main} thrown in /in/ikTtT on line 20
Process exited with code 255.

preferences:
31.17 ms | 1152 KiB | 7 Q