I used the following code to decrypt an encrypted String
public String decrypt(String decryptMe) throws Exception {
if (decryptMe == null) {
return null;
} else {
Cipher cipher = Cipher.getInstance("AES");
cipher.init(2, this.getKeySpec());
return new String(cipher.doFinal((new BASE64Decoder()).decodeBuffer(decryptMe)));
}
}
While I run the code locally and deployed it on my local tomcat server, it displays the correct French characters (i.e. ÉPERVIÈRES). But when I deploy the code on tc-server running in Linux box, it doesn't display the correct characters (??PERVI??RES). Is there any problem with my decrypt method?