code: public byte[] encrypt(byte[] iv, byte[] data) throws IntegrityException {
          if (data.length % blockSize != 0) {
              throw new IntegrityException("Incorrect data size");
          }
          if (iv.length != blockSize) {
              throw new IntegrityException("Incorrect iv size");
          }
  
          byte[] res = new byte[data.length];
          encrypt(iv, data, res);
          return res;
      }
docs: Encrypting data
  
  @param iv   initialization vector
  @param data data for encryption
  @return encrypted data