private byte[] aesEncryptBodyInfo(String senderId,
            byte[] plainText, byte[] aesKey, ProcessResult procResult) {
        try {
            SecretKeySpec secretKeySpec = new SecretKeySpec(aesKey, EncryptUtil.AES);
            Cipher cipher = Cipher.getInstance(EncryptUtil.AES);
            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
            return cipher.doFinal(plainText);
        } catch (Throwable ex) {
            procResult.setFailResult(ErrorCode.ENCRYPT_BODY_EXCEPTION, ex.getMessage());
            if (tcpExceptCnt.shouldPrint()) {
                logger.warn("Sender({}) aesEncrypt body exception", senderId, ex);
            }
            return null;
        }
    }
TCP Message Sender class

Used to define the TCP sender common methods
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/tcp/InLongTcpMsgSender.java