Merge pull request #481 from zmwangx/crypto-fix
Fix BukuCrypt.encrypt_file
This commit is contained in:
commit
3d1d75b13b
6
buku
6
buku
@ -226,9 +226,11 @@ class BukuCrypt:
|
|||||||
if len(chunk) == 0:
|
if len(chunk) == 0:
|
||||||
break
|
break
|
||||||
if len(chunk) % 16 != 0:
|
if len(chunk) % 16 != 0:
|
||||||
chunk = '%s%s' % (chunk, ' ' * (16 - len(chunk) % 16))
|
chunk = b'%b%b' % (chunk, b' ' * (16 - len(chunk) % 16))
|
||||||
|
|
||||||
outfp.write(encryptor.update(chunk) + encryptor.finalize())
|
outfp.write(encryptor.update(chunk))
|
||||||
|
|
||||||
|
outfp.write(encryptor.finalize())
|
||||||
|
|
||||||
os.remove(dbfile)
|
os.remove(dbfile)
|
||||||
print('File encrypted')
|
print('File encrypted')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user