A software integrity verification method and system based on USBKey

By combining USBKey and SM2/SM3 algorithms for software integrity verification on a Linux system, the problems of easy tampering and lack of commercial cryptographic algorithms in existing technologies are solved, thus achieving security and trustworthiness of software during transmission, storage, and deployment.

CN119249502BActive Publication Date: 2025-10-17HUNAN KYLIN XINAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411250716.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-10-17
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

Existing technologies for software integrity verification on Linux systems suffer from several drawbacks: network transmission is easily tampered with, the integrity of the software cannot be guaranteed during the generation and installation process, and commercial cryptographic algorithms are not used for integrity verification.

Method used

The method combines USBKey with software integrity verification. It uses the SM2 and SM3 algorithms in USBKey to calculate the integrity of the software signature mapping set, and automatically calls USBKey to perform integrity verification at startup to ensure that the software has not been tampered with during transmission, storage or deployment.

Benefits of technology

It enables automatic invocation of the USBKey for integrity verification during software operation, ensuring the trustworthiness and security of the software. The calculation process is performed inside the USBKey device, guaranteeing the security and reliability of the integrity verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249502B_ABST
    Figure CN119249502B_ABST
Patent Text Reader

Abstract

The application discloses a software integrity check method and system based on USBKey, and the software integrity check method based on USBKey comprises the following steps: after application software is started, the application software automatically calls USBKey to perform integrity check on the application software; if the integrity check result returned by the USBKey is that the check is passed, the application software continues to run; otherwise, the application software stops running and exits. The method combines USBKey and software integrity check operation to ensure that the software or software package is not tampered with or damaged during transmission, storage or deployment, the storage, access and transmission of the software signature value are borne by the USBKey hardware device, the safety of the software integrity check value is guaranteed, the software integrity check operation is realized in the USBKey device, the safety of the integrity operation process is guaranteed, and the reliability of the software is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of USBKey encryption application, and particularly relates to a software integrity verification method and system based on a USBKey. BACKGROUND

[0002] Software integrity verification is a process of verifying the integrity and consistency of software, and the purpose is to ensure that the software has not been tampered with or damaged during transmission, storage or deployment, so as to ensure the credibility and security of the software.

[0003] On a Linux system, there are three methods commonly used to implement software integrity verification: 1. integrated software digital signature such as DPKG, DNF or ZYPPER: when building their own distribution or publishing software packages, Linux system distributors or third-party software developers generate a digital signature for each DEB or RPM package using a compilation environment, store the signed DEB or RPM package and the public key for verifying the signature in a software repository, and when a Linux system user installs a software package from the software repository using a package management software, the package management software automatically verifies the software package signature to ensure that the software package has not been tampered with; 2. GPG digital signature: a software developer can use the GPG tool to implement digital signature for his own software, and publish the signature on the official website or repository of the software, and a user can use GPG to verify the digital signature of the software to ensure the integrity and authenticity of the software; 3. AIDE intrusion monitoring: AIDE is used to monitor changes in system files and directories. It can generate hash values and other attributes of files, and periodically verify them to detect changes in files, and if the file hash or attribute changes, AIDE will issue an alarm to indicate possible integrity problems.

[0004] However, in the above methods, the first and second methods mainly rely on network transmission, and there is a possibility of tampered data during network transmission; the third method relies on offline operation of system administrators or enterprise security teams; only the installed software can be recorded and verified, and it cannot be ensured that the software is complete before the hash record is made. Moreover, none of the above methods supports the use of commercial secret algorithms for integrity verification; the software integrity verification operation performed by all methods is completed in the computer memory; and none of the methods can ensure that the software package or the files in the software package have not been tampered with during the generation, installation and running processes. SUMMARY

[0005] The technical problems to be solved by the present application: in view of the above problems of the prior art, a software integrity verification method and system based on USBKey are provided, and the present application aims to combine USBKey and software integrity verification operation to ensure that software or software package is not tampered with or damaged during transmission, storage or deployment, and to ensure the credibility and security of software.

