code: private byte[] cipher(byte[] input, int mode)
      {
          try
          {
              return doCipher(input, mode);
          }
          catch (Exception e)
          {
              throw new IllegalStateException(e);
          }
      }
docs: Encrypt or decrypt.