# US 10,481,905 B2 · Method, apparatus and system for verifying code integrity on clients

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,481,905 B2
- Document ID: US10481905B2
- Status: Granted
- Kind: B2
- Application number: 16/028,049
- Filed: 2018-07-05
- Published: 2018-11-15
- Granted: 2019-11-19
- Earliest claimed: 2013-06-14
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Hejun Hu; Zhaohui Yin; Fei Cao; Zhigang Zhou
- Web page: https://patentgrep.com/patent/US10481905B2

## CPC

- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 21/51: at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability
- G06F 21/565: {by checking file integrity}
- G06F 21/577: {Assessing vulnerabilities and evaluating computer system security}
- H04L 67/10: in which an application is distributed across nodes in the network (software deployment G06F8/60; multiprogramming arrangements G06F9/46)
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method and apparatus for verifying code integrity on a client, the method comprising: determining a verification object on the client; generating a plurality of verification sequences, wherein each verification sequence comprises a memory access mode, and a verification algorithm; randomly selecting a verification sequence from the plurality of verification sequences, and obtaining a server verification result for the verification object in accordance with the selected verification sequence; sending the selected verification sequence to the client; receiving a client verification result for the verification object calculated by the client in accordance with the selected verification sequence; and comparing the server verification result with the client verification result to obtain a code verification result.

## Claims

### Claim 1

A method for verifying code integrity on a client, the method comprising:
receiving a verification sequence randomly selected from a plurality of verification sequences from a server;
determining a memory access mode from X memory access modes, a verification algorithm from Y verification algorithms, and a packaging format from Z packaging formats based on the received verification sequence, wherein X, Y, and Z are integers larger than 1;
determining a verification address and a verification size for a verification object based on the memory access mode of the selected verification sequence, wherein the verification address overlaps with an address of the verification object;
determining a memory access function from a preset list of memory access functions based on the memory access mode of the selected verification sequence;
reading data for the verification object from memory based on the verification address, the verification size, and the memory access function;
calculating a client verification value using the data based on the verification algorithm of the selected verification sequence;
packaging the client verification value based on the packaging format of the selected verification sequence to obtain a client verification result; and
sending the client verification result to the server.

### Claim 2 (depends on 1)

The method of claim 1, wherein the packaging format comprises an order of a plurality of data items, wherein the plurality of data items comprise the verification address, the verification size, the client verification result, the memory access mode, the verification algorithm, and the packaging format.

### Claim 3 (depends on 2)

The method of claim 2, wherein the plurality of data items comprise a superfluous data item.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
after sending the client verification result, receiving a code verification result from the server, the code verification result being obtained by comparing the client verification result with a server verification result generated by the server based on the selected verification sequence.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
sending a user identifier of the client to the server, wherein the verification sequence is randomly selected by the server based on the user identifier.

### Claim 6 (depends on 1)

The method of claim 1, wherein the verification sequence is randomly selected by the server based on a random number, and the random number is generated from one or more data items elected from a group consisting of a user identifier of a client, a MAC address of the user, an IP address of the user, a registration time of the user, and a login time of the user.

### Claim 7 (depends on 1)

The method of claim 1, wherein the X memory access modes, the Y verification algorithms, and the Z packaging formats are pre-stored in the client.

### Claim 8

A client for verifying code integrity, comprising:
a memory; and
a processor coupled to memory and configured to perform:
receiving a verification sequence randomly selected from a plurality of verification sequences from a server;
determining a memory access mode from X memory access modes, a verification algorithm from Y verification algorithms, and a packaging format from Z packaging formats based on the received verification sequence, wherein X, Y, and Z are integers larger than 1;
determining a verification address and a verification size for a verification object based on the memory access mode of the selected verification sequence, wherein the verification address overlaps with an address of the verification object;
determining a memory access function from a preset list of memory access functions based on the memory access mode of the selected verification sequence;
reading data for the verification object from memory based on the verification address, the verification size, and the memory access function;
calculating a client verification value using the data based on the verification algorithm of the selected verification sequence;
packaging the client verification value based on the packaging format of the selected verification sequence to obtain a client verification result; and
sending the client verification result to the server.

### Claim 9 (depends on 8)

The client of claim 8, wherein the packaging format comprises an order of a plurality of data items, wherein the plurality of data items comprise the verification address, the verification size, the client verification result, the memory access mode, the verification algorithm, and the packaging format.

### Claim 10 (depends on 9)

The client of claim 9, wherein the plurality of data items comprise a superfluous data item.

### Claim 11 (depends on 8)

The client of claim 8, wherein the processor is further configured to perform:
after sending the client verification result, receiving a code verification result from the server, the code verification result being obtained by comparing the client verification result with a server verification result generated by the server based on the selected verification sequence.

### Claim 12 (depends on 8)

The client of claim 8, wherein the processor is further configured to perform:
sending a user identifier of the client to the server, wherein the verification sequence is randomly selected by the server based on the user identifier.

### Claim 13 (depends on 8)

The client of claim 8, wherein the verification sequence is randomly selected by the server based on a random number, and the random number is generated from one or more data items elected from a group consisting of a user identifier of a client, a MAC address of the user, an IP address of the user, a registration time of the user, and a login time of the user.

### Claim 14 (depends on 8)

The client of claim 8, wherein the X memory access modes, the Y verification algorithms, and the Z packaging formats are pre-stored in the memory of the client.

### Claim 15

A non-transitory computer-readable storage medium containing one or more programs, wherein the one or more programs include instructions that, when being executed by a processor, cause the processor to perform:
receiving a verification sequence randomly selected from a plurality of verification sequences from a server;
determining a memory access mode from X memory access modes, a verification algorithm from Y verification algorithms, and a packaging format from Z packaging formats based on the received verification sequence, wherein X, Y, and Z are integers larger than 1;
determining a verification address and a verification size for a verification object based on the memory access mode of the selected verification sequence, wherein the verification address overlaps with an address of the verification object;
determining a memory access function from a preset list of memory access functions based on the memory access mode of the selected verification sequence;
reading data for the verification object from memory based on the verification address, the verification size, and the memory access function;
calculating a client verification value using the data based on the verification algorithm of the selected verification sequence;
packaging the client verification value based on the packaging format of the selected verification sequence to obtain a client verification result; and
sending the client verification result to the server.

### Claim 16 (depends on 15)

The storage medium of claim 15, wherein the packaging format comprises an order of a plurality of data items, wherein the plurality of data items comprise the verification address, the verification size, the client verification result, the memory access mode, the verification algorithm, and the packaging format.

### Claim 17 (depends on 16)

The storage medium of claim 16, wherein the plurality of data items comprise a superfluous data item.

### Claim 18 (depends on 15)

The storage medium of claim 15, wherein the instructions further cause the processor to perform:
after sending the client verification result, receiving a code verification result from the server, the code verification result being obtained by comparing the client verification result with a server verification result generated by the server based on the selected verification sequence.

### Claim 19 (depends on 15)

The storage medium of claim 15, wherein the verification sequence is randomly selected by the server based on a random number, and the random number is generated from one or more data items elected from a group consisting of a user identifier of a client, a MAC address of the user, an IP address of the user, a registration time of the user, and a login time of the user.

### Claim 20 (depends on 15)

The storage medium of claim 15, wherein the X memory access modes, the Y verification algorithms, and the Z packaging formats are pre-stored in the memory of the client.
