Skip to content

Support password-protected zip files#1

Open
pathawks wants to merge 4 commits intomainfrom
zip-password
Open

Support password-protected zip files#1
pathawks wants to merge 4 commits intomainfrom
zip-password

Conversation

@pathawks
Copy link
Copy Markdown
Owner

@pathawks pathawks commented Apr 5, 2026

Add --password flag (repeatable) to try passwords on encrypted zip members. Enable AES encryption support in the zip crate. Track the successful password in CandidateSource and emit it in GEX Python output.

Add --password flag (repeatable) to try passwords on encrypted zip
members. Enable AES encryption support in the zip crate. Track the
successful password in CandidateSource and emit it in GEX Python output.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for password-protected ZIP inputs by introducing a repeatable --password CLI flag, enabling AES support in the Rust zip crate, and propagating the successfully used password through CandidateSource so it can be emitted in generated GEX Python tasks.

Changes:

  • Add --password (repeatable) and thread provided passwords into candidate loading.
  • Attempt decryption of encrypted ZIP members using supplied passwords and record the successful password in CandidateSource::Zip.
  • Update GEX task generation to pass pwd=... when opening ZIP members; enable zip crate AES feature and update dependency versions.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils.rs Adds password-aware ZIP member extraction and updates candidate loading API.
src/types.rs Extends CandidateSource::Zip to optionally store the password used.
src/main.rs Adds --password flag and passes passwords into candidate loading.
src/gex.rs Emits ZIP open calls with pwd= when a password is known.
src/pipeline.rs Suppresses clippy warning for run_pipeline argument count.
Cargo.toml Enables AES feature in zip crate and bumps clap minor version.
Cargo.lock Locks updated dependency graph for AES/zip/clap changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pathawks added 2 commits April 4, 2026 21:43
Use deflate-flate2 instead of deflate for the zip crate to avoid
pulling in zopfli (compression) when we only need decompression.
Replace sha1_smol with sha1, which is already a transitive dependency.
Propagate errors from by_index_raw instead of silently swallowing them.
Distinguish wrong-password errors from real I/O failures when decrypting
zip members, accounting for AES HMAC validation at end-of-stream.
Update doc comment and note Python zipfile AES limitation in GEX output.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add --password-file option to avoid exposing passwords in ps output and
shell history. Emit AES limitation note into generated Python output
instead of only as a Rust source comment. Deduplicate candidate
construction between encrypted and unencrypted zip branches. Add tests
for plain zip extraction, correct/wrong/missing password handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants