# US 2021/0064752 A1 · Method and system for granting access to a file

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

- Number: US 2021/0064752 A1
- Document ID: US20210064752A1
- Status: Published application
- Kind: A1
- Application number: 17/098,512
- Filed: 2020-11-16
- Published: 2021-03-04
- Earliest claimed: 2018-06-29
- Assignees: AO Kaspersky Lab
- Applicants: AO Kaspersky Lab
- Inventors: Denis O. Vlaznev; Sergey V. Kubrin
- Web page: https://patentgrep.com/patent/US20210064752A1

## CPC

- G06F 21/564: {by virus signature recognition}
- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- G06F 21/567: {using dedicated hardware}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed herein are systems and methods for granting access to a file. In one aspect, an exemplary method comprises, calculating a first hash of a portion of the file, searching for the first hash in a local database, when the first hash is found indicates that the file is malicious, calculating a second hash, searching for the second hash in the verdict cache, and pronouncing a final decision as to a harmfulness of the file, and when either the first hash is not found in the verdict cache or the first hash is found and indicates that the file is trusted, granting access to the file, calculating a second hash of the file, generating a request for information about the file and sending the request to a remote server, and pronouncing a decision as to harmfulness of the file based on results of the search received from the remote server.

## Claims

### Claim 1

A method for granting access to a file, the method comprising:
calculating a first hash of a portion of the file;
searching for the first hash in a local database that contains a verdict cache containing hashes of known malicious files and trusted files;
when the first hash is found in the verdict cache and the first hash indicates that the file is malicious, calculating a second hash of the file, searching for the second hash in the verdict cache and/or a remote server, and pronouncing a final decision as to a harmfulness or safety of the file based on the results of the search; and
when either the first hash is not found in the verdict cache or the first hash is found in the verdict cache and indicates that the file is a trusted file, granting access to the file, calculating a second hash of the file, generating a request for information about the file including at least an indication as to harmfulness of the file, sending the request to a remote server to search for the second hash in a verdict cache of the remote server, and pronouncing a decision as to harmfulness or safety of the file based on results of the search received from the remote server in response to the request.

### Claim 2 (depends on 1)

The method of claim 1, wherein the second hash is calculated based on all portions of the file.

### Claim 3 (depends on 1)

The method of claim 1, wherein the portion of the file used for calculating the first hash is selected based on a predetermined criteria, the predetermined criteria being based at least on one of: a type of the file, a size of the file, and metadata of the file.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
performing an antivirus scanning of the file based on the second hash with the local database.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
when the second hash is found in the local database, halting execution of the file and synchronously search for the second hash in a database of the remote server.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
determining errors of a first kind and second kind in verdicts based on comparisons of first hashes and verdict cache in the local database.

### Claim 7 (depends on 1)

The method of claim 1, wherein the local database is located on a same computing device performing the granting of access to the file.

### Claim 8 (depends on 1)

The method of claim 1,
wherein the calculating of the first hash of the portion of the file is performed synchronously,
the searching for the first hash in the local database that contains the verdict cache is performed synchronously,
when the first hash is found in the verdict cache and the first hash indicates that the file is malicious, the calculating of the second hash of the file, and the searching for the second hash in the verdict cache or the remote server are performed synchronously,
when either the first hash is not found in the verdict cache or the first hash is found in the verdict cache and indicates that the file is a trusted file, the calculating of the second hash of the file, the generating a request for information about the file including at least an indication as to harmfulness of the file, and the sending the request to a remote server to search for the second hash in a verdict cache of the remote server are performed asynchronously.

### Claim 9

A system for granting access to a file, comprising:
at least one processor configured to:
calculate a first hash of a portion of the file;
search for the first hash in a local database that contains a verdict cache containing hashes of known malicious files and trusted files;
when the first hash is found in the verdict cache and the first hash indicates that the file is malicious, calculate a second hash of the file, search for the second hash in the verdict cache and/or a remote server, and pronounce a final decision as to a harmfulness or safety of the file based on the results of the search; and
when either the first hash is not found in the verdict cache or the first hash is found in the verdict cache and indicates that the file is a trusted file, grant access to the file, calculate a second hash of the file, generate a request for information about the file including at least an indication as to harmfulness of the file, send the request to a remote server to search for the second hash in a verdict cache of the remote server, and pronounce a decision as to harmfulness or safety of the file based on results of the search received from the remote server in response to the request.

### Claim 10 (depends on 9)

The system of claim 9, wherein the second hash is calculated based on all portions of the file.

### Claim 11 (depends on 9)

The system of claim 9, wherein the portion of the file used for calculating the first hash is selected based on a predetermined criteria, the predetermined criteria being based at least on one of: a type of the file, a size of the file, and metadata of the file.

### Claim 12 (depends on 9)

The system of claim 9, the processor further configured to:
perform an antivirus scanning of the file based on the second hash with the local database.

### Claim 13 (depends on 12)

The system of claim 12, the processor further configured to:
when the second hash is found in the local database, halt execution of the file and synchronously search for the second hash in a database of the remote server.

### Claim 14 (depends on 9)

The system of claim 9, further comprising:
determining errors of a first kind and second kind in verdicts based on comparisons of first hashes and verdict cache in the local database.

### Claim 15 (depends on 9)

The system of claim 9, wherein the local database is located on a same computing device performing the granting of access to the file.

### Claim 16 (depends on 9)

The system of claim 9,
wherein the calculating of the first hash of the portion of the file is performed synchronously,
the searching for the first hash in the local database that contains the verdict cache is performed synchronously,
when the first hash is found in the verdict cache and the first hash indicates that the file is malicious, the calculating of the second hash of the file, and the searching for the second hash in the verdict cache or the remote server are performed synchronously,
when either the first hash is not found in the verdict cache or the first hash is found in the verdict cache and indicates that the file is a trusted file, the calculating of the second hash of the file, the generating a request for information about the file including at least an indication as to harmfulness of the file, and the sending the request to a remote server to search for the second hash in a verdict cache of the remote server are performed asynchronously.

### Claim 17

A non-transitory computer readable medium storing thereon computer executable instructions, that when executed by a hardware processor, perform a method for granting access to a file, including instructions for:
calculating a first hash of a portion of the file;
searching for the first hash in a local database that contains a verdict cache containing hashes of known malicious files and trusted files;
when the first hash is found in the verdict cache and the first hash indicates that the file is malicious, calculating a second hash of the file, searching for the second hash in the verdict cache and/or a remote server, and pronouncing a final decision as to a harmfulness or safety of the file based on the results of the search; and
when either the first hash is not found in the verdict cache or the first hash is found in the verdict cache and indicates that the file is a trusted file, granting access to the file, calculating a second hash of the file, generating a request for information about the file including at least an indication as to harmfulness of the file, sending the request to a remote server to search for the second hash in a verdict cache of the remote server, and pronouncing a decision as to harmfulness or safety of the file based on results of the search received from the remote server in response to the request.

### Claim 18 (depends on 17)

The non-transitory computer readable medium of claim 17, the instructions further including instructions for:
performing an antivirus scanning of the file based on the second hash with the local database.

### Claim 19 (depends on 18)

The non-transitory computer readable medium of claim 18, the instructions further including instructions for:
when the second hash is found in the local database, halting execution of the file and synchronously search for the second hash in a database of the remote server.

### Claim 20 (depends on 17)

The non-transitory computer readable medium of claim 17, the instructions further including instructions for:
determining errors of a first kind and second kind in verdicts based on comparisons of first hashes and verdict cache in the local database.
