Software integrity verification method and system based on USBKey
By using USBKey devices combined with SM2 and SM3 algorithms in Linux systems, the network dependence and tampering risks of software integrity verification in the prior art are solved, and the software is realized in the transmission, storage or deployment process security and credibility in.
Patent Information
- Application Number
- CN202411250716.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The software integrity verification method in Linux systems depends on network transmission, and there is a risk of tampering. It cannot guarantee the integrity of the software during transmission, storage or deployment, and does not support the integrity verification of the trade secret algorithm.
The software integrity verification method based on USBKey is used to calculate the software's summary value and signature mapping set through USBKey devices, and encrypt and digest operations are used using SM2 algorithm and SM3 algorithm to ensure the integrity of the software during transmission, storage or deployment.
Implements the integrity verification of the software during transmission, storage or deployment, ensuring the credibility and security of the software, and bears signature value and integrity verification operations through USBKey hardware devices, avoiding the security risks of in-memory operations. .
Smart Images

Figure CN119249502A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of USBKey encryption application, and in particular to a software integrity verification method and system based on USBKey. Background Art
[0002] Software integrity verification is a process of verifying the integrity and consistency of software. Its 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 Linux systems, there are three methods commonly used to implement software integrity verification: 1. Integrated software digital signatures such as DPKG, DNF or ZYPPER: When Linux system distributors build their own distributions or third-party software developers release software packages, they use the compilation environment to generate a digital signature for each DEB or RPM package, and store the signed DEB or RPM package and the public key for verifying the signature in the software repository; when Linux system users use package management software to install software packages from the software repository, the package management software will automatically verify the software package signature to ensure that the software package has not been tampered with; 2. GPG digital signature: Software developers can use GPG tools to implement digital signatures for their own software and publish the signatures to the official software website or repository. Users 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 perform regular checks to detect changes in files. If the file hash or attribute changes, AIDE will issue an alarm to indicate possible integrity issues.
[0004] However, among the above methods, the first and second ones mainly rely on network transmission, during which there is a possibility of data tampering; the third one relies on offline operations by the system administrator or the enterprise security team; it can only make hash records and verifications for the installed software, and cannot guarantee whether the software is complete before making the hash record. Moreover, none of the above methods supports integrity verification using commercial secret algorithms; the software integrity verification operations performed by all methods are completed in the computer memory; there is no method that can guarantee that the software package or the files in the software package have not been tampered with during the generation, installation, and operation process. Summary of the invention
[0005] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a software integrity verification method and system based on USBKey are provided. The present invention aims to combine USBKey and software integrity verification operations to ensure that the software or software package has not been tampered with or damaged during transmission, storage or deployment, thereby ensuring the credibility and security of the software.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: A software integrity verification method based on USBKey includes the following steps: 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 verification interface; Read the binary file contents of the software through the verification service ; Calculate the binary file content by 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 collection of software signature mappings stored in the USBKey The signature value of Indicates the specified digest algorithm; if the signature mapping set 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. is the signature public key, 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.
[0007] Optionally, the slave signature mapping Search for software integrity signatures in The function expression is: , In the above formula, is a software signature mapping collection, a software signature mapping collection Each element in is , Indicates splicing, The path is The signature value of the software; the mapping from the signature Search for software integrity signatures in When searching for a path with the absolute path to the binary program Same signature value This is the absolute path to the binary program. The integrity signature of the corresponding software .
[0008] Optionally, the software signature mapping set stored in the USBKey The generation includes: obtaining a signature mapping for each to-be-signed file of the software, including: obtaining the absolute path P of the to-be-signed file; reading the binary file content B pointed to by the absolute path P p , using the specified digest algorithm to calculate the binary file content Summary value of , using the specified encryption algorithm and signature private key Calculating summary values Signature , the absolute path P of the file to be signed and the signature Splice to get the signature mapping of the file to be signed ; Map the signatures of all files to be signed Splice to get the software signature mapping set .
[0009] Optionally, the software signature mapping set stored in USBKey is verified by using a specified encryption algorithm according to the following formula: Previously, this also included generating a collection of software signature mappings 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 signature value and the file to be signed into a software signature mapping set ; The signature server sets the signature mapping Submit to the signature storage server; The signature mapping collection stored in the signature storage server Write to USBKey.
[0010] Optionally, the signature mapping set stored in the signature storage server Writing to USBKey includes: Request a software signature mapping set from the signature storage server And the signature public key ; Use USBKey's own signature private key Mapping software signatures to collections Get the signature mapping set using the specified encryption algorithm The 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 collection of software signature mappings; Mapping software signatures to collections , signature mapping collection The signature value And the signature public key Write to USBKey.
[0011] Optionally, the USBKey's own signature private key is used Mapping software signatures to collections Get the signature mapping set using the specified encryption algorithm The 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 .
[0012] Optionally, the specified encryption algorithm is an SM2 algorithm, and the specified digest algorithm is an SM3 algorithm.
[0013] In addition, the present invention also provides a software integrity verification system based on USBKey, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the software integrity verification method based on USBKey.
[0014] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the USBKey-based software integrity verification method through a processor.
[0015] In addition, the present invention also provides a computer program product, including a computer program or an instruction, wherein the computer program or the instruction is programmed or configured to execute the USBKey-based software integrity verification method through a processor.
[0016] Compared with the prior art, the present invention mainly has the following advantages: 1. The software integrity verification method based on USBKey of the present invention includes that the application software automatically calls USBKey to perform integrity verification on the application software after startup. If the integrity verification result returned by USBKey is verification passed, the application software continues to run, otherwise the application software stops running and exits. The method of the present invention combines USBKey with software integrity verification operations 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 carried by the USBKey hardware device, which ensures the security of the software integrity verification value. The software integrity verification operation is implemented inside the USBKey device, which ensures the security of the integrity operation process and the credibility of the software.
[0017] 2. The USBKey of the present invention supports various types of USBKey and their built-in encryption algorithms and digest algorithms. For example, a commercial USBKey that supports the commercial SM2 algorithm and SM3 algorithm can be used. The SM2 algorithm and SM3 algorithm are used to generate software integrity signature values and verify software integrity. The storage, access, and transmission of the software signature value are carried by the commercial USBKey hardware device, which ensures the security of the software integrity check value. The software integrity check operation is implemented inside the commercial USBKey device, which ensures the security of the integrity operation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.
[0019] Figure 2 The figure is a schematic diagram of the working principle of the method according to the embodiment of the present invention.
[0020] Figure 3The figure is a schematic diagram of the initiation process of the signature service in an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of the data storage process of the signature service in an embodiment of the present invention.
[0022] Figure 5 This is a workflow diagram for updating services in an embodiment of the present invention.
[0023] Figure 6 A software running integrity check timing diagram provided in an embodiment of the present invention.
[0024] Figure 7 A software signature timing diagram provided in an embodiment of the present invention.
[0025] Figure 8 A timing diagram of requesting software signature mapping provided in an embodiment of the present invention.
[0026] Fig. 9 A timing diagram of resetting USBKey and requesting software signature mapping provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The software integrity verification method and system based on USBKey of the present invention aims to solve the problem of keeping the software intact from generation to operation, the problem of calculating the software integrity verification in memory, and the problem of storing the software integrity verification value safely by providing a system and method for software signature calculation, storage and signature verification. The following will take the SM2 algorithm as the designated encryption algorithm and the SM3 algorithm as the designated digest algorithm as an example, and further explain the present invention in detail in combination with specific embodiments. It should be noted that the present invention does not rely on the SM2 algorithm and the SM3 algorithm.
[0028] like Figure 1 As shown, the software integrity verification method based on USBKey in this embodiment includes the following steps: S1, the software obtains the absolute path of its binary program after startup ; S2, the absolute path of the binary program Passed to the verification service through the software integrity verification interface, such as Figure 3 As shown, during the software design and development phase, that is, at the program's running entry, a call to the software integrity check interface is added, so that the packaged software can automatically initiate a call to the software integrity check interface after startup; S3, reads the binary file content of the software through the verification service ,Right now: ), In the above formula, A read function for reading the binary file content of the software; S4, calculate the binary file content by using the digest algorithm specified in USBKey or directly using the specified digest algorithm Summary value of ; S5, using 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 collection of software signature mappings stored in the USBKey The signature value of Indicates the specified digest algorithm; in this embodiment, the specified encryption algorithm is the SM2 algorithm, and the specified digest algorithm is the SM3 algorithm, then the above formula is: ; In the above formula, represents the SM2 algorithm, Represents the SM3 algorithm; if the signature mapping set If the verification result is passed, jump to the next step; otherwise, the software stops running and exits; S6, from the signature mapping set Search for software integrity signatures in : ; In the above formula, is a collection of software signature mappings, each element is , The path is The signature value of the software; find and Same signature value , that is The corresponding signature value .
[0029] S7, use the following formula according to 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. is the signature public key, 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; the encryption algorithm specified in this embodiment is the SM2 algorithm, and the digest algorithm specified is the SM3 algorithm, then the above formula is: ; In the above formula, represents the SM2 algorithm, Indicates the SM3 algorithm; if the software integrity verification result is passed, the software continues to run, otherwise the software stops running and exits. Figure 2 As shown, after the software is started, the USBKey component is automatically called to perform 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 check interface will record the audit log. If the software runs normally but there is no audit log, it means that the software does not use 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 Intelligent Password Key Password Application Interface Specification" can be used as the USBKey relied on by the present invention. USBKey has the characteristics of being simple and easy to use and having a unified interface.
[0030] In step S6 of this embodiment, from the signature mapping Search for software integrity signatures in The function expression is: , In the above formula, is a software signature mapping collection, a software signature mapping collection Each element in is , Indicates splicing, The path is The signature value of the software; the mapping from the signature Search for software integrity signatures in When searching for a path with the absolute path to the binary program Same signature value This is the absolute path to 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.
[0031] In this embodiment, the software signature mapping set stored in USBKey The generation includes: S101, obtaining a signature mapping for each to-be-signed file of the software, including: Get the absolute path P of the file to be signed; Read the contents of the binary file pointed to by the absolute path P ,Right now: ; Compute the binary file content using the specified digest algorithm Summary value of ,Right now: ; Use the specified encryption algorithm and signature private key Calculating summary values Signature ,Right now: ; In the above formula, Represents the SM2 algorithm; The absolute path P of the file to be signed and the signature Splice to get the signature mapping of the file to be signed ,Right now: , In the above formula, Indicates splicing; S102: Map the signatures of all files to be signed Splice to get the software signature mapping set ,Right now: , In the above formula, Indicates splicing, ~ They represent the signature mappings of n signed software respectively. is a collection of signature mappings.
[0032] In this embodiment, in step S5, the USBKey uses a specified encryption algorithm to verify the software signature mapping set stored in the USBKey according to the following formula: Previously, this also included generating a collection of software signature mappings And store it in USBKey: S201, the signature server receives the file to be signed submitted after the software is built; S202, the signature server calculates the signature value of the file to be signed based on the USBKey; S203: The signature server constructs the software signature mapping set using the signature value and the file to be signed. , construct the software signature mapping set That is, the steps described in steps S101 and S102 above; Figure 3 As shown, after the software is packaged, the build result is transmitted to the signature server, and the signature server uses the signature calculation device to calculate the signature value of the file to be signed, that is, to provide signature services; S204, the signature server maps the signature Submit to the signature storage server; Figure 4 As shown, the signature service needs to be signed data (signature mapping ) storage, and then store the signature in the server for later use; S205, mapping the signature stored in the signature storage server Write to USBKey.
[0033] In this embodiment, in step S205, the signature stored in the signature storage server is mapped to Writing to USBKey includes: S301: Requesting a software signature mapping set from a signature storage server And the signature public key ; S302, use USBKey's own signature private key Mapping software signatures to collections 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. is a software signature mapping set; when the SM2 algorithm is used as the specified encryption algorithm, the specified encryption algorithm It can be expressed as . S303, mapping the software signature to a set , signature mapping The 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 collection The signature value ) and the signature public key .
[0034] In this embodiment, the signature private key of USBKey itself is used. Mapping software signatures to collections Get the signature mapping set using the specified encryption algorithm The 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, an 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.
[0035] Figure 6 The following is a timing diagram of software running integrity check provided in this embodiment. The software in the diagram is "application software". Its running integrity check timing 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 The 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 it directly uses the specified digest algorithm to calculate the binary file content Summary value of In addition, USBKey can also be used to calculate the contents of binary files Summary value of ; (9), the verification service sends the software summary value and 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 executes 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, that is, continues execution or stops execution.
[0036] Figure 7 This is a software signature timing diagram provided in this embodiment, and 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 executes software compilation and packaging to generate a compilation result; (3) the software compilation and packaging tool sends the compilation result and the 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 the 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).
[0037] Figure 8 The timing diagram of requesting software signature mapping provided in this embodiment shows the timing diagram of requesting software signature mapping from the signature storage server, using the USBKey's own signature key to sign and then storing it in the USBKey device, wherein the timing includes: (1), the operator inserts the USBKey on the client; (2), the operator resets the USBKey; (3), the operator generates the internal signature key of the USBKey; (4), the USBKey returns to the running state of generating the internal signature key; it should be noted that Figure 8 (2) to (4) in the rectangular dotted box of opt are optional operations; (5) the operator requests the signature storage server to map the signature on the client. ; (6), the signature storage server returns the signature mapping ; (7), USBKey uses internal signature key to sign the mapping Sign; (8), USBKey returns a completion message to the operator's client; (9), the operator disconnects USBKey.
[0038] Fig. 9 A timing diagram for resetting USBKey and requesting software signature mapping provided in this embodiment, which represents a timing diagram of first updating the signature key of the USBKey device storing the software signature, then requesting the software signature mapping from the signature storage server, and signing with the updated signature key of the USBKey itself and storing it in the USBKey device, wherein the timing includes: (1), the operator inserts the USBKey on the client; (2), the operator resets the USBKey; (3), the operator generates the internal signature key of the USBKey; (4), the USBKey returns the public key for generating the so-called internal signature key; (5), the operator generates the public key certificate of the internal signature key on the client; (6), the operator imports the public key certificate of the internal signature key to the USBKey on the client; (7), the operator requests the signature public key of the software signature from the signature storage server on the client ; (8), the signature storage server returns the signature public key ; (9), USBKey stores the signature public key ; (10), USBKey returns the operation status message to the operator's client. If the storage is successful, the USBKey can be disconnected.
[0039] In summary, the method of this embodiment mainly has the following characteristics: 1. Use commercial secret algorithms to calculate the signatures of software packages, binary files or key files: This embodiment uses commercial secret algorithms SM2 and SM3 with higher computational efficiency and stronger security to calculate the signature value of the software, and does not rely on international algorithms such as SHA256 and RSA; 2. Use USBKey to store software signatures and signature public key certificates: The software signature value is stored using USBKey, and software and hardware are distributed in different ways; USBKey has dedicated access control, and the software signature stored in USBKey is signed by the internal signature key of USBKey, which can ensure that the stored software is 1. The signature of the software is secure and will not be tampered with without authorization; 2. Use USBKey as a software integrity verification device: The USBKey device integrates the SM3 hash algorithm and the SM2 signature verification algorithm. When calculating the software integrity, the cryptographic operation occurs inside the USBKey device, not in the memory, and the calculation process is safe; 3. Ensure that the software is always complete from generation to operation: the software, software signature and signature public key are stored separately. When the software is running, the verification service first verifies the integrity of the software signature stored in the USBKey, and then uses the USBKey to verify the integrity of the software. If there is a problem in any link, the software integrity cannot be verified. This embodiment uses commercial secret algorithms SM2 and SM3 to replace international algorithms such as RSA, SHA256, AES, etc. to realize the generation and verification of software integrity verification, and the software signature value used to verify the software integrity is stored in a secure USBKey device, rather than in the file system of the operating system; when performing software integrity verification, the cryptographic operation occurs inside the USBKey device to ensure the security of the integrity operation. The software developer calls the software integrity verification interface provided by the verification service in the code in advance to ensure that the software can call the verification service to ensure its own integrity during operation; after the software is compiled, the signature server is called, and the signature server uses the signature calculation device to calculate the software signature for the target file. The SM2 and SM3 algorithms used by the signature calculation device are consistent with the SM2 and SM3 algorithms in the USBKey device that stores and calculates the software integrity; after the signature server completes the calculation of the software signature for the target file, it will construct a signature mapping according to predetermined rules and store it 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 requested from the signature storage server will be signed with the internal signature key and stored inside the USBKey, and the signature of the software signature file is also stored inside the USBKey; the signature public key certificate used to verify the software signature is also requested from the signature storage server and stored in the USBKey.When the software is running, the software integrity verification interface pre-called in the code flow will be called to perform software integrity verification; the software integrity verification interface is implemented in the verification service, and the verification service itself also relies on the internally implemented software integrity verification interface to ensure its own integrity; the verification service interacts with the driver layer of the USBKey, first verifying the integrity of the signature value stored in the USBKey through the USBKey standard interface, and then obtaining the signature value of the target file from the USBKey according to the rules, and using the SM3 summary algorithm interface of the USBKey to calculate the summary of the target file, and then using the SM2 signature verification interface of the USBKey to verify the integrity of the software; 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. This embodiment generates software integrity signature values and verifies software integrity by using commercial secret algorithms SM2 and SM3. The storage, access, and transmission of software signature values are carried by the USBKey hardware device, which ensures the security of the software integrity verification value, and the software integrity verification operation is implemented inside the USBKey device, which ensures the security of the integrity operation process. The signature calculation device and the signature verification device have the same commercial secret algorithm implementation and comply with the recommended standards of the Chinese cryptographic industry.
[0040] In addition, this embodiment also provides a USBKey-based software integrity verification system, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the USBKey-based software integrity verification method.
[0041] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the USBKey-based software integrity verification method through a processor.
[0042] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the USBKey-based software integrity verification method through a processor.
[0043] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0044] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
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 verification interface; Read the binary file contents of the software through the verification service ; Calculate the binary file content by 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 collection 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. is the signature public key, Sign the integrity of the software, 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 method for checking software integrity based on USBKey according to claim 1, characterized in that: The from signature mapping Search for software integrity signatures in The function expression is: , In the above formula, is a software signature mapping set, a software signature mapping set Each element in is , Indicates splicing, The path is The signature value of the software; the mapping from the signature Search for software integrity signatures in When searching for a path with the absolute path to the binary program Same signature value This is the absolute path to 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 a signature mapping for each to-be-signed file of the software, including: obtaining the absolute path P of the to-be-signed file; reading the binary file content B pointed to by the absolute path P p , using the specified digest algorithm to calculate the binary file content Summary value of , using the specified encryption algorithm and signature private key Calculating summary values Signature , the absolute path P of the file to be signed and the signature Splice to get the signature mapping of the file to be signed ; Map the signatures of all files to be signed Splice to get the software signature mapping set .
4. The method for checking software integrity 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, this also included generating a collection of software signature mappings 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 Write to USBKey.
5. The method for checking software integrity 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 a software signature mapping set from the signature storage server And the signature public key ; Use USBKey's own signature private key Mapping software signatures to collections Get the signature mapping using the specified encryption algorithm The 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 collection of software signature mappings; Mapping software signatures to collections , signature mapping collection The signature value And the signature public key Write to USBKey.
6. The USBKey-based software integrity verification method according to claim 5, characterized in that: The use of USBKey's own signature private key Mapping software signatures to collections Get the signature mapping set using the specified encryption algorithm The signature value Previously, it also included generating the USBKey's own signature private key when the USBKey initializes the signature key or resets the signature key .
7. The USBKey-based software integrity verification method 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 described in 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 described in 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 described in 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
Double wrapping for verification
US20210200874A1
Secure booting method, apparatus and system
WO2023051262A1
