[issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf'

Serhiy Storchaka report at bugs.python.org
Tue Apr 9 08:06:00 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

This is how the weak encryption in ZIP files work. In 255 cases from 256 the wrong password can be detected earlier (this make the encryption just weaker). But it 1 case of 256 this check is passed and you will get either an error of mismatched CRC, or the compressor specific error if use compression. There is even very small chance (1 of 2**32 or like) that you will silently get incorrectly decrypted data.

It is better to not use the weak encryption in ZIP files. If you need to encrypt data safely, use third-party encryption libraries.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36573>
_______________________________________


More information about the Python-bugs-list mailing list