Security.addProvider(new com.sun.crypto.provider.SunJCE());
//获得密钥
Key generateKey = new KeyTools().getKey(key.getBytes());
Cipher encryptCipher = Cipher.getInstance("DES");
错误:java.security.NoSuchAlgorithmException: Cannot find any provider supporting
jdk1.5及以上版本正常,jdk1.4就不行,求解!
//获得密钥
Key generateKey = new KeyTools().getKey(key.getBytes());
Cipher encryptCipher = Cipher.getInstance("DES");
错误:java.security.NoSuchAlgorithmException: Cannot find any provider supporting
jdk1.5及以上版本正常,jdk1.4就不行,求解!
下面这个帖子可以参考下:
http://www.blogjava.net/kalman03/archive/2010/01/27/310980.html
然后加密前Security.addProvider(new BouncyCastleProvider());就可以了。