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

ZipWriter with AES password &[u8] #214

Open
nganhkhoa opened this issue Jul 15, 2024 · 1 comment
Open

ZipWriter with AES password &[u8] #214

nganhkhoa opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@nganhkhoa
Copy link

While ZipArchive allows decryption of AES passwords from bytes, ZipWriter with FileOptions only allows for &str password. This behavior is inconsistent, and incomplete. Zip files can be protected using bytes, not only readable (&str) password.

The current implementation already allows for encryption using bytes, we only need to change the interface for FileOptions.

image
@nganhkhoa nganhkhoa added the enhancement New feature or request label Jul 15, 2024
@nganhkhoa
Copy link
Author

The current implementation also adds an unnecessary unsafe to the code through the use of unsafe std::str::from_utf8_unchecked to convert from arbitrary bytes to &str. Not sure if there's any other way around, but support for &[u8] or AsRef<[u8]> is highly recommended.

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