Skip to content

Commit 4a09519

Browse files
authored
Merge pull request #26 from Rico29/patch-1
Update class.phpipam-api.php
2 parents e997b4d + b40682d commit 4a09519

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

php-client/class.phpipam-api.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,9 @@ private function curl_set_params ($params) {
695695
$params['controller'] = $this->api_server_controller;
696696

697697
// create encrypted request
698-
$encrypted_request = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->api_key, json_encode($params), MCRYPT_MODE_ECB));
698+
$ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC");
699+
$iv = openssl_random_pseudo_bytes($ivlen);
700+
$encrypted_request = base64_encode(openssl_encrypt(json_encode($params),$cipher,$this->api_key,$options=OPENSSL_RAW_DATA, $iv));
699701

700702
// escape +
701703
$encrypted_request = urlencode($encrypted_request);

0 commit comments

Comments
 (0)