title: Ways to Encrypt and Decrypt pdf files android
body: <p>Hello i am searching free api or some easy code to encrypt and decrypt pdf files. Encryption should be done on downloading file from a stream:</p>
  
  <pre><code>            while ((bufferLength = inputStream.read(buffer)) &gt; 0) {
  
                  /*
                   * Writes bufferLength characters starting at 0 in buffer to the target
                   * 
                   * buffer the non-null character array to write. 0 the index
                   * of the first character in buffer to write. bufferLength the maximum
                   * number of characters to write.
                   */
                  fileOutput.write(buffer, 0, bufferLength);
  
  
              }
  </code></pre>
  
  <p>And decrypt when need to open with pdf reader. Maybe there are some info, code or free Api for this ?
  Someone had done something like this ? </p>
  
  <p>I found myself some code and api. But nothing good for now.</p>
  
  <p>Thanks.</p>