TripleDES and Android

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

TripleDES and Android

Postby joaquin » Wed Jul 27, 2011 2:03 pm

Hello, I have problems with this code

Code: Select all
public static byte[] decryptByte(byte[] cryptoByte,
         Context applicationContext) throws IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException, InvalidAlgorithmParameterException, NoSuchPaddingException {
      final SecretKey key = new SecretKeySpec(new UniqueIdentifier(
            applicationContext).getUuidBytes(), "DESede");
      final IvParameterSpec iv = new IvParameterSpec(new byte[8]);

      final Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");

      cipher.init(Cipher.DECRYPT_MODE, key, iv);
      return cipher.doFinal(cryptoByte);

when I call the method doFinal (-----) javax.crypt.BadPaddingException: pad block corrupted !!!

Browsing on google I found the problem is BoucyCastle. Can be true?

Someone can help me?
Posts: 5
Joined: Thu May 19, 2011 4:52 pm


Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 3 guests