title: Java encrypt / decrypt via String not working because of padding
body: <p>I have to encode a string using AES/ECB/PKCS5Padding. The encrypted result ( new String(encryptedResult) as they don't want bytes) is then sent to a partner. My partner then decrypt the string using getBytes(). </p>
  
  <p>Here is the decrypting method : </p>
  
  <pre><code>    public static String decrypter(final String donnees) throws NoSuchAlgorithmException, NoSuchPaddingException,
          InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
      Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
      cipher.init(Cipher.DECRYPT_MODE, key);
  
      return new String(cipher.doFinal(donnees.getBytes()));
  }
  </code></pre>
  
  <p>My problem is that I get this error when I try to decrypt : 
  Input Length must be multiple of 16 when decrypting with padded cipher. </p>
  
  <p>When I decode bytes directly it works just fine. How can I make the string.getBytes() not loose padding ? Or any other solutions ? </p>
  
  <p>I cannot change the crypting algorythm, and the same can be said about the string and not bytes beeing sent to the partner. </p>