code: public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException {
          setEncryption(DocWriter.getISOBytes(userPassword), DocWriter.getISOBytes(ownerPassword), permissions, strength);
      }
docs: Sets the encryption options for this document. The userPassword and the
  ownerPassword can be null or have zero length. In this case the ownerPassword
  is replaced by a random string. The open permissions for the document can be
  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
  The permissions can be combined by ORing them.
  @param strength <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length
  @param userPassword the user password. Can be null or empty
  @param ownerPassword the owner password. Can be null or empty
  @param permissions the user permissions
  @throws DocumentException if anything was already written to the output