Variable | Description |
---|---|
$parameter | Body request parameter array |
$key | get it from api panel |
$iv | get it from api panel |
public static function encrypt($parameter, $key, $iv)
{
$data = json_encode($data, JSON_UNESCAPED_SLASHES);
$ciphertext_raw = openssl_encrypt($data, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $iv);
return bin2hex($ciphertext_raw);
}
$encyptedBody = $this->encrypt($parameter, $key, $iv);
For online reference