From: Daniel Garcia Moreno Date: Mon, 15 Jul 2013 15:42:09 +0000 (+0200) Subject: Using aes128 for encryption X-Git-Tag: v2.2~163 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=a8d49f45277d84c7f8f2679086f07bf7cddb87e3;p=python-delta-tar Using aes128 for encryption --- diff --git a/deltatar/aescrypto.py b/deltatar/aescrypto.py index 85d2dbb..ea676de 100644 --- a/deltatar/aescrypto.py +++ b/deltatar/aescrypto.py @@ -35,7 +35,7 @@ class AESCrypt: def __init__(self, password, salt=''): self.bs = AES.block_size self.mode = AES.MODE_CBC - self.key_length = 32 + self.key_length = 16 self.buf = '' if salt: self.salt = salt diff --git a/testing/test_encryption.py b/testing/test_encryption.py index 12a2e11..cc170a0 100644 --- a/testing/test_encryption.py +++ b/testing/test_encryption.py @@ -37,7 +37,7 @@ class EncryptionTest(BaseTest): assert os.path.exists("sample.tar.gz.aes.0") # beginning of the tar file assert os.path.exists("sample.tar.gz.aes.1") # first file - os.system("openssl aes-256-cbc -k 'key' -d -in sample.tar.gz.aes.1 -out sample.tar.gz") + os.system("openssl aes-128-cbc -k 'key' -d -in sample.tar.gz.aes.1 -out sample.tar.gz") os.system("zcat sample.tar.gz > sample.tar") os.system("tar xf sample.tar") assert os.path.exists("big") @@ -82,7 +82,7 @@ class EncryptionTest(BaseTest): # extract and check output for i in xrange(1, 4): fname = "sample.tar.gz.aes.%d" % i - os.system("openssl aes-256-cbc -k 'key' -d -in %s -out sample.tar.gz" % fname) + os.system("openssl aes-128-cbc -k 'key' -d -in %s -out sample.tar.gz" % fname) os.system("zcat sample.tar.gz > sample.tar") os.system("tar xf sample.tar")