IP Library Granted Patent US 11,531,764
Granted Patent B2
US 11,531,764 · App. 16/838,937 · Granted Dec 20, 2022

Assessing operational stability of computer system by integrity checking of computer program

Inventor: Johan Larsson (Malmö, SE)
Assignee: Fossid AB
G06F21/577G06F8/425
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,531,764
App. No.
16/838,937
Granted
Dec 20, 2022
Kind
B2
Abstract

A computer-implemented method for checking the integrity of a target computer program to be executed in a computer system.

Claims (84)

1. A computer-implemented method for checking the integrity of a target computer program to be executed in a computer system the target computer program having a target source code, the method involving:

A) obtaining a plurality of reference source code segments which are considered critical to the integrity of the target computer program;

B) for each reference source code segment in said plurality of reference source code segments:

i) processing the reference source code segment to derive tokens therein and their respective offsets in the segment;

ii) for each n-gram of tokens in the reference source code segment, creating a hash and a list of the offsets of the tokens in the n-gram;

iii) generating a reference hash set for the reference source code segment, the reference hash set comprising the hashes as keys and the respective lists of offsets as values;

C) processing the target source code to derive tokens therein and their respective offsets in the target source code;

D) for each n-gram of tokens in the target source code, creating a hash and a list of the offsets of the tokens in the n-gram;

E) generating a target hash set for the target source code, the target hash set comprising the hashes from step D) as keys and the respective lists of offsets from step D) as values;

F) for each reference source code segment in said plurality of reference source code segments:

i) comparing the hashes in the reference hash set to the hashes in the target hash set to do at least one of the following:

a) calculate a score reflecting a degree of match between the reference hash set and the target hash set; and

b) create a hit list comprising offsets of hashes in the reference hash set that match any of the hashes in the target hash set; and

G) making a decision about the integrity of the target computer program by assessing, based on the calculated score and/or the created hit list of at least one of said plurality of reference source code segments, whether or not, or to what extent, said at least one of said plurality of reference source code segments is included in the target source code.

2. The computer-implemented method as defined in claim 1 , further comprising:

generating a control signal for said computer system to prevent execution of the target computer program if the decision in step G) does not indicate integrity of the target computer program.

3. The computer-implemented method as defined in claim 1 , further comprising:

generating report data based on the decision made in step G), wherein the report data reflects the decision and at least one of:

the calculated score, and

an indication of said at least one of said plurality of reference source code segments; and

sending or presenting the generated report data to at least one of:

an operator of said computer system, and

a developer of said target source code.

4. The computer-implemented method as defined in claim 1 , wherein step F) further involves:

c) sorting the hit list based on offset.

5. The computer-implemented method as defined in claim 4 , wherein step F) further involves:

d) removing duplicate offsets from the hit list.

6. The computer-implemented method as defined in claim 4 , wherein step G) involves:

determining whether the hit list is consecutive; and

concluding that a particular reference source code segment, for which it has been determined that the hit list is consecutive, is indeed included in the target source code.

7. The computer-implemented method as defined in claim 4 , wherein step G) involves:

determining to what extent the hit list is consecutive by establishing a length of a longest consecutive subset of the hit list; and

concluding that a particular reference source code segment, for which the determining yielded a longest consecutive subset having a length which is above a threshold percentage of the full length of the hit list, is indeed included in the target source code.

8. The computer-implemented method as defined in claim 1 , wherein the plurality of reference source code segments obtained in step A) contain source code that define critical functions representing key parts of the functionality to be performed by the computer system when the target computer program is executed.

9. The computer-implemented method as defined in claim 1 , wherein the plurality of reference source code segments obtained in step A) contain technical background information for future use in modification or development of the target source code.

10. The computer-implemented method as defined in claim 1 , wherein the plurality of reference source code segments obtained in step A) contain license statements or copyright notices about the right to use the target source code or respective parts thereof.

11. The computer-implemented method as defined in claim 1 , further comprising:

determining a size of the target source code, or a size of the target hash set generated for the target source code;

determining a size of a particular reference source code segment in said plurality of reference source code segments, or a size of the reference hash set generated for said particular reference source code segment; and

if the determined size of the particular reference source code segment or the reference hash set exceeds the determined size of the target source code or the target hash set by a certain margin:

deciding that the particular reference source code segment is not included in the target source code; and

G) making a negative decision about the integrity of the target computer program.

