关于用于压缩文件的免费库的建议 [英] Recommendations on a free library to be used for zipping files
问题描述
我需要对文件进行压缩和密码保护.有没有好的(免费)图书馆?
I need to zip and password-protect a file. Is there a good (free) library for this?
这需要第三方打开,所以密码保护需要使用标准工具.
This needs to be opened by a third party, so the password protection needs to work with standard tools.
推荐答案
UPDATE 2020:现在还有其他选择,特别是 Zip4J.
UPDATE 2020: There are other choices now, notably Zip4J.
经过大量搜索,我找到了三种方法:
After much searching, I've found three approaches:
一组免费提供的源代码,适用于单个文件 zip.但是,没有许可证.用法是 AesZipOutputStream.zipAndEcrypt(...).http://merkert.de/de/info/zipaes/src.zip(https://forums.oracle.com/forums/thread.jspa?threadID=1526137)
A freely available set of source code, suitable for a single file zip. However, there is no license. Usage is AesZipOutputStream.zipAndEcrypt(...). http://merkert.de/de/info/zipaes/src.zip (https://forums.oracle.com/forums/thread.jspa?threadID=1526137)
更新:此代码现已获得 Apache 许可并在 https://github.com/mobsandgeeks/winzipaes(从 Google 代码 的原始主页导出).它对我有用(zip 中有一个文件),并且很好地填补了 Java 开源库中的一个漏洞.
UPDATE: This code is now Apache licensed and released at https://github.com/mobsandgeeks/winzipaes (exported from original home at Google code) . It worked for me (one file in the zip), and fills a hole in Java's opens source libraries nicely.
商业产品(撰写本文时为 500 美元).我无法验证这是否有效,因为他们的试用许可方法很复杂.它也是一个移植的 .NET 应用程序:http://www.nsoftware.com/ipworks/zip/default.aspx
A commercial product ($500 at the time of writing). I can't verify if this works, as their trial license approach is complex. Its also a ported .NET app: http://www.nsoftware.com/ipworks/zip/default.aspx
商业产品(撰写本文时为 290 美元).仅适用于 Wnidows,因为它使用 dll:http://www.example-code.com/java/zip.asp
A commercial product ($290 at the time of writing). Suitable only for Wnidows as it uses a dll: http://www.example-code.com/java/zip.asp
这篇关于关于用于压缩文件的免费库的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!