title: Java Cipher - AES Padding Problem
body: <p>I am using a AES cipher with a 16 byte block size. </p>
  
  <p>If I try and encrypt a 16 byte string I have no problems, but any other length not a multiple of 16 is throwing an exception. </p>
  
  <p>I know with 3-DES you can specify a padding type as part of the algorithm and it's handled with no extra work (e.g. DES/CBC/PKCS5Padding), but is there a way to specify this with AES? </p>
  
  <p>Or do I need to pad the pytes manually to a multiple of 16, and then strip them when I decrypt? Here is an abbreviated code sample. </p>
  
  <pre><code>encrypt = Cipher.getInstance("AES", provider);
  encrypt.init(Cipher.ENCRYPT_MODE, key) ;
  byte[] encrypted = encrypt.doFinal(plainTxt.getBytes()) ;
  </code></pre>
  
  <p>Any and all replies appreciated! </p>
  
  <p>Thanks in advance,
  Ciarán</p>