[英]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.