zipfile cannot read AES encrypted files #53416
Copy link
Copy link
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
| BPO | 9170 |
|---|---|
| Nosy | @birkenfeld, @amauryfa, @pitrou |
| Dependencies | |
| Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2013-10-14.17:40:22.054>
created_at = <Date 2010-07-05.17:42:22.542>
labels = ['type-feature', 'library']
title = 'zipfile cannot read AES encrypted files'
updated_at = <Date 2013-10-14.17:40:22.053>
user = 'https://bugs.python.org/aymill'bugs.python.org fields:
activity = <Date 2013-10-14.17:40:22.053>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2013-10-14.17:40:22.054>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2010-07-05.17:42:22.542>
creator = 'aymill'
dependencies = ['8998']
files = ['17872']
hgrepos = []
issue_num = 9170
keywords = []
message_count = 4.0
messages = ['109342', '109385', '109650', '199933']
nosy_count = 4.0
nosy_names = ['georg.brandl', 'amaury.forgeotdarc', 'pitrou', 'aymill']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue9170'
versions = ['Python 3.2']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Activity
aymill commentedon Jul 5, 2010
On a WinZip AES-256 encrypted zip, zipfile.extractall raises a RuntimeError for "Bad password for file" when given the correct password. Command line example below:
amauryfa commentedon Jul 6, 2010
zipfile only supports the "Traditional PKWARE Encryption" method.
Support for other encryption methods would be useful.
[-]zipfile.extractall raises runtime error on correct password[/-][+]zipfile cannot read AES encrypted files[/+]pitrou commentedon Jul 9, 2010
Do note that providing a patch first requires that encryption/decryption facilities be made available in the stdlib.
(right now we only offer hashing, and "high-level" socket wrapping)
birkenfeld commentedon Oct 14, 2013
bpo-8998 has been closed (among others due to legal concerns), so this need not be kept open.
adiroiban commentedon Jul 17, 2025
Even if
stdlibwill never support WinZIP AES encrpyption, it would be useful to allow for downstream project to implement it.There is pyzipper based on a fork but the code is not very different to what we have in stdlib.
Do you think that we can have something like this in
stdlibto allow extendingA very simple proof of concept downstream code is here that can only read AES ZIP files https://gist.github.com/adiroiban/18dcb49ee3ed755c003c74a4eb85d3a4
It is using this patch for stdblib
Would you consider such a patch ?
Thanks
brianschubert commentedon Jul 17, 2025
@adiroiban for better visibility, I'd suggest opening a discussion on https://discuss.python.org/c/ideas/6 and/or opening a new issue for this specific feature