<?php $url = "https://104.207.154.189/customer/getuid"; $encryptionMethod = 'aes-128-cbc'; $secretKey = "315a5504d921f832"; $iv = "e43da7d1ad2c5973bafc6ef3c4924ead"; $num = 1; $params = array("ids_num"=>$num); $iv_size = openssl_cipher_iv_length($encryptionMethod); $encryptedMessage = openssl_encrypt(json_encode($params), $encryptionMethod, $secretKey, 0, hex2bin($iv)); print_r("Params:\n" . json_encode($params) . "\n"); print_r("\n\nEncrypted:\n" . $encryptedMessage . "\n"); $post_data = array( 'x' => $encryptedMessage ); $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); print_r("\n\nResponde:\n" . $response . "\n"); curl_close($curl); $dec = $response; $dencryptedMessage = openssl_decrypt($dec, $encryptionMethod, $secretKey, 0, hex2bin($iv)); print_r("\n\nDecrypted response:\n" . $dencryptedMessage); ?>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more