Malicious File Detection via N-gram Sequence Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing security software requires exact matches with known malicious files to detect and prevent malicious file execution, which is ineffective for files that differ in multiple respects from known threats, and consumes significant processing resources.

Innovation Solution

The method involves extracting sequential data from files, generating n-grams, creating a vector of weights based on frequency analysis, and using statistical analysis or machine learning models to determine the likelihood of a file being malicious, allowing for proactive corrective actions without prior knowledge of the file.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If exact match comparison with known malicious files is used, then detection reliability is improved, but adaptability to new or modified malicious files deteriorates

Engineering Contradiction:
Improvedetection reliabilityVSAvoidadaptability to new malicious files
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent transforms the detection approach by changing the parameters from exact file matching to n-gram sequence analysis. Instead of comparing entire files for exact matches, the system extracts sequential data (opcodes, bytes, or characters) and analyzes n-gram patterns. This parameter change enables the system to detect malicious files based on characteristic sequences while tolerating variations in non-critical portions, thereby maintaining detection reliability while improving adaptability to new or modified threats.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent segments the malicious file detection problem into discrete sequential elements (n-grams of opcodes, bytes, or characters). By dividing the file into overlapping sequences of n elements, the system can identify characteristic patterns without requiring exact whole-file matches. This segmentation allows the detection system to focus on critical sequential patterns while being tolerant of variations in other parts of the file.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If comprehensive file analysis is performed to improve detection accuracy, then detection precision is improved, but processing resource consumption increases

Engineering Contradiction:
Improvedetection precisionVSAvoidprocessing resource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent extracts only the essential sequential data from files that is necessary for detection purposes. Instead of analyzing entire files or performing comprehensive scans, the system extracts sequential data (opcodes, bytes, or characters) and generates n-grams from these extracted elements. This extraction approach maintains high detection precision by focusing on characteristic patterns while significantly reducing processing resource consumption by avoiding analysis of redundant file portions.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by analyzing only the sequential patterns necessary for detection rather than performing complete file analysis. By generating n-grams from extracted sequential data and comparing these patterns against known malicious signatures, the system achieves sufficient detection precision without the excessive resource consumption of comprehensive file scanning. The approach performs just enough analysis to identify malicious patterns while avoiding unnecessary processing.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20240378291A1Protecting devices from malicious files based on n-gram processing of sequential data
Publication Date: 2024.11.14 CYLANCE INC
  • US20240378291A1 patent drawing
  • US20240378291A1 patent drawing
  • US20240378291A1 patent drawing

AI summary

Under one aspect, a method is provided for protecting a device from a malicious file. The method can be implemented by one or more data processors forming part of at least one computing device and can include extracting from the file, by at least one data processor, sequential data comprising discrete tokens. The method also can include generating, by at least one data processor, n-grams of the discrete tokens. The method also can include generating, by at least one data processor, a vector of weights based on respective frequencies of the n-grams. The method also can include determining, by at least one data processor and based on a statistical analysis of the vector of weights, that the file is likely to be malicious. The method also can include initiating, by at least one data processor and responsive to determining that the file is likely to be malicious, a corrective action.