Hello everybody,
I'm developing my program and I need to send over network encrypted data. I can do this but when I call method responsible for decrypting I receive null. It seems that there's something missing in my code and I don't know what.Let me show you my code:
public String decrypt(String text) {
try {
encrypted = new sun.misc.BASE64Decoder().decodeBuffer(text);
this.text = decrypter.doFinal(encrypted);
return new String(this.text, "UTF8");
} catch (javax.crypto.BadPaddingException e) {
} catch (IllegalBlockSizeException e) {
} catch (UnsupportedEncodingException e) {
} catch (java.io.IOException e) {
}
return null;
}