java - 将 Java Cryptography Extension Unlimited Strength 添加到我的可执行文件中或自动安装

标签 java cryptography

我的程序是一个使用 256 key 长度的 simetric crypter。当我在未安装 JCE 的计算机上使用它(没有 key 长度)时,它崩溃并出现以下错误:

java.security.InvalidKeyException: Illegal key size or default parameters

这是因为计算机没有允许使用此 key 大小的扩展。

有没有办法将java无限强度扩展与我的程序一起使用而无需安装?或者我可以打开一个对话框来自动安装它吗?

另一方面,有更好的解决方案来使用 256 key 进行 AES 加密吗?也许另一个 API 允许我在不添加任何扩展的情况下做到这一点? (如充气城堡)。

最佳答案

JCE Unlimited Strength可以从Oracle网站下载。 (或者至少,我可以在澳大利亚下载它。)

但是,您首先需要同意 Oracle Binary Code Licende for Java ,第 7 条这样说:

"7. EXPORT REGULATIONS. You agree that U.S. export control laws and other applicable export and import laws govern your use of the Software, including technical data; additional information can be found on Oracle's Global Trade Compliance web site (http://www.oracle.com/us/products/export). You agree that neither the Software nor any direct product thereof will be exported, directly, or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation."


回答您关于 JCE 的问题

Is there any way to put the java unlimited strength extension with my program for use it without install?

我不是律师,但我认为 Oracle 许可证规定,如果您的使用符合美国导出法,您只能使用 JCE 代码(包括在您的产品中分发它)。请注意,加密软件受到特别限制。

Or can I open a dialog for install it automatically?

这在法律上和技术上都尚不清楚。


Maybe another API allows me to do it without adding any extension? (like bouncy castle).

Bouncy CaSTLe 也受美国导出法管辖。此外,在 Bouncy Castle FAQs ,常见问题解答 #1 表示 Bouncy CaSTLe 的 Java SE 兼容加密提供的 key 长度由 JCE 使用的相同机制(和策略文件)控制。然而常见问题解答 #10 说:

"At the time of writing (16 May 2007) Bouncy Castle is approved classified under ECCN code 5D002 and approved for export under License Exception TSU."


我还查找了“许可证异常(exception) TSU”,发现它是在 Exceptions to the Export Administration Regulations (EAR) 中定义的。如:

"§ 740.13 TECHNOLOGY AND SOFTWARE UNRESTRICTED (TSU)

This license exception authorizes exports and reexports of operation technology and software; sales technology and software; software updates (bug fixes); “mass market” software subject to the General Software Note; and encryption source code (and corresponding object code) that would be considered publicly available under §734.3(b)(3) of the EAR."

等等。

它看起来很有前途,特别是对于开源产品来说,但我仍然建议向真正的专家寻求建议;即接受过适当法律培训的专业人员。

关于java - 将 Java Cryptography Extension Unlimited Strength 添加到我的可执行文件中或自动安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29653047/

相关文章:

javascript - WebCrypto API 在哪里存储 key ?

c++ - openssl 与 Windows capi

java - 我们如何创建一个包含 2 个不同元素的列表 - 从 mongodb 到 java

java - Spring Boot 异常处理程序不捕获异常

java - java方法如何在调用之前抛出异常

java - 在 pom.xml 中包含 jar

java:使用字符集读取大文件

javascript - 创建 C# 256 位 AES 加密,如 cryptoJS

c - 在 C 中使用 crypt 进行简单密码比较

cryptography - 为什么 Google、Facebook 等网站使用公钥加密技术(这些网站中需要对数据进行编码)?