简体   繁体   English

如何检查 7z 文件的加密?

[英]How to check for an encrption for a 7z file?

I need to check a 7z file for encryption.我需要检查一个 7z 文件进行加密。

I am using sevenzipjbind and using the property ENCRYPTED, but it seems it involves a lot more steps after that which I am not able to certain.我正在使用 Sevenzipjbind 并使用 ENCRYPTED 属性,但似乎在此之后涉及更多我无法确定的步骤。

You can use commons-compress which supports reading encrypted 7zip archives.您可以使用支持读取加密的 7zip 档案的commons-compress From the official website :来自 官方网站

The ar, arj, cpio, dump, tar, 7z and zip formats are supported as archivers where the zip implementation provides capabilities that go beyond the features found in java.util.zip. ar、arj、cpio、dump、tar、7z 和 zip 格式被支持作为存档器,其中 zip 实现提供的功能超出了 java.util.zip 中的功能。 As of Commons Compress 1.18 support for the dump and arj formats is read-only - 7z can read most compressed and encrypted archives but only write unencrypted ones.从 Commons Compress 1.18 开始,对 dump 和 arj 格式的支持是只读的——7z 可以读取大多数压缩和加密的档案,但只能写入未加密的档案。 LZMA(2) support in 7z requires XZ for Java as well. 7z 中的 LZMA(2) 支持也需要 XZ for Java。

Take a look at SevenZFile class to see if you can use it.看看SevenZFile类,看看你是否可以使用它。 Internally SevenZFile reads archive header to check the password . SevenZFile内部读取存档头以检查密码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM