From 892126e11a75ce7b1b1ed23c19c7de34886f0d5e Mon Sep 17 00:00:00 2001 From: KEXNA <91727108+kexinoh@users.noreply.github.com> Date: Mon, 5 Aug 2024 01:23:15 +0800 Subject: [PATCH 1/2] Update crypto.py --- pubnub/crypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubnub/crypto.py b/pubnub/crypto.py index 9942573f..88e41ac6 100644 --- a/pubnub/crypto.py +++ b/pubnub/crypto.py @@ -69,7 +69,7 @@ def extract_random_iv(self, message, use_random_iv): def get_initialization_vector(self, use_random_iv): if self.pubnub_configuration.use_random_initialization_vector or use_random_iv: - return "{0:016}".format(random.randint(0, 9999999999999999)) + return os.urandom(16) else: return Initial16bytes From d73ff73d4e8c002ee705f4d795b7ad3d57d26c9b Mon Sep 17 00:00:00 2001 From: KEXNA <91727108+kexinoh@users.noreply.github.com> Date: Mon, 5 Aug 2024 01:31:34 +0800 Subject: [PATCH 2/2] Update crypto.py --- pubnub/crypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubnub/crypto.py b/pubnub/crypto.py index 88e41ac6..a4ea6a47 100644 --- a/pubnub/crypto.py +++ b/pubnub/crypto.py @@ -2,7 +2,7 @@ import json import random import logging - +import os from base64 import decodebytes, encodebytes, b64decode, b64encode from Cryptodome.Cipher import AES