Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Salt for AES for Deterministic Zips #223

Open
Philip-Trettner opened this issue Jul 20, 2024 · 0 comments
Open

Configurable Salt for AES for Deterministic Zips #223

Philip-Trettner opened this issue Jul 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Philip-Trettner
Copy link

I'm building a reproducible/deterministic build/action system and some parts require password protected zip files.

Some builds were not reproducible and I could narrow it down to the password protected zips.

In particular, the AesWriter::new creates a salt using rand::thread_rng() (https://github.com/zip-rs/zip2/blob/master/src/aes.rs#L240).

As far as I understand it, this makes it impossible to have deterministic/reproducible zips with Aes as you cannot seed the thread_rng.

So my feature request for one of the following:

  • add an option to provide a custom Rng
  • add an option to provide a custom Seed
  • add an option to provide a custom Salt
  • add an option to fall back to a fixed Salt
  • or some other option that makes the process deterministic

(I basically need only a single way to get determinism here. The password itself is derived from a build hash, so there is no security implication in my case afaict.)

I'd be happy to make a PR if you're ok with such an option and provide me with a preferred way.

@Philip-Trettner Philip-Trettner added the enhancement New feature or request label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant