简体   繁体   English

如何使用Bouncy Castle和Java解密secureZip加密文件?

[英]How to decrypt secureZip encrypted files using Bouncy Castle and java?

We have to automatically send/receive zipped + encrypted hundreds of files per day to/from another company and they desire to use SecureZip by PKWARE at their side for this task. 我们每天必须自动向另一家公司发送/从另一家公司接收压缩+加密的数百个文件,他们希望在其身边使用PKWARE的SecureZip。

On our side our application is pure Java. 在我们这方面,我们的应用程序是纯Java。 We are using Bouncy Castle (BC) library to try to unzip + decrypt. 我们正在使用Bouncy Castle(BC)库来尝试解压缩和解密。

We provided the other company our RSA public key (.cer). 我们为另一家公司提供了RSA公钥(.cer)。

They have used our public key to encrypt a test file they sent to us. 他们使用我们的公钥加密了发送给我们的测试文件。

They selected AES 256 as symmetric algorithm, together to our RSA public key to encrypt the test file. 他们选择了AES 256作为对称算法,并选择了我们的RSA公钥来加密测试文件。 They used this command: 他们使用了以下命令:

pkzipc -add -dir=current -recipient="our_public_key" -keypassphrase="password" test.zip example.xml

So, the short question: will BC lib be able to decrypt the test zip file encrypted by SecureZIP and our cert? 因此,简短的问题是:BC lib是否能够解密由SecureZIP和我们的证书加密的测试zip文件? Or do we have to license SecureZIP for our part necessarily? 还是我们必须为自己的部分许可SecureZIP?

Any other tool or solution featuring files zip compression + encryption by certs which can be decrypted using BC? 还有其他具有zip压缩文件+证书加密功能的工具或解决方案,可以使用BC解密吗?

And if file decryption using BC should be possible, the long question: how exactly? 如果使用BC进行文件解密应该可行,那么一个漫长的问题是:究竟是什么? Please post a java example (full if possible). 请发布一个Java示例(如果可能,请完整显示)。

Thanks in advance. 提前致谢。

While the .zip format supports encryption, those does not involve certificates. 尽管.zip格式支持加密,但这些不涉及证书。

So I think PKWARE might be using a proprietary file format. 因此,我认为PKWARE可能正在使用专有文件格式。 They could be just throwing a OpenPGP on top of a ZIP file, or they could be encrypting the files before zipping. 他们可能只是将OpenPGP扔在ZIP文件的顶部,或者可能在压缩之前对文件进行了加密。

They have a free reader available: https://www.pkware.com/zip-reader 他们有一个免费的阅读器: https : //www.pkware.com/zip-reader

So perhaps you should just use that instead. 因此,也许您应该只使用它。

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

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