来自:http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters

I had asked a question about this earlier, but it didn't get answered right and led nowhere. So I've clarified few details on the problem and I would really like to hear your ideas on how could I fix this or what should I try.

I've Java 1.6.0.12 installed on my Linux server and the code bellow runs just perfectly.

String key = "av45k1pfb024xa3bl359vsb4esortvks74sksr5oy4s5serondry84jsrryuhsr5ys49y5seri5shrdliheuirdygliurguiy5ru";
try {
Cipher c = Cipher.getInstance("ARCFOUR"); SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "ARCFOUR");
c.init(Cipher.DECRYPT_MODE, secretKeySpec); return new String(c.doFinal(Hex.decodeHex(data.toCharArray())), "UTF-8"); } catch (InvalidKeyException e) {
throw new CryptoException(e);
}

Today I installed Java 1.6.0.26 on my server user and when I try to run my application, I get the following exception. My guess would be that it has something to do with the Java installation configuration because it works in the first one, but doesn't work in the later version..

Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at my.package.Something.decode(RC4Decoder.java:25) ~[my.package.jar:na]
... 5 common frames omitted

Line 25 is: c.init(Cipher.DECRYPT_MODE, secretKeySpec);


Most likely you don't have the unlimited strength file installed now.

You may need to download this file:

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 Download

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8 Download

Install the file in ${java.home}/jre/lib/security/.

最新文章

  1. ASP.NET MVC Routing、Areas、URLs
  2. 支持向量机(SVM)相关免费学习视频集锦
  3. css3代码让页面倾斜
  4. 在python包管理中使用easy_install软件的步骤
  5. openStack ceilometer API
  6. java基础之 第一步 :jdk安装配置
  7. c friend -- 友元
  8. java选择排序详解
  9. iOS libyuv
  10. 内存数据网格IMDG简介
  11. Loadrunner Vugen参数列表中数据分配方法及更新值的时间9种组合说明及验证
  12. C++版-剑指offer 面试题6:重建二叉树(Leetcode105. Construct Binary Tree from Preorder and Inorder Traversal) 解题报告
  13. Children’s Queue(hdu1297+递推)
  14. Redis分布式锁(ServiceStack.Redis实现)
  15. echarts Y轴的刻度 跟数据对应---tooltip-formatter
  16. hive数据导入load导入命令
  17. BZOJ1177 [Apio2009]Oil 二维前缀和 二维前缀最值
  18. java虚拟机规范(se8)——java虚拟机结构(五)
  19. Python_oldboy_自动化运维之路_全栈考试(五)
  20. 请给出如下格式的date命令 例:11-02-26.再给出实现按周输出 比如:周六输出为6,请分别给出命令。

热门文章

  1. 使用WITH AS提高性能简化嵌套SQL
  2. 《Head First Servlet JSP》学习笔记二
  3. MQTT V3.1----publish解读
  4. struts2 校验demo
  5. 关于 strcpy 段错误
  6. java学习笔记--IO流
  7. 初识 MySQL 5.6 新功能、参数
  8. SQL删除约束
  9. 【python】入门学习(九)
  10. error C2664: 'TextOutW' : cannot convert parameter 4 from const char [5]' to LPCTSTR