[0006] In order to solve the above technical problems, the technical scheme adopted by the present application is:

[0007] A software integrity verification method based on USBKey, comprising the following steps:

[0008] After the software is started, the absolute path of the binary program of the software is obtained ;

[0009] The absolute path of the binary program is transmitted to the verification service through the software integrity verification interface ;

[0010] The binary file content of the software is read through the verification service ;

[0011] The digest value of the binary file content is calculated through the specified digest algorithm in the USBKey or directly using the specified digest algorithm ;

[0012] The integrity of the software signature mapping set stored in the USBKey is verified through the USBKey using the specified encryption algorithm according to the following formula :

[0013] ,

[0014] In the above formula, is the verification result of the signature mapping , represents the specified signature verification algorithm, is the signature public key of the USBKey itself, is the signature value of the software signature mapping set stored in the USBKey , represents the specified digest algorithm; if the verification result of the signature mapping set is passed, go to the next step; otherwise, the software stops running and exits;

[0015] The integrity signature of the software is searched from the signature mapping ;

[0016] The absolute path of the binary program is verified according to the signature public key using the following formula ; The absolute path of the binary program is verified according to the signature public key using the following formula​ Integrity of the software referred to:

[0017] ,

[0018] In the above formula, Verification result of software integrity, Indicates the specified signature verification algorithm. Sign the integrity of the software, The binary file content of the software If the software integrity verification result is passed, the software continues to run; otherwise, the software stops running and exits.

[0019] Optionally, the slave signature mapping Search for software integrity signatures in The function expression is:

[0020] ,

[0021] In the above formula, Is a software signature mapping set, software signature mapping set Each element in is , Indicates splicing, The path is The signature value of the software; the signature mapping Search for software integrity signatures in When searching for a path The absolute path to the binary program Same signature value The absolute path of the binary program The integrity signature of the corresponding software .

[0022] Optionally, the software signature mapping set stored in the USBKey The generation includes: obtaining the signature mapping for each file to be signed in the software, including: obtaining the absolute path of the file to be signed ; Read the absolute path The contents of the binary file pointed to , calculate the binary file content using the specified digest algorithm Summary value of , using the specified encryption algorithm and signature private key Calculating summary values Signature , the absolute path of the file to be signed and signature Splice to get the signature mapping of the file to be signed ; mapping of signatures of all files to be signed obtaining a software signature mapping set by concatenating .

[0023] Optionally, the software signature mapping set stored in the USBKey is verified by the USBKey using a specified encryption algorithm according to the following formula Further comprising generating the software signature mapping set before and storing it into the USBKey:

[0024] The signature server receives the files to be signed submitted after the completion of software construction;

[0025] The signature server calculates the signature value of the files to be signed based on the USBKey;

[0026] The signature server constructs the signature value and the files to be signed into a software signature mapping set ;

[0027] The signature server submits the software signature mapping set to the signature storage server;

[0028] The signature server writes the software signature mapping set stored in the signature storage server into the USBKey.

[0029] Optionally, the software signature mapping set stored in the signature storage server written into the USBKey includes:

[0030] The signature server requests the software signature mapping set and the signature public key from the signature storage server;

[0031] The USBKey uses its own signature private key to obtain the signature value of the software signature mapping set using a specified encryption algorithm to obtain a signature mapping set :

[0032] ,

[0033] In the above formula, denotes the specified encryption algorithm, is the signature private key of the USBKey, denotes the specified digest algorithm, and the software signature mapping set;

[0034] The software signature mapping set , the signature value of the signature mapping set ​​ and a signature public key write the USBKey.

[0035] Optionally, the USBKey itself uses a signature private key a software signature mapping set using a specified encryption algorithm to obtain a signature mapping set the signature value Before that, it also includes generating the USBKey's own signature private key when initializing the signature key of the USBKey or resetting the signature key .

