git://developer.intra2net.com
/
python-delta-tar
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
6e812ad
)
Fixed AESCrypt.encrypt with no data multiple of bs
author
Daniel Garcia Moreno
<danigm@wadobo.com>
Fri, 12 Jul 2013 11:18:03 +0000 (13:18 +0200)
committer
Daniel Garcia Moreno
<danigm@wadobo.com>
Fri, 12 Jul 2013 11:18:03 +0000 (13:18 +0200)
deltatar/aescrypto.py
patch
|
blob
|
blame
|
history
diff --git
a/deltatar/aescrypto.py
b/deltatar/aescrypto.py
index
c33f1af
..
3d8066f
100644
(file)
--- a/
deltatar/aescrypto.py
+++ b/
deltatar/aescrypto.py
@@
-80,13
+80,17
@@
class AESCrypt:
'''
self.buf += chunk
-
- chunk = self.buf
- if len(chunk) % self.bs == 0:
+ if len(self.buf) % self.bs == 0:
self.buf = ''
- return self.cipher.encrypt(chunk)
+ return self.cipher.encrypt(self.buf)
+
+ cipher = ''
+ while len(self.buf) >= self.bs:
+ chunk = self.buf[:self.bs]
+ self.buf = self.buf[self.bs:]
+ cipher += self.cipher.encrypt(chunk)
- return ''
+ return cipher
def decrypt(self, buf, end=False):
'''