Spaces:
Running
Running
Update get_gmail_data.py
Browse files- get_gmail_data.py +2 -2
get_gmail_data.py
CHANGED
@@ -191,9 +191,9 @@ class GmailDataExtractor:
|
|
191 |
def encrypt_message_id(self,message_id:str):
|
192 |
key = os.getenv('AES_KEY').encode('utf-8')[:32]
|
193 |
message_id_bytes = message_id.encode('utf-8')
|
194 |
-
|
195 |
# Initialize AES cipher with the key and CBC mode
|
196 |
-
cipher = Cipher(algorithms.AES(key), modes.CBC(), backend=default_backend())
|
197 |
|
198 |
# Create a encryptor object
|
199 |
encryptor = cipher.encryptor()
|
|
|
191 |
def encrypt_message_id(self,message_id:str):
|
192 |
key = os.getenv('AES_KEY').encode('utf-8')[:32]
|
193 |
message_id_bytes = message_id.encode('utf-8')
|
194 |
+
iv = os.urandom(16)
|
195 |
# Initialize AES cipher with the key and CBC mode
|
196 |
+
cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend())
|
197 |
|
198 |
# Create a encryptor object
|
199 |
encryptor = cipher.encryptor()
|