[0036] Optionally, the specified encryption algorithm is the SM2 algorithm, and the specified digest algorithm is the SM3 algorithm.

[0037] In addition, the present application also provides a USBKey-based software integrity verification system, comprising a microprocessor and a memory connected to each other, the microprocessor being programmed or configured to execute the USBKey-based software integrity verification method.

[0038] In addition, the present application also provides a computer readable storage medium, which stores a computer program or instructions, the computer program or instructions being programmed or configured to execute the USBKey-based software integrity verification method by a processor.

[0039] In addition, the present application also provides a computer program product, comprising a computer program or instructions, the computer program or instructions being programmed or configured to execute the USBKey-based software integrity verification method by a processor.

[0040] Compared with the prior art, the present application mainly has the following advantages:

[0041] 1、The USBKey-based software integrity verification method of the present application comprises that the application software automatically calls the USBKey to perform integrity verification on the application software after starting, if the integrity verification result returned by the USBKey is that the verification is passed, the application software continues to run, otherwise the application software stops running and exits, the method of the present application combines the USBKey and the software integrity verification operation to ensure that the software or software package is not tampered with or damaged in the process of transmission, storage or deployment, the storage, access and transmission of the software signature value are borne by the USBKey hardware device, the security of the software integrity verification value is ensured, the software integrity verification operation is implemented in the USBKey device, the security of the integrity operation process is ensured, and the reliability of the software is ensured.

[0042] 2、The USBKey of the application supports various USBKeys and their built-in encryption algorithms and digest algorithms, for example, a commercial secret USBKey supporting the commercial secret SM2 algorithm and SM3 algorithm can be used to generate software integrity signature values and verify software integrity, and the storage, access and transmission of software signature values are borne by the commercial secret USBKey hardware device, thereby ensuring the security of software integrity check values, and the software integrity check operation is implemented in the commercial secret USBKey device, thereby ensuring the security of the integrity operation process. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 It is a basic flowchart of the method of the embodiment of the application.

[0044] Figure 2 It is a schematic diagram of the working principle of the method of the embodiment of the application.

[0045] Figure 3 It is a schematic diagram of the initiation process of the signature service in the embodiment of the application.

[0046] Figure 4 It is a schematic diagram of the data storage process of the signature service in the embodiment of the application.

[0047] Figure 5 It is a working flowchart of the update service in the embodiment of the application.

[0048] Figure 6 It is a timing diagram of software running integrity check provided in the embodiment of the application.

[0049] Figure 7 It is a timing diagram of software signature provided in the embodiment of the application.

[0050] Figure 8 It is a timing diagram of requesting software signature mapping provided in the embodiment of the application.

[0051] Figure 9 It is a timing diagram of resetting the USBKey and requesting software signature mapping provided in the embodiment of the application. DETAILED DESCRIPTION

[0052] The software integrity check method and system based on the USBKey of the application aims to solve the problem of keeping software complete in all processes from generation to running, the problem of software integrity check operation in memory and the problem of software integrity check value storage security by providing a system and method for software signature calculation, storage and signature verification. In the following, the application will be further described in detail in combination with specific embodiments taking the specified encryption algorithm as the SM2 algorithm and the specified digest algorithm as the SM3 algorithm. It should be noted that the application does not depend on the SM2 algorithm and the SM3 algorithm.

[0053] As shown in Figure 1 , the software integrity verification method based on the USBKey of the embodiment includes the following steps:

[0054] S1, after the software is started, the absolute path of the binary program thereof is acquired ;

[0055] S2, the absolute path of the binary program is passed to the verification service through a software integrity verification interface , as shown in Figure 3 , the calling of the software integrity verification interface is added at the running entry of the program in the software design and development stage, so that the packaged software can automatically initiate the calling of the software integrity verification interface after being started;

[0056] S3, the binary file content of the software is read through the verification service , that is:

[0057] ),

[0058] In the above formula, is a read function for reading the binary file content of the software;

[0059] S4, the digest value of the binary file content is calculated through the specified digest algorithm in the USBKey or directly using the specified digest algorithm ; ;

[0060] S5, the integrity of the software signature mapping set stored in the USBKey is verified through the USBKey using the specified encryption algorithm according to the following formula: ;

[0061] ,

[0062] In the above formula, is the verification result of the signature mapping , represents the specified signature verification (Verify) algorithm, is the signature public key of the USBKey itself, is the signature value of the software signature mapping set stored in the USBKey , and represents the specified digest algorithm; in the embodiment, the specified encryption algorithm is the SM2 algorithm, and the specified digest algorithm is the SM3 algorithm, so the above formula is:

[0063] ;

[0064] In the above formula, ​represents the SM2 algorithm, represents the SM3 algorithm; if the verification result of the signature mapping set is pass, then jump to the next step; otherwise, the software stops running and exits;

[0065] S6, search the integrity signature of the software from the signature mapping set ;

[0066] ;

[0067] In the above formula, is the set of software signature mappings, each element is , is the signature value of the software with the path ; find the signature value same as , that is is the corresponding signature value .

[0068] S7, verify the integrity of the software pointed to by the absolute path of the binary program according to the signature public key using the following formula:

[0069] ,

[0070] In the above formula, is the verification result of the software integrity, represents the specified signature verification (Verify) algorithm, is the signature public key, is the integrity signature of the software, is the digest value of the binary file content of the software; if the verification result of the software integrity is pass, then the software continues to run, otherwise the software stops running and exits; in this embodiment, the specified encryption algorithm is the SM2 algorithm, and the specified digest algorithm is the SM3 algorithm, so the above formula is:

[0071] ;

[0072] In the above formula, represents the SM2 algorithm, represents the SM3 algorithm; if the verification result of the software integrity is pass, then the software continues to run, otherwise the software stops running and exits. As Figure 2 ​​​As shown, after the software is started, the USBKey component is automatically called to perform a software integrity check on the software and obtain the result of the integrity check. If the integrity check result returned by the USBKey component is passed, the application software continues to run, otherwise the application software stops running and exits. It should be noted that any verification request based on the software integrity verification interface will record an audit log. If the software runs normally but there is no audit log, it means that the software has not used the verification service to verify the integrity of the software and the software has been tampered with. The encryption algorithm specified in this embodiment is the SM2 algorithm and the digest algorithm specified is the SM3 algorithm. Based on the above requirements, all USBKey devices that comply with the "GM / T 0016-2012 Smart Password Key Password Application Interface Specification" can be used as the USBKey relied on by the present invention. The USBKey has the characteristics of being simple and easy to use and having a unified interface.

[0073] In step S6 of this embodiment, from the signature mapping Search for software integrity signatures in The function expression is:

[0074] ,

[0075] In the above formula, Is a software signature mapping set, software signature mapping set Each element in is , Indicates splicing, The path is The signature value of the software; the signature mapping Search for software integrity signatures in When searching for a path The absolute path to the binary program Same signature value The absolute path of the binary program The integrity signature of the corresponding software The software described in this embodiment is an independent binary program. Generally, the program appears in the form of an independent file. Software signature mapping set S A It is a collection of signature mappings for a series of individual software, rather than a collection of signatures for all components of a large software, so there is the concept of search.

[0076] In this embodiment, the software signature mapping set stored in USBKey The generation includes:

[0077] S101, obtaining a signature mapping for each software file to be signed, including:

[0078] Get the absolute path of the file to be signed ;

[0079] read the absolute path of the pointed binary file content , i.e. ;

[0080] calculate the digest value of the binary file content using the specified digest algorithm , i.e. ;

[0081] calculate the signature of the digest value using the specified encryption algorithm and signature private key , i.e.

[0082] ;

[0083] In the above formula, denotes the SM2 algorithm;

[0084] concatenate the absolute path of the file to be signed and the signature to obtain the signature mapping of the file to be signed , i.e.

[0085] ,

