101arrowz / fflate

High performance (de)compression in an 8kB package
https://101arrowz.github.io/fflate
MIT License
2.27k stars 79 forks source link

Add support for passworded zip files #90

Closed apeter10 closed 3 years ago

apeter10 commented 3 years ago

This project is awesome, it is the fast ,small and support ES module.

I want to know do you have any plans to support passworded zip files?

101arrowz commented 3 years ago

This was discussed before and my conclusion is that fflate is not really designed in a way that would enable passwords effectively.

First thing to consider: there are two types of encryption for ZIP files: ZipCrypto and AES-256. ZipCrypto is quite frankly awful for security but is the only form of password that most ZIP utilities support. AES-256 is excellent security wise but is hard to implement efficiently and doesn't have good support from built-in ZIP utilities (though it works with 7zip and WinRAR).

I would recommend not encrypting ZIP files at all because you can only get bad decompression support with AES or terrible security with ZipCrypto. If you absolutely need it, check out zip.js, which supports both AES and ZipCrypto and can be used with fflate as the compression backend for excellent performance.