public static int maskData(StringBuilder builder, char maskChar, int startPos, int buffLength) {
        int charPos = startPos;
        if (charPos + 5 > buffLength) {
            return startPos;
        }

        Character character = builder.charAt(charPos);
        if (isKeyWorkdStart(character)) {
            int keywordStart = 0;
            int keywordLength = 0;
            String keywordUsed = null;
            for (String keyword : KEYWORDS) {
                keywordStart = StringUtils.indexOfIgnoreCase(builder, keyword, charPos);
                if (keywordStartAtRightPosition(keywordStart, charPos)) {
                    keywordLength = keyword.length();
                    keywordUsed = keyword;
                    break;
                }
            }

            if (keywordStart != startPos && keywordStart != startPos + 1) {
                return startPos;
            }

            int idxSeparator;
            for (String separator : SEPARATORS) {
                idxSeparator = StringUtils.indexOf(builder, separator, keywordStart + keywordLength);
                int delimiterPos = keywordStart + keywordLength;
                while (delimiterPos < buffLength && isDelimiter(builder.charAt(delimiterPos))) {
                    delimiterPos++;
                }
                if (delimiterPos == idxSeparator) {
                    charPos = maskStartPosition(idxSeparator, separator, builder);

                    int endPos = detectEnd(builder, buffLength, charPos, keywordUsed, keywordLength, separator);

                    if (endPos > charPos) {
                        return mask(builder, maskChar, charPos, endPos);
                    }
                }
            }
        }

        return startPos;
    }
mask data from specified start position of raw data

@param builder raw data
@param maskChar specified character for replace sensitive data
@param startPos the start position of raw data
@param buffLength the length of raw data
@return the start position of first masked data
inlong-common/src/main/java/org/apache/inlong/common/util/MaskDataUtils.java