[0086] In the above formula, denotes concatenation;

[0087] S102, concatenate the signature mappings of all the files to be signed to obtain the software signature mapping set , i.e.

[0088] ,

[0089] In the above formula, denotes concatenation, denote the signature mappings of n signed software respectively, is the signature mapping set.

[0090] In this embodiment, the software signature mapping set stored by the USBKey is verified by the USBKey using the specified encryption algorithm according to the following formula in step S5 Before that, the software signature mapping set is generated and stored in the USBKey:

[0091] S201, the signature server receives the files to be signed submitted after the software construction is completed;

[0092] ​​​​S202, the signature server calculates the signature value of the file to be signed based on the USBKey;

[0093] S203, the signature server constructs the software signature mapping set with the signature value and the file to be signed , constructs the software signature mapping set , that is, the steps S101 and S102 described above; as shown in the figure, after the software packaging is completed, the construction result is transmitted to the signature server, and the signature server calculates the signature value of the file to be signed by using the signature calculation device, that is, provides the signature service; Figure 3

[0094] S204, the signature server submits the signature mapping to the signature storage server; as shown in the figure, after the signature service, the signature data (signature mapping Figure 4 ) needs to be stored, and then the signature is stored in the server for later use;

[0095] S205, write the signature mapping stored in the signature storage server into the USBKey.

[0096] In this embodiment, the step of writing the signature mapping stored in the signature storage server into the USBKey in step S205 includes:

[0097] S301, request the software signature mapping set and the signature public key from the signature storage server;

[0098] S302, use the signature private key of the USBKey itself to obtain the signature value (Signature) of the software signature mapping set by using the specified encryption algorithm:

[0099] ,

[0100] In the above formula, denotes the specified encryption algorithm, is the signature private key of the USBKey itself, denotes the specified digest algorithm, is the software signature mapping set; when the SM2 algorithm is used as the specified encryption algorithm, the specified encryption algorithm may be represented as .

[0101] S303, write the software signature mapping set​​​ , signature mapping Signature value And the signature public key Write to USBKey, such as Figure 5 As shown, in this embodiment, the signature data of USBKey (software signature mapping set) is updated by updating the service. , signature mapping set Signature value ) and the signature public key .

[0102] In this embodiment, the USBKey's own signature private key is used Software signature mapping collection Get the signature mapping set using the specified encryption algorithm Signature value Previously, it also included generating the USBKey's own signature private key when the USBKey initialized the signature key or reset the signature key The operator inserts the USBKey device used to store the software signature value and signature public key into the USB interface of the operating device. If the USBKey to be used needs to replace the signature public key or is a new device, the internal signature key will be generated for the USBKey first, and then the software signature mapping set will be requested from the signature storage server. , and written into the USBKey device. The software signature stored in the USBKey device will be signed using the signature key inside the USBKey.

[0103] Figure 6 The software running integrity check sequence diagram provided in this embodiment is an "application software". The running integrity check sequence includes: (1) software startup; (2) software sends a verification request to the verification service; (3) the verification service confirms the caller, which can be confirmed by an agreed token or other verification method. After confirmation, the mapping conditions can be spliced, including reading the binary file content of the software through the verification service. And splice the mapping conditions to obtain the mapping conditions in the format required by the SM3 algorithm; (4), send the mapping conditions to the USBKey driver; (5), the USBKey driver queries the software signature value stored in the USBKey based on the mapping conditions (signature mapping Signature value ); (6), USBKey returns the software signature value to the USBKey driver; (7), USBKey driver returns the software signature value to the verification service; (8), the verification service calculates the software digest value, here is to directly use the specified digest algorithm to calculate the binary file content Summary value of In addition, the USBKey can be used to calculate the digest value of the binary file content ; (9) the verification service sends the software digest value and the signature value to the USBKey driver; (10) the USBKey driver calls the signature verification interface to initiate a signature verification request to the USBKey; (11) the USBKey performs the verification request; (12) the USBKey returns the verification result to the USBKey driver; (13) the USBKey driver returns the verification result to the verification service; (14) the verification service returns the verification result to the software; (15) the software performs different operations according to the verification result, i.e. continues to execute or stops execution.

