"Cannot find any provider supporting DES/ECB/PKCS5Padding." This error is appearing when Cipher.getInstance is executed. I can not figure out why. I have looked to make sure javax.crypto.Cipher is listed. It is.
package com.aig.security;
import java.security.*;
import java.io.*;
import javax.crypto.*;
import javax.crypto.Cipher;
import sun.misc.*;
import java.util.*;
import java.sql.*;
public class Decrypt{
public
String getDecryptedString(String input)throws DecryptError
{
try {
Security.addProvider( new com.sun.crypto.provider.SunJCE() );
Key key = null;
FileInputStream in = new FileInputStream("CONFIG/Key.dat");
ObjectInputStream s = new ObjectInputStream(in);
key = (Key)s.readObject();
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, key);
BASE64Decoder decoder = new BASE64Decoder();
byte[] out = decoder.decodeBuffer(input);
//Decode
byte[] outputBytes = cipher.doFinal(out);
return new String(outputBytes);
}
catch (Exception e)
{
throw new DecryptError(e.getMessage());
}
}
}//end Decrypt class