title: Decrypt file on Android encrypted with OpenSSL enc subcommand
body: <p>I have an encrypted file in server using OpenSSL command:</p>
  
  <pre class="lang-none prettyprint-override"><code>openssl enc -aes-256-ecb -salt -in ori.pdf -out encrypted.pdf -pass pass:testpassword -p
  </code></pre>
  
  <p>Below is the key and salt showed after the encryption done:</p>
  
  <pre class="lang-none prettyprint-override"><code>salt=BE1EFCBAE984CB24
  key=50B62ECEF1B777353372A44CDDC463987815F783E39D68B8EE6A0AB74A79C7FA
  </code></pre>
  
  <p>I had tried to decrypt if with below decryption:</p>
  
  <pre class="lang-java prettyprint-override"><code>String key  = "50B62ECEF1B777353372A44CDDC463987815F783E39D68B8EE6A0AB74A79C7FA";
  byte[] keyBytes = key.getBytes("UTF-8");
  SecretKey keySpec = new SecretKeySpec(keyBytes, "AES");
  Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
  cipher.init(Cipher.DECRYPT_MODE, keySpec);
  buffer = cipher.doFinal(buffer);
  </code></pre>
  
  <p>How to decrypt the encrypted file in Android?</p>