社区
Java SE
帖子详情
NoSuchAlgorithmException
sunrisefe
2006-03-03 10:25:32
Original Exception was java.security.NoSuchAlgorithmException: Cannot find any provider supporting DESedeWrap。
像这种问题我怎么解决,谢谢
...全文
254
2
打赏
收藏
NoSuchAlgorithmException
Original Exception was java.security.NoSuchAlgorithmException: Cannot find any provider supporting DESedeWrap。 像这种问题我怎么解决,谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sunrisefe
2006-03-05
打赏
举报
回复
问题解决了.是因为JDK1.42与我用的apache xml security2.1版本冲突引起的.
kingfish
2006-03-03
打赏
举报
回复
eclipse吗? 命令行编译试试
jsse-2.0.5.jar.zip
java.security.NoSuch
Algorithm
Exception
: SHA1PRNG SecureRandom not available at sun.security.jca.GetInstance.getInstance(GetInstance.java:142) at java.security.SecureRandom.getInstance(SecureRandom.java:254) 分析原因: 这个错误是查询不到SHA算法,这个算法是在jre下面,查询不到就错误了,缺少jsse.jar。 ls -al /usr/java/jdk1.8.0_171-amd64/jre/lib/jss* 处理过程: cd /usr/java/jdk1.8.0_171-amd64/jre/lib unpack200 jsse.pack jsse.jar
jce_policy-8.AES加密版本.zip
Exception
in thread "main" java.security.NoSuch
Algorithm
Exception
: Cannot find any provider supporting AES/ECB/PKCS7Padding https://www.codeprj.com/blog/92cdc41.html
文件加密解密算法(Java源码)
文件加密解密算法(Java源码) java,file,算法,加密解密,java源码 package com.crypto.encrypt; import java.security.SecureRandom; import java.io.*; import javax.crypto.spec.DESKeySpec; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.Cipher; import java.security.InvalidKey
Exception
; import java.security.NoSuch
Algorithm
Exception
; import java.security.spec.InvalidKeySpec
Exception
; import javax.crypto.NoSuchPadding
Exception
; import javax.crypto.BadPadding
Exception
; import javax.crypto.IllegalBlockSize
Exception
; import java.lang.reflect.Constructor; import java.security.spec.KeySpec; import java.lang.reflect.InvocationTarget
Exception
; public class EncryptData { private String keyfile=null; public EncryptData() { } public EncryptData(String keyfile) { this.keyfile=keyfile; } /** * 加密文件 * @param filename String 源路径 * @param filenamekey String 加密后的路径 */ public void createEncryptData(String filename,String filenamekey) throws IllegalState
Exception
, IllegalBlockSize
Exception
, BadPadding
Exception
, NoSuchPadding
Exception
, InvalidKeySpec
Exception
, NoSuch
Algorithm
Exception
, InvalidKey
Exception
, IO
Exception
, Instantiation
Exception
, IllegalAccess
Exception
, IllegalArgument
Exception
, InvocationTarget
Exception
, NoSuchMethod
Exception
, Security
Exception
, ClassNotFound
Exception
, IllegalState
Exception
, IllegalBlockSize
Exception
, BadPadding
Exception
, NoSuchPadding
Exception
, InvalidKeySpec
Exception
, NoSuch
Algorithm
Exception
, InvalidKey
Exception
, IO
Exception
{ //验证keyfile if(keyfile==null || keyfile.equals("")) { throw new NullPointer
Exception
("无效的key文件路径"); } encryptData(filename,filenamekey); } /** * 加密类文件 * @param filename String 原始的类文件 * @param encryptfile String 加密后的类文件 * @throws IO
Exception
* @throws InvalidKey
Exception
* @throws NoSuch
Algorithm
Exception
* @throws InvalidKeySpec
Exception
* @throws NoSuchPadding
Exception
* @throws NoSuch
Algorithm
Exception
* @throws BadPadding
Exception
* @throws IllegalBlockSize
Exception
* @throws IllegalState
Exception
*/ private void encryptData(String filename,String encryptfile) throws IO
Exception
, InvalidKey
Exception
, NoSuch
Algorithm
Exception
, InvalidKeySpec
Exception
, NoSuchPadding
Exception
, NoSuch
Algorithm
Exception
, BadPadding
Exception
, IllegalBlockSize
Exception
, IllegalState
Exception
, ClassNotFound
Exception
, Security
Exception
, NoSuchMethod
Exception
, InvocationTarget
Exception
, IllegalArgument
Exception
, IllegalAccess
Exception
, Instantiation
Exception
{ byte data[]=Util.readFile(filename); // 执行加密操作 byte encryptedClassData[] = getencryptData(data); // 保存加密后的文件,覆盖原有的类文件。 Util.writeFile(encryptedClassData,encryptfile); } /** * 直接获得加密数据 * @param bytes byte[] * @throws IllegalState
Exception
* @throws IllegalBlockSize
Exception
* @throws BadPadding
Exception
* @throws InvalidKey
Exception
* @throws NoSuchPadding
Exception
* @throws InvalidKeySpec
Exception
* @throws NoSuch
Algorithm
Exception
* @throws Instantiation
Exception
* @throws IllegalAccess
Exception
* @throws IllegalArgument
Exception
* @throws InvocationTarget
Exception
* @throws NoSuchMethod
Exception
* @throws Security
Exception
* @throws ClassNotFound
Exception
* @throws IO
Exception
* @return byte[] */ public byte[] createEncryptData(byte[] bytes) throws IllegalState
Exception
, IllegalBlockSize
Exception
, BadPadding
Exception
, InvalidKey
Exception
, NoSuchPadding
Exception
, InvalidKeySpec
Exception
, NoSuch
Algorithm
Exception
, Instantiation
Exception
, IllegalAccess
Exception
, IllegalArgument
Exception
, InvocationTarget
Exception
, NoSuchMethod
Exception
, Security
Exception
, ClassNotFound
Exception
, IO
Exception
{ bytes=getencryptData(bytes); return bytes; } private byte[] getencryptData(byte[] bytes) throws IO
Exception
, ClassNotFound
Exception
, Security
Exception
, NoSuchMethod
Exception
, InvocationTarget
Exception
, IllegalArgument
Exception
, IllegalAccess
Exception
, Instantiation
Exception
, NoSuch
Algorithm
Exception
, InvalidKeySpec
Exception
, NoSuchPadding
Exception
, NoSuch
Algorithm
Exception
, InvalidKey
Exception
, BadPadding
Exception
, IllegalBlockSize
Exception
, IllegalState
Exception
{ // 产生一个可信任的随机数源 SecureRandom sr = new SecureRandom(); //从密钥文件key Filename中得到密钥数据 byte[] rawKeyData = Util.readFile(keyfile); // 从原始密钥数据创建DESKeySpec对象 Class classkeyspec=Class.forName(Util.getValue("keyspec")); Constructor constructor = classkeyspec.getConstructor(new Class[]{byte[].class}); KeySpec dks = (KeySpec) constructor.newInstance(new Object[]{rawKeyData}); // 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(Util.get
Algorithm
()); SecretKey key = keyFactory.generateSecret(dks); // Cipher对象实际完成加密操作 Cipher cipher = Cipher.getInstance(Util.get
Algorithm
()); // 用密钥初始化Cipher对象 cipher.init(Cipher.ENCRYPT_MODE, key, sr); // 执行加密操作 bytes = cipher.doFinal(bytes); // 返回字节数组 return bytes; } /** * 设置key文件路径 * @param keyfile String */ public void setKeyFile(String keyfile) { this.keyfile=keyfile; } }
java中使用MD5加密算法进行加密.pdf
java中使用MD5加密算法进行加密.pdf
android实现视频的加密和解密(使用AES)
本篇文章主要介绍了android实现视频的加密和解密(使用AES),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Java SE
62,624
社区成员
307,257
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章