code: String encrypt(String randomStr, String text) throws AesException {
          ByteGroup byteCollector = new ByteGroup();
          byte[] randomStrBytes = randomStr.getBytes(CHARSET);
          byte[] textBytes = text.getBytes(CHARSET);
          byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length);
          byte[] appidBytes = appId.getBytes(CHARSET);
  
          // randomStr + networkBytesOrder + text + appid
          byteCollector.addBytes(randomStrBytes);
          byteCollector.addBytes(networkBytesOrder);
          byteCollector.addBytes(textBytes);
          byteCollector.addBytes(appidBytes);
  
          // ... + pad: 使用自定义的填充方式对明文进行补位填充
          byte[] padBytes = PKCS7Encoder.encode(byteCollector.size());
          byteCollector.addBytes(padBytes);
  
          // 获得最终的字节流, 未加密
          byte[] unencrypted = byteCollector.toBytes();
  
          try {
              // 设置加密模式为AES的CBC模式
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES");
              IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16);
              cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv);
  
              // 加密
              byte[] encrypted = cipher.doFinal(unencrypted);
  
              // 使用BASE64对加密后的字符串进行编码
              String base64Encrypted = base64.encodeToString(encrypted);
  
              return base64Encrypted;
          } catch (Exception e) {
              e.printStackTrace();
              throw new AesException(AesException.EncryptAESError);
          }
      }
docs: 对明文进行加密.
  
  @param text 需要加密的明文
  @return 加密后base64编码的字符串
  @throws AesException aes加密失败