简体   繁体   English

Python 的 zipfile 库无法提取受密码保护的文件

[英]Python's zipfile library can't extract password protected file

For some reason, Python's zipfile library cannot extract the files in this password-protected zipfile archive .由于某种原因,Python 的zipfile库无法提取此受密码保护的 zipfile 存档中的文件。 Here is the code I used:这是我使用的代码:

import zipfile

zip_filename = 'extract_public_2018_20201006094007483_71129_20201001-20201006Texas.zip'

zipfile_password = b'&CkN52mKji3R8^4aI#7Z'

with zipfile.ZipFile(zip_filename) as myzip:
    myzip.extractall(pwd=zipfile_password)

This is the error I get: NotImplementedError: That compression method is not supported这是我得到的错误: NotImplementedError: That compression method is not supported

I dug a little deeper and found that the compression method for the files inside this archive is 99. Where can I find what this compression method really is?我挖得更深一点,发现这个档案里面的文件的压缩方法是99。我在哪里可以找到这个压缩方法到底是什么? And does this just mean I can't unzip this file using Python's zipfile librabry?这是否意味着我无法使用 Python 的zipfile文件库解压缩该文件?

I'm using Python 3.8.我正在使用 Python 3.8。

PKWare's appnote says that 99 is: PKWare 的 appnote说 99 是:

99 - AE-x encryption marker (see APPENDIX E) 99 - AE-x 加密标记(见附录 E)

... ...

APPENDIX E - AE-x encryption marker附录 E - AE-x 加密标记


E.1 AE-x defines an alternate password-based encryption method used in ZIP files that is based on a file encryption utility developed by Dr. Brian Gladman. E.1 AE-x 定义了 ZIP 文件中使用的另一种基于密码的加密方法,该方法基于 Brian Gladman 博士开发的文件加密实用程序。 Information on Dr. Gladman's method is available at有关 Gladman 博士方法的信息,请访问

http://www.gladman.me.uk/cryptography_technology/fileencrypt/ http://www.gladman.me.uk/cryptography_technology/fileencrypt/

I'm guessing there are no libraries to help with that.我猜没有图书馆可以帮助解决这个问题。 You're probably stuck using 7z or PKZIP.您可能无法使用 7z 或 PKZIP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何用python创建一个受密码保护的zipfile? - How to create a password protected zipfile with python? 如何在更改名称的同时使用python zipfile库提取文件 - How do I extract a file with the python zipfile library while changing it's name 无法使用 python zipfile 库使用密码解压缩 a.zip 文件 - Unable to unzip a .zip file with a password with python zipfile library Python ZipFile 模块缓慢提取受密码保护的 zip - Python ZipFile module extracts password protected zips slowly 使用python的zipfile模块设置密码 - Setting a password with python's zipfile module Python zipfile:RuntimeError:文件密码错误 - Python zipfile: RuntimeError: Bad password for file ZipFile无法提取包含目录的zip - ZipFile can't extract a zip with directories 为什么 python 无法解压缩由 winrar 使用 zip 方法创建的受密码保护的 zip 文件? - why can't python unzip a password protected zip file created by winrar using the zip method? zipfile.BadZipFile:提取受密码保护的 .zip 和 .zip 时出现错误的 CRC-32 在提取时损坏 - zipfile.BadZipFile: Bad CRC-32 when extracting a password protected .zip & .zip goes corrupt on extract 如何在压缩文件中使用非ASCII文件名,并在Python 2.4中使用ZipFile提取它们? - How can I use non ASCII file names in a zipped file and extract them using ZipFile in Python 2.4?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM