I am developing a BlackBerry application where the server is in Java. Whenever AES encrypted data is sent to server along with PKCS5 Formatting,The server gets bad padding exception while decrypting it.
I am developing a BlackBerry application where the server is in Java. Whenever AES
Share
Is that the Blackberry or the server code? Have you tried using the standard JCE classes? something like this:
Cipher aes = Cipher.getInstance("AES/ECB/PKCS5Padding"); SecretKeySpec key = new SecretKeySpec(yourKeyBytes, "AES"); aes.init(Cipher.DECRYPT_MODE, key); byte[] cleartext = aes.update(ciphertext, 0, ciphertext.length);