I have my key and the info that I need to decrypt. In my code they both will be accessed or handed off to me as Strings. How in the world do I decrypt it?
//key is my key
//s is the
string I need to decrypt
SecretKey secretKey = keyFactory.generateSecret(key);
Cipher desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
desCipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] cleartext = desCipher.doFinal(s.getBytes());
String ret = new String(cleartext);
Is that anywhere close?