title: Getting BadPaddingException due to byte[] too long to decipher
body: <p>The following code is tested for short strings, in that case it decrypts the string nicely.</p>
  <pre><code>byte[] ciphertext = Base64.decode(myverylongstring,Base64.DEFAULT);
  SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(Charset.forName(&quot;UTF-8&quot;)), &quot;AES&quot;);
  IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes(Charset.forName(&quot;UTF-8&quot;)));
  Cipher cipher = Cipher.getInstance(&quot;AES/CBC/PKCS5Padding&quot;);
  cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec);
  
  byte[] decryptedtextByte = cipher.doFinal(ciphertext);
  String decryptedtext = new String(decryptedtextByte); //Successfully decrypts the string
  System.out.println(&quot;decryptedtext: &quot; + decryptedtext);
  [...]
  } catch (BadPaddingException e) {
          e.printStackTrace();
  }
  </code></pre>
  <p>But if the string is too large I get fired the exception I mention.</p>
  <p>What could I do so it decrypts the string correctly maintaining the same large string to decrypt?</p>
  <p>Edit, well technically what's decrypted is a byte[], changing title and adding code to not cause possible confussion.</p>