mholt / archiver

DEPRECATED. Please use mholt/archives instead.
https://github.com/mholt/archives
MIT License
4.45k stars 392 forks source link

Encryption and decryption #432

Open DylanZhu2021 opened 6 days ago

DylanZhu2021 commented 6 days ago

What would you like to have changed?

I would like to request support for encrypting and decrypting common archive formats such as ZIP, RAR, and others in this project. This feature would include the ability to compress files with password protection and to extract encrypted archives.

Why is this feature a useful, necessary, and/or important addition to this project?

Many users handle sensitive data that requires secure compression and storage. Adding support for encryption would make this project more versatile and useful in real-world scenarios where data security is a priority. Additionally, decrypting encrypted archives is a common use case that many users encounter. Currently, the absence of this feature limits the usability of the project for these scenarios.

What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?

In the absence of built-in support, I’ve had to rely on external tools such as zip and unrar command-line utilities or other libraries. However, integrating this functionality directly into this project would streamline workflows and provide a more cohesive experience for users.

Please link to any relevant issues, pull requests, or other discussions.

I couldn't find any existing issues or discussions directly related to this feature request, but I believe it would align well with the goals of this project. If there are plans or ongoing work in this area, I would love to know more about them and always ready to help build this project.

mholt commented 6 days ago

Thanks for the feature request.

7Zip and RAR formats already support decryption. (Specify a Password in their structs.) They don't support encryption because they don't support creating archives. 7Zip because there's no pure Go implementation yet (that I know of) and RAR because it's a proprietary format.

I don't know of any pure Go implementation for encrypted ZIP files.

Unfortunately as I don't have time to implement this myself, we will have to wait for a contribution / someone to do it.