Data360 Analyze

 View Only
  • 1.  Unzip with password

    Posted 01-24-2020 14:54

    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

     



  • 2.  RE: Unzip with password

    Employee
    Posted 01-27-2020 05:50

    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

     

     



  • 3.  RE: Unzip with password

    Posted 01-27-2020 10:42

    so can the Archive Node use CRC32? or....no?

    an Unzip node would be handy... ;)



  • 4.  RE: Unzip with password

    Employee
    Posted 01-29-2020 09:36

    The Archive Compress node can create an archive with encrypted files that use the standard CRC32/PKWare/ZIP encryption mechanism.



  • 5.  RE: Unzip with password

    Posted 01-29-2020 09:39

    I tired setting it to Standard, but the unzip python code still had the same error..



  • 6.  RE: Unzip with password

    Employee
    Posted 01-29-2020 10:28

    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

     



  • 7.  RE: Unzip with password

    Employee
    Posted 01-29-2020 10:29

    The password on the zip file is test