[0104] Figure 7 A software signature timing diagram provided in the embodiment is shown in FIG. 8. The timing includes: (1) the continuous integration / continuous deployment tool (CI / CD) initiates a software compilation and packaging request to the software compilation and packaging tool; (2) the software compilation and packaging tool performs software compilation and packaging to generate a compilation result; (3) the software compilation and packaging tool sends the compilation result and a list of files to be signed to the signature server; (4) the signature server parses the list of files to be signed; (5) the signature server calculates the software signature through a signature calculation device (USBKey or a device with the same function); (6) the signature calculation device returns the software signature to the signature server; (7) the signature server constructs a signature mapping to obtain a software signature mapping set ; (8) the signature server stores the software signature mapping set to the signature storage server; (9) the signature storage server returns a feedback result to the signature server; (10) the signature server returns the feedback result to the software compilation and packaging tool; (11) the software compilation and packaging tool returns the feedback result to the continuous integration / continuous deployment tool (CI / CD).

[0105] Figure 8 A timing diagram for requesting a software signature mapping provided in the embodiment is shown in FIG. 9. The timing diagram represents a timing diagram for requesting a software signature mapping from the signature storage server, and storing the software signature mapping to the USBKey device after signing using the signature key of the USBKey itself. The timing includes: (1) the operator inserts the USBKey on the client; (2) the operator resets the USBKey; (3) the operator generates an internal signature key of the USBKey; (4) the USBKey returns the running status of generating the internal signature key; it should be noted that Figure 8 (2)-(4) in the rectangular dashed frame of opt in FIG. 9 are optional operations; (5) the operator requests the signature mapping from the signature storage server on the client; (6) the signature storage server returns the signature mapping ​(7), the USBKey uses the internal signing key to sign the software signature map (8), the USBKey returns a completion message to the operator's client; (9), the operator disconnects the USBKey.

[0106] Figure 9 For a reset USBKey and request software signature map timing diagram provided in this embodiment, the first update the USBKey device itself of the storage software signature signing key, and then request software signature map from the signature storage server, and use the USBKey updated its own signature key signed and stored to the USBKey device timing diagram, the timing includes: (1), the operator inserts the USBKey on the client; (2), the operator resets the USBKey; (3), the operator generates the internal signing key of the USBKey; (4), the USBKey returns the public key of the so-called internal signing key; (5), the operator generates the public key certificate of the internal signing key on the client; (6), the operator imports the public key certificate of the internal signing key to the USBKey on the client; (7), the operator requests the signing public key of the software signature from the signature storage server on the client ; (8), the signature storage server returns the signing public key ; (9), the USBKey stores the signing public key ; (10), the USBKey returns a running status message to the operator's client, such as storing successfully, then the USBKey can be disconnected.

