I have a zipfile for example, i changed some files in zip and i need to encrypt it and after that save
def encrypt(self, zipfile: ZipFile):
import base64
with open(self.__db_path, 'wb') as db_file:
decrypted_data = zipfile.read()
aes = AES.new(self.key, AES.MODE_OFB)
encrypted_data = aes.encrypt(decrypted_data)
with open(self.__db_path, 'wb') as db_file:
db_file.write(encrypted_data)
But this code throwing the exception, cause code expected argument "name" to read some files into the zip How i can read all zip file to encrypt it and save?