[issue10876] Zipfile sometimes considers a false password to be correct
Kira Erethon shinjieret...@gmail.com added the comment: Sorry to re-open this, but I consider it an important bug. Tried it in 3.1 also and it's still there. To sum up what's happening, zipfile sometimes considers a false password to be correct and proceeds with decrypting the file. Is there a workaround in this? Or even checking if a file has been decrypted correctly? -- resolution: invalid - status: closed - open title: Zipfile crashes when zip password is set to 610/844/numerous other numbers - Zipfile sometimes considers a false password to be correct ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile sometimes considers a false password to be correct
Changes by Kira Erethon shinjieret...@gmail.com: -- components: +Library (Lib) -Extension Modules ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile sometimes considers a false password to be correct
Antoine Pitrou pit...@free.fr added the comment: As I already explained: * why it doesn't detect that the password is bad is because the ZIP format is not well-designed enough * you can catch the zlib error which indicates that decryption returned junk -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile sometimes considers a false password to be correct
Kira Erethon shinjieret...@gmail.com added the comment: I'm catching all errors and exceptions and zipfile still decompresses it, that's what I've been trying to tell you. I don't face my original problem anymore, I'm catching that exception, now zipfile considers some passwords to be correct and throw no exception, it just decompresses the file (which contains junk since the password was wrong). That's for the second bullet of your message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile sometimes considers a false password to be correct
Antoine Pitrou pit...@free.fr added the comment: I'm catching all errors and exceptions and zipfile still decompresses it, that's what I've been trying to tell you. I don't face my original problem anymore, I'm catching that exception, now zipfile considers some passwords to be correct and throw no exception, it just decompresses the file (which contains junk since the password was wrong). That's for the second bullet of your message. Then I suppose the file(s) inside the zip archive are not compressed, or the compressed contents are miraculously good enough for the zlib not to complain. But, really, unless you have a precise solution to propose, that's nothing Python can do anything about. (of course, if you have an idea about the contents of that zip file, you can devise an application-specific algorithm for validating the contents) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile sometimes considers a false password to be correct
Kira Erethon shinjieret...@gmail.com added the comment: I'm a newbie in python and tried this in order to learn.I created all the zip files (first created a .txt file and zipped it with a password), so I know the file inside the zip is encrypted ( ofc I know the password too). Tried this with different .txt files and file names just in case there was some problem with the naming (didn't use any unicode file names). I'm not really at a level I can propose a solution, only thing I know is that zipfile can decompress the same file with 4 or more passwords without throwing any exception. Of course only one of those passwords is correct. So, bottom line is it's a problem of the zip format and not Python eh? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com