# used together with aes modes to encrypt and decrypt backups.
password = None
+ # parameter version to use when encrypting; note that this has no effect
+ # on decryption since the required settings are determined from the headers
+ crypto_paramversion = None
+
# when encrypting or decrypting, this holds crypto handler; created before
# establishing the Tarfile stream iff a password is supplied.
crypto_ctx = None
def __init__(self, excluded_files=[], included_files=[],
filter_func=None, mode="", password=None,
+ crypto_paramversion=DELTATAR_PARAMETER_VERSION,
logger=None, index_mode=None, index_name_func=None,
volume_name_func=None):
'''
- password: used to encrypt and decrypt backups. Encryption will be
enabled automatically if a password is supplied.
+ - crypto_paramversion: optionally request encryption conforming to
+ a specific parameter version. Defaults to the standard PDT value
+ which as of 2017 is the only one available.
+
- logger: python logger object. Optional.
- index_mode: specifies the index mode in the same format as @param
if password is not None:
self.password = password
+ if crypto_paramversion is not None:
+ self.crypto_paramversion = crypto_paramversion
+
+
# generate index_mode
if index_mode is None:
index_mode = ''
self.crypto_ctx = \
crypto.Encrypt (self.password,
version=DELTATAR_HEADER_VERSION,
- paramversion=DELTATAR_PARAMETER_VERSION)
+ paramversion=self.crypto_paramversion)
# some initialization
self.vol_no = 0
self.crypto_ctx = \
crypto.Encrypt (self.password,
version=DELTATAR_HEADER_VERSION,
- paramversion=DELTATAR_PARAMETER_VERSION)
+ paramversion=self.crypto_paramversion)
# some initialization
self.vol_no = 0