Omkar008 commited on
Commit
6d1ffb9
1 Parent(s): 8c840a6

Update get_gmail_data.py

Browse files
Files changed (1) hide show
  1. 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