title: android 6.0 javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT
body: <p>this code works well before android 6.0, <strong>but get an error on 6.0 if encrypted file size less than about 1k bytes.</strong></p>
  
  <pre><code>public static byte[] decode(byte[] decrypteSrcBuffer) throws Exception {
      Key deskey = null;
      DESedeKeySpec spec = new DESedeKeySpec(mKeyBytes);
      SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede");
      deskey = keyfactory.generateSecret(spec);
      Cipher cipher = Cipher.getInstance("desede/CBC/PKCS5Padding");
      IvParameterSpec ips = new IvParameterSpec(iv.getBytes());
      cipher.init(Cipher.DECRYPT_MODE, deskey, ips);
      byte[] decryptData = cipher.doFinal(decrypteSrcBuffer);
  
      return decryptData;
  }
  </code></pre>
  
  <p>Error info:</p>
  
  <pre><code>javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT
  at com.android.org.conscrypt.NativeCrypto.EVP_CipherFinal_ex(Native Method)
  at com.android.org.conscrypt.OpenSSLCipher$EVP_CIPHER.doFinalInternal(OpenSSLCipher.java:568)
  at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:350)
  at javax.crypto.Cipher.doFinal(Cipher.java:2056)
  </code></pre>