Unzip with password
I found the lna for unzipping with python.. but I need to do it with a password.
I tried
zip_ref.extractall(path,pwd='test') but it tells me bad password for file
i know its test since i can manually unzip with that password
-
The syntax you are using above is correct. It will work for zip files that are encrypted using CRC32 (PKWARE) encryption. However, the Python zipfile module does not support AES-265 encryption (see the 'won't fix' closed bug report here).
This post provides a couple of examples that could be used but they require 3rd party dependencies:
https://stackoverflow.com/questions/15553150/python-unzip-aes-128-encrypted-file
-
I just tried it and it worked for me:
See the attached example data and data flow.
Attached files
Archive_Compress_Invoices_Pwd_is_test.zip
Extract Zipped Files_342 - 29 Jan 2020.lna
Please sign in to leave a comment.
Comments
6 comments