From d97988aae3732ce3cdfb67b83f0b39efb37cc5c9 Mon Sep 17 00:00:00 2001 From: bvbej Date: Tue, 11 Jan 2022 14:34:56 +0800 Subject: [PATCH] [edit] AesDecrypt --- src/Handles/BvBeJHandle.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Handles/BvBeJHandle.php b/src/Handles/BvBeJHandle.php index 8d95527..d168daa 100644 --- a/src/Handles/BvBeJHandle.php +++ b/src/Handles/BvBeJHandle.php @@ -30,7 +30,7 @@ class BvBeJHandle */ public function AesEncrypt(string $data, string $key, string $vi): string|false { - return $this->Base64UrlEncode(openssl_encrypt($data, 'AES-128-CBC', $key, OPENSSL_CIPHER_AES_128_CBC, $vi)); + return openssl_encrypt($data, 'AES-128-CBC', $key, OPENSSL_CIPHER_AES_128_CBC, $vi); } /** @@ -42,7 +42,7 @@ class BvBeJHandle */ public function AesDecrypt(string $data, string $key, string $vi): string|false { - return openssl_decrypt($this->Base64UrlDecode($data), 'AES-128-CBC', $key, OPENSSL_CIPHER_AES_128_CBC, $vi); + return openssl_decrypt($data, 'AES-128-CBC', $key, OPENSSL_CIPHER_AES_128_CBC, $vi); } /** @@ -110,7 +110,7 @@ class BvBeJHandle 't' => $timestamp ]); ksort($form); - $sign = http_build_query($form); + $sign = urlencode(http_build_query($form)); try { $signature = $this->AesEncrypt($sign, $key, $vi); if ($signature === false) {