12. An apparatus for checking the integrity of a target computer program to be executed in a computer system, the target computer program having a target source code, the apparatus comprising a computer processing device configured with instructions for:

A) obtaining a plurality of reference source code segments which are considered critical to the integrity of the target computer program;

B) for each reference source code segment in said plurality of reference source code segments:

i) processing the reference source code segment to derive tokens therein and their respective offsets in the segment;

ii) for each n-gram of tokens in the reference source code segment, creating a hash and a list of the offsets of the tokens in the n-gram;

iii) generating a reference hash set for the reference source code segment, the reference hash set comprising the hashes as keys and the respective lists of offsets as values;

C) processing the target source code to derive tokens therein and their respective offsets in the target source code;

D) for each n-gram of tokens in the target source code, creating a hash and a list of the offsets of the tokens in the n-gram;

E) generating a target hash set for the target source code, the target hash set comprising the hashes from step D) as keys and the respective lists of offsets from step D) as values;

F) for each reference source code segment in said plurality of reference source code segments:

i) comparing the hashes in the reference hash set to the hashes in the target hash set to do at least one of the following:

a) calculate a score reflecting a degree of match between the reference hash set and the target hash set; and

b) create a hit list comprising offsets of hashes in the reference hash set that match any of the hashes in the target hash set; and

G) making a decision about the integrity of the target computer program by assessing, based on the calculated score and/or the created hit list of at least one of said plurality of reference source code segments, whether or not, or to what extent, said at least one of said plurality of reference source code segments is included in the target source code.

13. The apparatus as defined in claim 12 , wherein the processing device is further configured for:

generating a control signal for said computer system to prevent execution of the target computer program if the decision in G) does not indicate integrity of the target computer program.

14. The apparatus as defined in claim 12 , wherein the processing device is further configured for:

generating report data based on the decision made in G), wherein the report data reflects the decision and at least one of:

the calculated score, and

an indication of said at least one of said plurality of reference source code segments; and

sending or presenting the generated report data to at least one of:

an operator of said computer system, and

a developer of said target source code.

15. The apparatus as defined in claim 12 , wherein the processing device is further configured for performing F) by:

c) sorting the hit list based on offset.

16. The apparatus as defined in claim 15 , wherein the processing device is further configured for performing F) by:

d) removing duplicate offsets from the hit list.

17. The apparatus as defined in claim 15 , wherein the processing device is further configured for performing G) by:

determining whether the hit list is consecutive; and

concluding that a particular reference source code segment, for which it has been determined that the hit list is consecutive, is indeed included in the target source code.

18. The apparatus as defined in claim 15 , wherein the processing device is further configured for performing G) by:

determining to what extent the hit list is consecutive by establishing a length of a longest consecutive subset of the hit list; and

concluding that a particular reference source code segment, for which the determining yielded a longest consecutive subset having a length which is above a threshold percentage of the full length of the hit list, is indeed included in the target source code.

19. The apparatus as defined in claim 12 , wherein the plurality of reference source code segments obtained in A) contain source code that define critical functions representing key parts of the functionality to be performed by the computer system when the target computer program is executed.

20. The apparatus as defined in claim 12 , wherein the plurality of reference source code segments obtained in A) contain technical background information for future use in modification or development of the target source code.

21. The apparatus as defined in claim 12 , wherein the plurality of reference source code segments obtained in A) contain license statements or copyright notices about the right to use the target source code or respective parts thereof.

22. The apparatus as defined in claim 12 , wherein the processing device is further configured for:

determining a size of the target source code, or a size of the target hash set generated for the target source code;

determining a size of a particular reference source code segment in said plurality of reference source code segments, or a size of the reference hash set generated for said particular reference source code segment; and

if the determined size of the particular reference source code segment or the reference hash set exceeds the determined size of the target source code or the target hash set by a certain margin:

deciding that the particular reference source code segment is not included in the target source code; and

G′) making a negative decision about the integrity of the target computer program.

Assignments (2)
CHANGE OF NAME Recorded Feb 16, 2023
From: FOSSID AB
To: SNYK SWEDEN AB
Reel/Frame 062776/0982 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 1, 2020
From: LARSSON, JOHAN
To: FOSSID AB
Reel/Frame 053117/0099 →
Priority Claims (1)
EP 20157491 · Feb 14, 2020 · regional
Continuity (1)
Related Publication 20210256136A1 · Aug 19, 2021