Spaces:
Sleeping
Sleeping
Update get_gmail_data.py
Browse files- get_gmail_data.py +3 -1
get_gmail_data.py
CHANGED
@@ -6,6 +6,8 @@ import jwt
|
|
6 |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
7 |
from cryptography.hazmat.backends import default_backend
|
8 |
import os
|
|
|
|
|
9 |
class GmailDataExtractor:
|
10 |
|
11 |
def __init__(self,jwt:str , user_input: str = None) -> None:
|
@@ -187,7 +189,7 @@ class GmailDataExtractor:
|
|
187 |
return subject, text,None , company_from_gmail , encrypted_message_id
|
188 |
|
189 |
def encrypt_message_id(self,message_id:str):
|
190 |
-
key = os.getenv('AES_KEY').encode('utf-8')
|
191 |
message_id_bytes = message_id.encode('utf-8')
|
192 |
|
193 |
# Initialize AES cipher with the key and CBC mode
|
|
|
6 |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
7 |
from cryptography.hazmat.backends import default_backend
|
8 |
import os
|
9 |
+
import hashlib
|
10 |
+
|
11 |
class GmailDataExtractor:
|
12 |
|
13 |
def __init__(self,jwt:str , user_input: str = None) -> None:
|
|
|
189 |
return subject, text,None , company_from_gmail , encrypted_message_id
|
190 |
|
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
|