[0107] In summary, the method of the embodiment has the following features: 1. The commercial algorithm is used to calculate the signature of the software package, binary file or key file: the commercial algorithm SM2 and SM3 with higher calculation efficiency and stronger security are used to calculate the signature value of the software, and the international algorithm such as SHA256 and RSA is not used; 2. The USBKey is used to store the software signature and the signature public key certificate: the software signature value is stored in the USBKey, and the software and hardware are distributed in different ways; the USBKey has a special access control, and the software signature stored in the USBKey is signed by the internal signature key of the USBKey, so that the stored software signature is safe and cannot be tampered with without authorization; 3. The USBKey is used as a software integrity verification device: the USBKey device integrates the SM3 hash algorithm and the SM2 signature verification algorithm, and the password operation occurs in the USBKey device instead of in the memory when calculating the software integrity, and the calculation process is safe; 4. The software is ensured to be complete from generation to running: the software, the software signature and the signature public key are stored separately, and when the software runs, the software signature stored in the USBKey is verified by the verification service first, and then the integrity of the software is verified by the USBKey, and if any problem occurs in any link, the software integrity cannot be verified. The commercial algorithm SM2 and SM3 are used to replace the international algorithm such as RSA, SHA256 and AES to realize the generation and verification of the software integrity check, and the software signature value used to check the software integrity is stored in the safe USBKey device instead of the file system of the operating system; when the software integrity check is performed, the password operation occurs in the USBKey device, which ensures the security of the integrity operation. The software developer calls the software integrity check interface provided by the verification service in advance, which ensures that the software can call the verification service to ensure its integrity when running; after the software is compiled, the signature server is called, the signature server calculates the software signature of the target file using the signature calculation device, the SM2 and SM3 algorithms used by the signature calculation device are consistent with the SM2 and SM3 algorithms in the USBKey device used to store and calculate the software integrity; after the signature server calculates the software signature of the target file, the signature mapping is constructed according to the predetermined rule and stored in the signature storage server; the USBKey used to store the software signature will have an independent internal signature key between devices, and the software signature result obtained from the signature storage server will be signed by the internal signature key and stored in the USBKey, and the signature of the software signature file is also stored in the USBKey; the signature public key certificate used to verify the software signature is also obtained from the signature storage server and stored in the USBKey.When the software runs, the software integrity verification interface previously called in the code flow is called to perform software integrity verification. The software integrity verification interface is implemented in the verification service, and the verification service itself also depends on the internally implemented software integrity verification interface to ensure its integrity. The verification service interacts with the driver layer of the USBKey. First, the integrity of the signature value stored in the USBKey is verified through the standard interface of the USBKey. Then, the signature value of the target file is obtained from the USBKey according to the rules, and the digest of the target file is calculated using the SM3 digest algorithm interface of the USBKey. Then, the integrity of the software is verified using the SM2 signature verification interface of the USBKey. The verification service returns the software integrity verification result to the calling program and records the audit log to indicate whether the target software passes the integrity verification. In this embodiment, the commercial secret algorithms SM2 and SM3 are used to generate the software integrity signature value and verify the software integrity. The storage, access and transmission of the software signature value are carried out through the USBKey hardware device, which ensures the security of the software integrity verification value. The software integrity verification operation is implemented in the USBKey device, which ensures the security of the integrity operation process. The signature calculation device and the signature verification device have the same implementation of the commercial secret algorithm and meet the recommended standard regulations of the Chinese cryptography industry.

[0108] In addition, the embodiment also provides a USBKey-based software integrity verification system, which comprises a microprocessor and a memory connected with each other. The microprocessor is programmed or configured to execute the USBKey-based software integrity verification method.

[0109] In addition, the embodiment also provides a computer readable storage medium, which stores a computer program or instructions programmed or configured to execute the USBKey-based software integrity verification method through a processor.

[0110] In addition, the embodiment also provides a computer program product, which comprises a computer program or instructions programmed or configured to execute the USBKey-based software integrity verification method through a processor.

[0111] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a software embodiment, various software modules in accordance with embodiments of the application are stored in a memory such as a computer memory or disk storage for use by, or in connection with, the software on the computer system. The software can provide for programs to be transferred to another computer readable medium (e.g., a removable medium either in the form of computer disks or other hardware) for implementation of the various techniques. Particular software modules can be designed to carry out the functions of embodiments of the application using standard programming techniques and / or languages. Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks

[0112] The above description is only preferred embodiments of the application. The protection scope of the application is not limited to the above-mentioned embodiments. Any technical scheme falling within the concept of the application should be considered as falling within the protection scope of the application. It should be noted that any improvement and modification of the application by those skilled in the art without departing from the principle of the application should be considered as falling within the protection scope of the application.

Claims

