public static String cbcEncrypt(final String secretKeyStr, final String ivStr, final String data) {
        Security.addProvider(new BouncyCastleProvider());
        String encryptStr;
        byte[] secretKeyBytes = secretKeyStr.getBytes(StandardCharsets.UTF_8);
        byte[] ivBytes = ivStr.getBytes(StandardCharsets.UTF_8);
        try {
            SecretKey secretKey = new SecretKeySpec(secretKeyBytes, "AES");
            Cipher cipher = Cipher.getInstance("AES/CBC/Pkcs7Padding");
            IvParameterSpec ivParameterSpec = new IvParameterSpec(ivBytes);
            cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);
            byte[] encryptedBytes = cipher.doFinal(data.getBytes());
            encryptStr = Base64.getEncoder().encodeToString(encryptedBytes);
        } catch (Exception e) {
            LOG.error("aes encrypt fail. cause:{}", e.getMessage());
            throw new ShenyuException(e);
        }
        return encryptStr;
    }
AES/CBC/Pkcs7Padding encrypt data.

@param secretKeyStr secretKeyStr
@param ivStr        ivStr
@param data         data
@return cbcEncrypt str.
shenyu-common/src/main/java/org/apache/shenyu/common/utils/AesUtils.java