diff options
author | Miha Petkovsek <miha.petkovsek@gmail.com> | 2020-03-18 08:05:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 08:05:23 +0100 |
commit | 4a095194ff45d69b7ffe109f5a7a7b08182329ea (patch) | |
tree | 63631b5ff231a343bd749fe7784d90503d79961f /php-client | |
parent | e997b4df190b617820ef9093cb91eb7716c065a0 (diff) | |
parent | b40682d6ff1407d7471e5dbb7338dd3a38787637 (diff) | |
download | phpipam-api-clients-4a095194ff45d69b7ffe109f5a7a7b08182329ea.tar.gz |
Merge pull request #26 from Rico29/patch-1
Update class.phpipam-api.php
Diffstat (limited to 'php-client')
-rw-r--r-- | php-client/class.phpipam-api.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/php-client/class.phpipam-api.php b/php-client/class.phpipam-api.php index 3fa59fe..2abf438 100644 --- a/php-client/class.phpipam-api.php +++ b/php-client/class.phpipam-api.php @@ -695,7 +695,9 @@ class phpipam_api_client { $params['controller'] = $this->api_server_controller; // create encrypted request - $encrypted_request = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->api_key, json_encode($params), MCRYPT_MODE_ECB)); + $ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC"); + $iv = openssl_random_pseudo_bytes($ivlen); + $encrypted_request = base64_encode(openssl_encrypt(json_encode($params),$cipher,$this->api_key,$options=OPENSSL_RAW_DATA, $iv)); // escape + $encrypted_request = urlencode($encrypted_request); |