1. A software integrity verification method based on USBKey, characterized in that: The steps include: The software obtains the absolute path of its binary program after startup ; The absolute path to the binary program Passed to the verification service through the software integrity check interface; Read the binary file contents of the software through the verification service ; Calculate the binary file content using the digest algorithm specified in USBKey or directly using the specified digest algorithm Summary value of ; Use the specified encryption algorithm through USBKey to verify the software signature mapping set stored in USBKey according to the following formula For completeness: , In the above formula, For signature mapping The verification results, Indicates the specified signature verification algorithm. The signature public key of USBKey itself, A set of software signature mappings stored in the USBKey The signature value of Indicates the specified digest algorithm; if the signature mapping If the verification result is passed, jump to the next step; otherwise, the software stops running and exits; Mapping from signature Search for software integrity signatures in ; Use the following formula based on the signature public key Verify the absolute path of the binary program Integrity of the software referred to: , In the above formula, Verification result of software integrity, Indicates the specified signature verification algorithm. Sign the integrity of the software, The binary file content of the software If the software integrity verification result is passed, the software continues to run; otherwise, the software stops running and exits.

2. The software integrity verification method based on USBKey according to claim 1, characterized in that: The signature mapping Search for software integrity signatures in The function expression is: , In the above formula, Is a software signature mapping set, software signature mapping set Each element in is , Indicates splicing, The path is The signature value of the software; the signature mapping Search for software integrity signatures in When searching for a path The absolute path to the binary program Same signature value The absolute path of the binary program The integrity signature of the corresponding software .

3. The software integrity verification method based on USBKey according to claim 1, characterized in that: Software signature mapping set stored in the USBKey The generation includes: obtaining the signature mapping for each file to be signed in the software, including: obtaining the absolute path of the file to be signed ; Read the absolute path The contents of the binary file pointed to , calculate the binary file content using the specified digest algorithm Summary value of , using the specified encryption algorithm and signature private key Calculating summary values Signature , the absolute path of the file to be signed and signature Splice to get the signature mapping of the file to be signed ; Map the signatures of all files to be signed Splicing to get the software signature mapping set .

4. The software integrity verification method based on USBKey according to claim 1, characterized in that: The software signature mapping set stored in USBKey is verified by using the specified encryption algorithm according to the following formula: Previously also included generating software signature mapping sets And store it in USBKey: The signature server receives the files to be signed submitted after the software is built; The signature server calculates the signature value of the file to be signed based on the USBKey; The signature server constructs the software signature mapping set with the signature value and the file to be signed ; The signature server maps the signature Submit to the signature storage server; Map the signatures stored in the signature storage server to Write to USBKey.

5. The software integrity verification method based on USBKey according to claim 4, characterized in that: The signature stored in the signature storage server is mapped Writing to USBKey includes: Request software signature mapping collection from signature storage server And the signature public key ; Use USBKey's own signature private key Software signature mapping collection Get the signature mapping using the specified encryption algorithm Signature value : , In the above formula, Indicates the specified encryption algorithm. It is the signature private key of USBKey itself. Indicates the specified digest algorithm. A set of software signature mappings; Mapping software signatures to a collection , signature mapping set Signature value And the signature public key Write to USBKey.

6. The software integrity verification method based on USBKey according to claim 5, characterized in that: The use of USBKey's own signature private key Software signature mapping collection Get the signature mapping set using the specified encryption algorithm Signature value Previously, it also included generating the USBKey's own signature private key when the USBKey initialized the signature key or reset the signature key .

7. The software integrity verification method based on USBKey according to claim 1, characterized in that: The specified encryption algorithm is the SM2 algorithm, and the specified digest algorithm is the SM3 algorithm.

8. A software integrity verification system based on USBKey, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the USBKey-based software integrity verification method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the USBKey-based software integrity verification method according to any one of claims 1 to 7 through a processor.

10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the USBKey-based software integrity verification method according to any one of claims 1 to 7 through a processor.

Citation Information

Patent Citations

  • Lightweight data protection system based on national cryptographic algorithm

    CN113420309A

  • Method and device for integrity verification of USB upgrade package

    CN118427884A