Skip to content

Commit

Permalink
Use streaming mode when encrypting
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed Oct 17, 2023
1 parent 049f917 commit 5fde392
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions securetar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ def __init__(

# Tarfile options
self._tar: Optional[tarfile.TarFile] = None
self._tar_mode: str = f"{mode}:gz" if gzip else f"{mode}|"
if key:
self._tar_mode = f"{mode}|"
else:
self._tar_mode = f"{mode}:"
if gzip:
self._extra_args["compresslevel"] = 6

if gzip:
self._extra_args["compresslevel"] = 6
self._tar_mode = self._tar_mode + "gz"

# Encryption/Description
self._aes: Optional[Cipher] = None
Expand Down

0 comments on commit 5fde392

Please sign in to comment.