WO2021114918A1 - Integrity checking method and apparatus, terminal device and verification server - Google Patents

Integrity checking method and apparatus, terminal device and verification server Download PDF

Info

Publication number
WO2021114918A1
WO2021114918A1 PCT/CN2020/124157 CN2020124157W WO2021114918A1 WO 2021114918 A1 WO2021114918 A1 WO 2021114918A1 CN 2020124157 W CN2020124157 W CN 2020124157W WO 2021114918 A1 WO2021114918 A1 WO 2021114918A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
hash tree
root node
target
verification
Prior art date
Application number
PCT/CN2020/124157
Other languages
French (fr)
Chinese (zh)
Inventor
李永凯
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021114918A1 publication Critical patent/WO2021114918A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules

Definitions

  • This application belongs to the field of terminal technology, and in particular relates to integrity verification methods, devices, terminal equipment, verification servers, and computer-readable storage media.
  • Integrity verification refers to the technical means of verifying the accuracy of files to detect whether the files have been tampered with illegally.
  • files downloaded or applied by terminal devices are easily tampered with illegally. Therefore, how to verify the integrity of downloaded files or application files of terminal devices has become an urgent problem for those skilled in the art.
  • the embodiments of the application provide an integrity verification method, device, terminal equipment, verification server, and computer-readable storage medium, which can solve the need to separately sign all files in the existing integrity verification, which causes a large amount of calculation.
  • the problem can solve the need to separately sign all files in the existing integrity verification, which causes a large amount of calculation.
  • an embodiment of the present application provides an integrity check method, which is applied to a terminal device, and the integrity check method includes:
  • the file to be verified sent by the file server and the integrity check information of the file to be verified, where the integrity check information includes the root obtained by signing the target root node of the target hash tree with the first signature private key Node signature information, child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, and the target hash tree is based on the file Hash tree constructed by all files in the server;
  • the integrity of the file to be verified is verified according to the current root node and the target root node.
  • the integrity check of the downloaded file of the terminal device is performed by using the hash tree and the signature of the root node of the hash tree, so that the integrity check can be completed only by signing the root node. Signing each file greatly reduces the amount of signature calculation and eases the calculation burden.
  • the method includes:
  • target version verification information of the file to be verified is version verification information generated according to the target file version of the file to be verified
  • the true version of the file to be verified can be verified in a cryptographically safe manner, so as to reduce the risk of file replacement and replay attacks.
  • the target version verification information is chameleon signature information generated according to the target file version and the device identifier of the terminal device;
  • the verifying the version legality of the file to be verified according to the current file version of the file to be verified and the target version verification information includes:
  • the target file version is signed by the chameleon signature algorithm to use the non-repudiation, non-interactivity, and non-transmission characteristics of the chameleon signature to ensure the unique legitimacy of the version information and reduce the risk of leakage.
  • the method includes: obtaining according to the device identification The device private key corresponding to the terminal device.
  • the embodiment of the present application may also generate the target version verification information corresponding to the file to be verified by generating a version hash tree and signing the root node of the version hash tree.
  • the obtaining the target version verification information of the file to be verified includes:
  • the target version verification information is the target file version of the file to be verified sent by the file server and the receiving station according to the verification server.
  • the version verification information generated by the device identifier of the terminal device of the file to be verified.
  • the target version verification information of the file to be verified can be generated by the verification server to realize risk sharing, thereby reducing the risk of the target version verification information being attacked.
  • the target hash tree is a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, reduce the integrity check information required for the integrity check, and reduce the bandwidth occupation.
  • an embodiment of the present application provides an integrity verification method, which is applied to a verification server, and the integrity verification method includes:
  • the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key, and the private signature information with the first signature.
  • each terminal device is verified according to the local root node and the target root node.
  • the terminal device is checked for integrity by using the hash tree and the root node signature of the hash tree, so that both the terminal device and the verification server only need to sign the root node of the related hash tree, and There is no need to sign every file, which greatly reduces the calculation amount of the terminal device and the verification server, and eases the calculation burden of the terminal device and the verification server.
  • the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
  • the first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
  • the second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
  • the process of constructing the secondary initial hash tree by the aggregation gateway includes:
  • the second-level initial hash tree is constructed according to the first-level initial root node of each first-level initial hash tree.
  • the terminal device when constructing the first-level initial hash tree, can first sort the target files in the terminal device according to the first preset sorting method, and then can construct the corresponding terminal device according to the sorted target files.
  • the first preset sorting method may be a sorting method in ascending order (a ⁇ z) according to the first letter of the file name f_req, or may be a sorting method in descending order (z ⁇ a) according to the first letter of the file name f_req.
  • the aggregation gateway may first sort the terminal devices corresponding to the aggregation gateway according to the second preset sorting method, and then may according to the first-level initial hash tree corresponding to the sorted terminal devices
  • the first-level initial root node of is constructed the second-level initial hash tree corresponding to the aggregation gateway.
  • the second preset sorting method may be a sorting method from small to large according to the device identification (such as ID number) of the terminal device, or may be a small to large sorting manner according to the device identification (such as ID number) of the terminal device. The sorting method.
  • the calculation amount of the verification server can be effectively reduced, and the calculation burden of the verification server can be alleviated.
  • the method before the obtaining the local root node of the local hash tree, the method includes:
  • the local hash tree is constructed according to each of the second-level local root nodes.
  • the request files corresponding to the terminal device can be sorted according to the first preset sorting method used in the construction of the aforementioned first-level initial hash tree, and The first-level local hash tree corresponding to the terminal device can be constructed according to the sorted request files.
  • the terminal devices corresponding to the aggregation gateway can be sorted according to the second preset sorting method used in the construction of the aforementioned secondary initial hash tree, and
  • the second-level local hash tree corresponding to the aggregation gateway can be constructed according to the first-level local root node of the first-level local hash tree corresponding to the sorted terminal device, that is, during the construction of the local hash tree and the target hash tree, pass Use the same preset sorting method to sort the root nodes at all levels to avoid different hash values caused by different sorts and affect the integrity check result.
  • the checking the integrity of each terminal device according to the local root node and the target root node includes:
  • the local root node and the target root node are not the same, obtain a verification result that the integrity check of the terminal device fails, and compare the local hash tree with the target hash tree;
  • a target terminal device that fails the integrity check is determined.
  • the local hash tree and the target hash tree are both ternary hash trees, so as to reduce the level of the hash tree through the ternary hash tree, reduce the amount of signature calculation, and at the same time, it is convenient to quickly locate the integrity damage Terminal equipment.
  • an embodiment of the present application provides an integrity verification device, which is applied to a terminal device, and the integrity verification device includes:
  • the file obtaining module is used to obtain the file to be verified sent by the file server and the integrity check information of the file to be verified, and the integrity check information includes the target of the target hash tree using the first signature private key
  • the tree is a hash tree constructed based on all files in the file server;
  • a signature information verification module configured to use the first signature public key to verify the root node signature information
  • the current root node construction module is configured to construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes when the root node signature information is verified;
  • the integrity check module is used to check the integrity of the file to be checked according to the current root node and the target root node.
  • the integrity verification device further includes:
  • a version verification information acquisition module configured to acquire target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
  • the version legitimacy verification module is configured to verify the version legitimacy of the file to be verified according to the current file version of the file to be verified and the target version verification information.
  • the target version verification information is chameleon signature information generated according to the target file version and the device identification of the terminal device;
  • the version legality check module includes:
  • the first hash value calculation unit is configured to calculate the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
  • the second hash value calculation unit is configured to use the second signature public key in the chameleon signature information to calculate the second chameleon hash value corresponding to the chameleon signature information;
  • the version legitimacy verification unit is configured to verify the version legitimacy of the file to be verified according to the first chameleon hash value and the second chameleon hash value.
  • the integrity verification device further includes:
  • the device private key obtaining module is configured to obtain the device private key corresponding to the terminal device according to the device identifier.
  • the version verification information obtaining module is specifically configured to obtain the target version verification information of the file to be verified sent by the verification server, and the target version verification information is the verification server according to the file The target file version of the file to be verified sent by the server and version verification information generated by the device identifier of the terminal device that receives the file to be verified.
  • the target hash tree is a trigeminal hash tree.
  • an embodiment of the present application provides an integrity verification device, which is applied to a verification server, and the integrity verification device includes:
  • the integrity information obtaining module is used to obtain the integrity check information of each terminal device.
  • the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key And a first signature public key corresponding to the first signature private key;
  • a signature information verification module configured to verify the initial root node signature information by using the first signature public key
  • a hash tree construction module configured to construct a target hash tree according to the initial root node when the initial root node signature information is verified;
  • a root node obtaining module configured to obtain the local root node of the local hash tree and the target root node of the target hash tree;
  • the integrity check module is used to check the integrity of each terminal device according to the local root node and the target root node.
  • the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
  • the first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
  • the second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
  • the aggregation gateway includes:
  • a signature public key acquisition unit configured to acquire a second signature public key sent by each of the terminal devices
  • the signature information verification unit is configured to use each of the second signature public keys to verify the first-level root node signature information sent by each of the terminal devices;
  • the hash tree construction unit is configured to construct the second-level initial hash tree according to the first-level initial root node of each first-level initial hash tree when the signature information of each of the first-level root nodes is verified.
  • the integrity verification device further includes:
  • a request file obtaining module configured to obtain a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
  • a first-level local hash tree construction module configured to construct a first-level local hash tree corresponding to each terminal device according to the request file, and obtain the first-level local root node of each first-level local hash tree;
  • the second-level local hash tree building module is used to construct the second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtain the second-level local hash tree of each of the second-level local hash trees. Root node
  • the local hash tree construction module is used to construct the local hash tree according to each of the second-level local root nodes.
  • the integrity check module includes:
  • a verification result obtaining unit configured to obtain a verification result that the integrity verification of the terminal device passes if the local root node is the same as the target root node;
  • a hash tree comparison unit configured to obtain a verification result that the integrity check of the terminal device fails if the local root node is different from the target root node, and compare the local hash Tree and the target hash tree;
  • the target terminal device determining unit is configured to determine the target terminal device that fails the integrity check according to the comparison result of the local hash tree and the target hash tree.
  • the local hash tree and the target hash tree are both trigeminal hash trees.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the computer program, The integrity verification method described in any one of the above-mentioned first aspects is implemented.
  • an embodiment of the present application provides a verification server, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • a verification server including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the computer program, The integrity verification method described in any one of the above-mentioned second aspects is implemented.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the first or second aspects described above is implemented.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the integrity verification method described in any one of the above-mentioned first aspects.
  • an embodiment of the present application provides a computer program product, which when the computer program product runs on a verification server, causes the verification server to execute the integrity verification method described in any one of the above second aspects.
  • FIG. 1 is a system schematic diagram of an integrity verification system provided by an embodiment of the present application
  • FIG. 2 is a system schematic diagram of an integrity verification system provided by another embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a mobile phone to which the integrity verification method provided by an embodiment of the present application is applicable;
  • FIG. 4 is a schematic diagram of a software architecture to which the integrity verification method provided by an embodiment of the present application is applicable;
  • FIG. 5 is a schematic flowchart of an integrity verification method provided by an embodiment of the present application.
  • Fig. 5a is an example diagram of a three-layer target hash tree constructed by an embodiment of the present application.
  • FIG. 5b is an example diagram of a hash tree provided by an embodiment of the present application.
  • FIG. 5c is an example diagram of a hash tree constructed by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an integrity verification method provided by another embodiment of the present application.
  • Fig. 6a is an example diagram of a hash tree constructed by another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an integrity verification device provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an integrity verification device provided by another embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of a verification server provided by an embodiment of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • the file may include the download file of the terminal device and the application file in the terminal device.
  • the downloaded file refers to a file that the terminal device has just downloaded from the file server and has not yet been applied.
  • the application file refers to the file running or in use on the terminal device
  • hash values are calculated separately for all files in advance, and each hash value is separately signed and saved, so as to verify the integrity of the file according to the saved signature result.
  • This method of separately signing all files requires a server or terminal device to perform a large number of signature operations, which greatly increases the calculation amount of the server or terminal device, and causes a heavy calculation burden on the server or terminal device.
  • the embodiments of the present application provide an integrity verification method, an integrity verification device, an integrity verification system, a terminal device, a verification server, and a computer-readable storage medium, which can be achieved by using a hash tree and The integrity check is performed only by signing the root node of the hash tree, without signing each file, which can reduce the calculation amount of the server or terminal device and alleviate the calculation burden of the server or terminal device.
  • the integrity verification system may include a terminal device 10, a file server 11, a verification server 12, and a key Management server 13.
  • the terminal device 10 may be in communication connection with the file server 11, the verification server 12, and the key management server 13 respectively.
  • the file server 11 may also be in communication connection with the verification server 12 and the key management server 13 respectively.
  • the verification server 12 may also be in communication connection with the key management server 13.
  • the key management server 13 may distribute corresponding signature keys to the terminal device 10, the file server 11, the verification server 12, and the like.
  • the file server 11 may construct a target hash tree corresponding to all files in the file server 11 in advance, and may send the root node of the target hash tree to the verification server 12 for signing.
  • the verification server 12 can sign the root node of the target hash tree by obtaining the signature private key from the key management server 13, and can return the signature result and the signature public key to the file server 11.
  • the file server 11 sends a file to the terminal device 10 based on the file acquisition request of the terminal device 10, it may also send the integrity check information corresponding to the file (including the signature result, the signature public key, and the signature public key).
  • the child nodes related to the file in the target hash tree are sent to the terminal device 10.
  • the terminal device 10 After the terminal device 10 obtains the file and the integrity check information, it can first verify the signature result according to the signature public key. When the signature result is verified, it can be based on the file and the integrity check information. The child nodes in constructs the current root node corresponding to the target hash tree; subsequently, the current root node can be compared with the root node of the target hash tree contained in the signature result to determine the file Completeness.
  • the verification server or the file server only needs to sign the root node of the target hash tree, and does not need to sign each file, which greatly The calculation amount of the verification server or the file server is reduced, and the calculation burden of the verification server or the file server is alleviated.
  • the integrity verification system may further include an aggregation gateway 14.
  • the aggregation gateway 14 may be in communication connection with the terminal device 10, the verification server 12, and the key management server 13 respectively.
  • performing an integrity check on each terminal device refers to performing an integrity check on an application file in each terminal device.
  • the verification server 12 may obtain each request file sent by the file server 11 in advance, and may construct a local hash tree according to each request file. Wherein, each requested file sent by the file server 11 is a file requested by each terminal device 10 from the file server 11.
  • the verification server 12 may send an integrity check request to each of the terminal devices 10.
  • each terminal device 10 After each terminal device 10 receives the integrity check request, it can obtain the target file in each terminal device 10 to construct the first-level initial hash tree corresponding to each terminal device, and can obtain each first-level initial hash tree.
  • the first-level initial root node of the hash tree; then the first-level initial root node of each first-level initial hash tree can be signed by obtaining the first signature private key from the key management server 13, and
  • the initial integrity verification information including the first signature result is sent to the corresponding aggregation gateway 14.
  • Each aggregation gateway 14 can use the corresponding first signature public key to verify the first signature result in each initial integrity check information.
  • each aggregation gateway 14 After each first signature result is verified, each aggregation gateway 14 then The second-level initial hash tree corresponding to each aggregation gateway can be constructed according to the first-level initial root node of each first-level initial hash tree; then the second-level initial root node of each second-level initial hash tree can be obtained, and The second-level initial root node of the second-level initial hash tree can be signed by obtaining the second signature private key from the key management server 13, and the integrity check information containing the second signature result can be signed. Send to the verification server 12. The verification server 12 can use the corresponding second signature public key to verify each second signature result in each integrity verification information.
  • the verification server 12 can The target hash tree is constructed according to the second-level initial root node of each second-level initial hash tree, and the target root node of the target hash tree can be compared with the local root node of the local hash tree to determine each The integrity of the terminal equipment.
  • both the terminal device 10 and the aggregation gateway 14 when performing integrity verification on a terminal device, both the terminal device 10 and the aggregation gateway 14 only need to sign the root node of the relevant hash tree, instead of signing every file.
  • the calculation amount of the terminal device 10 and the aggregation gateway 14 is greatly reduced, and the calculation burden of the terminal device 10 and the aggregation gateway 14 is alleviated.
  • the terminal device 10 may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer).
  • AR augmented reality
  • VR virtual reality
  • UMPC netbooks
  • PDAs personal digital assistants
  • Fig. 3 shows a block diagram of a part of the structure of a mobile phone provided in an embodiment of the present application.
  • the mobile phone includes: a radio frequency (RF) circuit 310, a memory 320, an input unit 330, a display unit 340, a sensor 350, an audio circuit 360, a wireless fidelity (WiFi) module 370, and a processor 380 , And power supply 390 and other components.
  • RF radio frequency
  • the RF circuit 310 can be used for receiving and sending signals during the process of sending and receiving information or talking. In particular, after receiving the downlink information of the base station, it is processed by the processor 380; in addition, the designed uplink data is sent to the base station.
  • the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • the RF circuit 310 can also communicate with the network and other devices through wireless communication.
  • the above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile Communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • Email Short Messaging Service
  • the memory 320 may be used to store software programs and modules.
  • the processor 380 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 320.
  • the memory 320 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of mobile phones (such as audio data, phone book, etc.), etc.
  • the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 330 may be used to receive inputted digital or character information, and generate key signal input related to user settings and function control of the mobile phone.
  • the input unit 330 may include a touch panel 331 and other input devices 332.
  • the touch panel 331 also called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 331 or near the touch panel 331. Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 331 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 380, and can receive and execute the commands sent by the processor 380.
  • the touch panel 331 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the input unit 330 may also include other input devices 332.
  • the other input device 332 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • the display unit 340 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 340 may include a display panel 341.
  • the display panel 341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • the touch panel 331 can cover the display panel 341. When the touch panel 331 detects a touch operation on or near it, it transmits it to the processor 380 to determine the type of the touch event, and then the processor 380 determines the type of the touch event. The type provides corresponding visual output on the display panel 341.
  • the touch panel 331 and the display panel 341 are used as two independent components to realize the input and input functions of the mobile phone, but in some embodiments, the touch panel 331 and the display panel 341 can be integrated. Realize the input and output functions of the mobile phone.
  • the mobile phone may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor can include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display panel 341 according to the brightness of the ambient light.
  • the proximity sensor can close the display panel 341 and/or when the mobile phone is moved to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when it is stationary.
  • the audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the mobile phone.
  • the audio circuit 360 can transmit the electrical signal converted from the received audio data to the speaker 361, and the speaker 361 converts it into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is then output by the audio circuit 360. After being received, it is converted into audio data, and then processed by the audio data output processor 380, and sent to, for example, another mobile phone via the RF circuit 310, or the audio data is output to the memory 320 for further processing.
  • WiFi is a short-distance wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 370. It provides users with wireless broadband Internet access.
  • FIG. 3 shows the WiFi module 370, it is understandable that it is not a necessary component of the mobile phone, and can be omitted as needed without changing the essence of the invention.
  • the processor 380 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes by running or executing software programs and/or modules stored in the memory 320, and calling data stored in the memory 320. Various functions and processing data of the mobile phone can be used to monitor the mobile phone as a whole.
  • the processor 380 may include one or more processing units; preferably, the processor 380 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 380.
  • the mobile phone also includes a power source 390 (such as a battery) for supplying power to various components.
  • a power source 390 such as a battery
  • the power source can be logically connected to the processor 380 through a power management system, so that functions such as charging, discharging, and power management can be managed through the power management system.
  • the mobile phone may also include a camera.
  • the position of the camera on the mobile phone may be front-mounted or rear-mounted, which is not limited in the embodiment of the present application.
  • the mobile phone may include a single camera, a dual camera, or a triple camera, etc., which is not limited in the embodiment of the present application.
  • a mobile phone may include three cameras, of which one is a main camera, one is a wide-angle camera, and one is a telephoto camera.
  • the multiple cameras may be all front-mounted, or all rear-mounted, or partly front-mounted and another part rear-mounted, which is not limited in the embodiment of the present application.
  • the mobile phone may also include a Bluetooth module, etc., which will not be repeated here.
  • Fig. 4 is a schematic diagram of the software structure of a mobile phone according to an embodiment of the present application.
  • the Android system is divided into four layers, namely the application layer, the application framework layer (framework, FWK), the system layer, and the hardware abstraction layer. Through the software interface communication between.
  • the application layer can be a series of application packages, which can include applications such as short message, calendar, camera, video, navigation, gallery, and call.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer may include some predefined functions, such as functions for receiving events sent by the application framework layer.
  • the application framework layer can include a window manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • the application framework layer can also include:
  • a view system which includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the mobile phone. For example, the management of the call status (including connecting, hanging up, etc.).
  • the system layer can include multiple functional modules. For example: sensor service module, physical state recognition module, 3D graphics processing library (for example: OpenGL ES), etc.
  • the sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer to determine the physical state of the mobile phone;
  • Physical state recognition module used to analyze and recognize user gestures, faces, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the system layer can also include:
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the hardware abstraction layer is the layer between hardware and software.
  • the hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., used to drive related hardware at the hardware layer, such as display screens, cameras, sensors, and so on.
  • the integrity verification method provided by the first embodiment can be implemented on a mobile phone with the above hardware structure/software structure to verify the integrity of the downloaded file of the mobile phone, that is, after the mobile phone downloads the file from the file server, it can be used in the application
  • the integrity of the file was previously verified by the integrity verification method provided in this embodiment to ensure that the file downloaded by the mobile phone is a file that has not been tampered with, has a legal version, and has a traceable source.
  • the integrity verification method provided in this embodiment will be described in detail below in conjunction with the integrity verification system shown in FIG. 1.
  • the integrity verification method provided in this embodiment may include:
  • S501 Obtain a file to be verified sent by a file server and integrity verification information of the file to be verified, where the integrity verification information includes signing the target root node of the target hash tree using the first signature private key.
  • the root node signature information of the target hash tree, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, and the target hash tree is based on the The hash tree constructed by all the files in the file server;
  • the file server may construct a target hash tree corresponding to all files in the file server, and may sign the target root node of the target hash tree to Obtain the root node signature information corresponding to the target root node.
  • the file server may also send the target root node of the target hash tree to the verification server, and the verification server may sign the target root node, and may send the root node signature information obtained by the signature
  • the signature public key corresponding to the signature is returned to the file server to achieve the purpose of generating the target root node and separating the signature, and reduce the risk of the root node signature information being attacked.
  • the file server or the verification server may sign the target root node by obtaining the signature key (including the first signature private key and the first signature public key) from the key management server, Specifically, the target root node may be signed by the first signature private key.
  • the signature key may be a signature key corresponding to any signature algorithm, which is not limited in this embodiment.
  • signature validity time information can also be added to shorten the validity time of the root node signature information, reduce the attack time window for the root node signature information to be attacked, and reduce the root node signature information Risk of being attacked.
  • the target hash tree may be a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, and reduce the integrity check information required for the integrity check. Reduce bandwidth usage.
  • the leaf node of the target hash tree may be the file name of any file in the file server and the hash value of the file metadata of the file, and other nodes except the leaf node may be It is the hash value of all child nodes of this node.
  • Figure 5a shows an example diagram of a three-layer target hash tree constructed by the file server.
  • the leaf node H_leaf i of one layer in the three-layer target hash tree can be H(f_i
  • the child node H_father j of the second layer can be H(H_leaf i-1
  • the target root node H_root can be H(H_father 1
  • f_i is the file name
  • matadata i is the metadata
  • is the connector
  • H is the hash function.
  • the hash function may be a secure hash function (for example, SHA-256), or any other type of hash function, which is not limited in this embodiment.
  • the file server can send the file to the mobile phone, and can send the integrity check information corresponding to the file to the mobile phone.
  • the file obtained by the mobile phone is the file to be verified in S601.
  • the integrity verification information may include signature information of the root node of the target hash tree corresponding to the file to be verified, child nodes in the target hash tree that are related to the file to be verified, and the first A signature public key.
  • the root node signature information is information obtained by the file server or the verification server using the first signature private key to sign the root node of the target hash tree, and the first signature public key and the The first signature private key corresponds.
  • the child nodes related to the file to be verified in the target hash tree may include leaf nodes in the target hash tree that belong to the same parent node H_father j as the file to be verified, and from the parent node H_father j to the target root node. The child nodes on the full hash path and the target root node.
  • the child nodes on the complete hash path from the parent node H_father j to the target root node refer to all child nodes required by the parent node H_father j to start generating the target root node of the target hash tree.
  • the parent node H_father 2 corresponding to H_leaf 6 to the target root node H_root is complete
  • the child nodes on the hash path may include H_father 1 and H_father 3 , that is, the child nodes related to the file to be verified f_6 in the target hash tree may include leaf nodes H_leaf 4 , leaf nodes H_leaf 5 , and child nodes H_father 1 , Child node H_father 3 and root node H_root.
  • the parent node H_ffather 2 corresponding to H_leaf 6 to the target root node H_root is complete
  • the child nodes on the hash path may include H_ffather 1 , H_ffather 3 , H_sfather 1 , H_sfather 3 , H_tfather 2 and H_tfather 3 , that is, the child nodes related to the file to be verified f_6 in the target hash tree may include leaf nodes H_leaf 4.
  • Leaf node H_leaf 5 child node H_ffather 1 , child node H_ffather 3 , child node H_sfather 1 , child node H_sfather 3 , child node H_t father 2 and child node H_tfather 3, and root node H_root.
  • the integrity check information obtained by the mobile phone may include the root node signature information and the original information corresponding to the root node signature information (that is, the target root node H_root).
  • the first signature public key in the integrity verification information can be used to verify the root node signature information .
  • the integrity check information is a valid and traceable source, so as to determine whether the to-be-verified file is a valid and traceable source.
  • the verification result of the root node signature information verification passing can be obtained, wherein the verification passing indicates that the integrity verification information is
  • the verification information whose source is legal and traceable can be used for the integrity verification of the document to be verified to determine the integrity of the document to be verified and to determine whether the document to be verified is of a legitimate source and can be verified. Traceable documents.
  • the verification information H'_root and the target root node H_root are not the same, a verification result that the root node signature information verification fails can be obtained, wherein the verification failure indicates the integrity check
  • the information is not verified information whose source is legal and traceable, so that it can be directly determined that the document to be verified is a document whose source is illegal.
  • the mobile phone can verify the file to be verified as having an illegal source in the verification log of the mobile phone. The results are recorded to facilitate the subsequent review of the verification results. At the same time, the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located that the file currently obtained may be of an illegal source File to inform users of the current file download risk.
  • the mobile phone can use the file to be verified and the integrity verification information.
  • the child nodes in the verification information construct the current root node corresponding to the target hash tree.
  • the mobile phone can first calculate the file to be verified according to the file name f_6 of the file f_6 and the component metadata matadata 6 '
  • the leaf node H'_leaf 6 H(f_6
  • the mobile phone may also restore and construct the target hash tree according to the file to be verified and the child nodes, and then determine the root node of the restored target hash tree as the current root of the target hash tree Node, that is, the mobile phone can first calculate the file name of the file to be verified and the hash value of the file metadata, and can determine the calculated hash value as the leaf node corresponding to the file to be verified, and then can be based on the The leaf node and the child nodes in the integrity check information restore and construct the target hash tree.
  • the position of each node in the target hash tree constructed by the restoration is the same as the position of each node in the original target hash tree, so as to avoid the error of the node position and the calculation error of the hash value, thereby reducing the integrity The accuracy of the calibration.
  • the integrity check information may also include the position information of the leaf node corresponding to the file to be checked in the target hash tree and the position information of each of the child nodes in the target hash tree. Therefore, when the mobile phone restores and constructs the target hash tree according to the file to be verified and each child node in the integrity check information, it can combine the location information of the file to be verified with each child node. The location information of the node is restored to construct the target hash tree.
  • the mobile phone can construct the child node according to the file to be verified and the integrity check information as shown in FIG. 5c.
  • S504 Verify the integrity of the file to be verified according to the current root node and the target root node.
  • the current root node of the target hash tree may be Compare with the target root node of the target hash tree to determine the integrity of the file to be verified.
  • the verification result of the integrity verification of the file to be verified can be obtained, and the integrity verification refers to the file to be verified.
  • the mobile phone can verify the integrity of the file to be verified in the verification log of the mobile phone.
  • the failed verification results are recorded to facilitate the subsequent review of verification results.
  • the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located about the files currently obtained It may be a file whose content has been tampered with, and inform the user of the current file download risk.
  • the integrity check is performed on the downloaded file of the mobile phone by using the hash tree and the way of signing the root node of the hash tree, so that the integrity check can be completed by signing the root node only, without the need Signing each file greatly reduces the amount of signature calculation and eases the calculation burden.
  • the integrity verification when the document to be verified has a historical version, if the document to be verified in the historical version is used to replace the document to be verified in the current version and sent to the mobile phone, the mobile phone is checking the received document to be verified.
  • the mobile phone can also obtain the verification information of the target version of the file to be verified, and can be based on the current file version of the file to be verified and the target version
  • the verification information verifies the validity of the version of the file to be verified, wherein the target version verification information may be version verification information generated according to the target file version of the file to be verified.
  • the true version of the file to be verified can be verified in a cryptographically safe manner, so as to reduce the risk of file replacement and replay attacks.
  • the file server when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it can also real-time according to the target of the file to be verified.
  • the file version generates target version verification information of the file to be verified, and can send the target version verification information to the mobile phone based on the version verification information acquisition request sent by the mobile phone.
  • the file server when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also send the target file of the file to be verified in real time.
  • the version is sent to the verification server, and the verification server may generate the target version verification information of the file to be verified according to the target file version, and may verify the target version based on the version verification information acquisition request sent by the mobile phone.
  • the verification information is sent to the mobile phone to perform risk sharing by generating verification information by the verification server, thereby reducing the risk of the target version verification information being attacked.
  • the file server or the verification server may use a signature key corresponding to any signature algorithm to sign the target file version, and may use the version signature information corresponding to the target file version obtained by the signature as the all Describe the target version verification information.
  • the mobile phone may send a version verification request to the file server or the verification server to determine the verification of the file to be verified through the version verification. Check whether the file is a replacement file, etc.
  • the file server or the verification server can send the version signature information obtained by the aforementioned signature and the corresponding signature public key to the mobile phone according to the version verification request, and the mobile phone can use the received signature public key to verify the The version signature information is verified, and the verified target file version can be compared with the current file version currently received by the mobile phone.
  • the file to be verified of the current file version is a legal version, that is, the file to be verified of the current file version can be considered as a legal file sent by the file server; if the two are not the same, then It can be determined that the file to be verified of the current file version is an illegal version, that is, it can be considered that the file to be verified of the current file version may be a replacement file, indicating that the file sent by the file server to the mobile phone may have been processed by the attacker File replacement, etc.
  • the file server or the verification server may sign the target file version using the chameleon signature algorithm, that is, the target version verification information may be based on the target file version and the
  • the chameleon signature information generated by the device identifier of the terminal device uses the non-repudiation, non-interactivity, and non-transmission characteristics of the chameleon signature to ensure the unique legitimacy of the version information and reduce the risk of leakage.
  • the file server when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also use the chameleon signature algorithm to generate the information of the sent file to be verified in real time.
  • the target file version and the chameleon signature information of the device identification (such as the device ID or device number of the mobile phone, etc.) of the mobile phone receiving the file to be verified.
  • the file server when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also send the target file of the file to be verified in real time.
  • the version and the device identification of the mobile phone receiving the file to be verified are sent to the verification server, and the verification server may use the chameleon signature algorithm to generate the target file version and the chameleon signature information corresponding to the device identification to pass the verification server Perform the chameleon signature operation to share the risk, thereby reducing the risk of the target version verification information being attacked.
  • the process of generating the chameleon signature information by the verification server using the chameleon signature algorithm may specifically be:
  • the mobile phone after the mobile phone obtains the chameleon signature information of the file to be verified, it can first use the device private key obtained from the key management server and the chameleon random number in the chameleon signature information to calculate the corresponding file to be verified.
  • the first chameleon hash value of the current file version vers_f_req'h_req_ID' g vers_f_req' g rx mod p; then the signature public key (e, n) in the chameleon signature information can be used to calculate the corresponding chameleon signature information
  • the second chameleon hash value H' (sign(h_req_ID)) e mod n; finally, the version of the file to be verified can be verified according to the first chameleon hash value h_req_ID' and the second chameleon hash value H' legality.
  • the file version of the file to be verified is legal, that is, the file to be verified can be considered as the The legal file currently sent by the file server; when the first chameleon hash value h_req_ID' and the second chameleon hash value H'are not the same, it can be determined that the file version of the file to be verified is illegal, that is, it can be considered that the file version of the file to be verified is illegal.
  • the file to be verified may be a file that has been replaced or reposted.
  • the mobile phone can record the verification result that the file version of the file to be verified is illegal in the verification log of the mobile phone. , In order to facilitate the subsequent review of the verification results. At the same time, the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located that the file currently obtained may be replaced or renewed.
  • the illegal files that are posted inform users of the current file download risk.
  • the file server and/or the verification server may also generate the target version verification information corresponding to the file to be verified by generating a version hash tree and signing the root node of the version hash tree.
  • the file server when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also be based on the target file version of the file to be verified in real time. And the target file versions of all other files in the file server generate a version hash tree, and the root node of the version hash tree can be signed to generate target version verification information corresponding to the file to be verified. Or the file server may send the root node of the version hash tree to the verification server, so that the root node of the version hash tree is signed by the verification server to generate the corresponding file to be verified. The target version verification information.
  • the file server or the verification server may send the target version verification information (including the root node signature information of the version hash tree, the signature public key, and The relevant child node in the version hash tree) is sent to the mobile phone, and the mobile phone can verify the current file version of the file to be verified based on the received target version verification information.
  • the target version verification information including the root node signature information of the version hash tree, the signature public key, and The relevant child node in the version hash tree
  • the process of verifying the current file version of the file to be verified based on the version hash tree by the mobile phone is similar to the process of verifying the integrity of the file to be verified based on the target hash tree by the mobile phone.
  • the basic principle is The same, for the sake of brevity, I will not repeat them here.
  • the integrity check method provided in the second embodiment can be implemented in the verification server of the integrity check system as shown in FIG. 2 to perform integrity check on each terminal device, that is, the integrity provided by this embodiment can be used
  • the verification method performs integrity verification on the application files in each terminal device to ensure that the application files in each terminal device are files that have not been tampered with and have a legal version.
  • the integrity verification method provided in this embodiment will be described in detail below in conjunction with the integrity verification system shown in FIG. 2.
  • the integrity verification method provided by this embodiment may include:
  • the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key, and the signature information associated with the first The first signature public key corresponding to the signature private key;
  • the initial hash tree may include a first-level initial hash tree and a second-level initial hash tree, and the initial root node is the root node of the second-level initial hash tree.
  • the first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device
  • the second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each aggregation A hash tree constructed by the first-level initial hash tree of each terminal device corresponding to the gateway.
  • the first-level initial hash tree and the second-level initial hash tree are both ternary hash trees, so as to reduce the level of the hash tree through the ternary hash tree and reduce the amount of signature calculation.
  • the verification server can send an integrity verification request to each mobile phone. After each mobile phone receives the integrity verification request, it can obtain the target file in each mobile phone to construct the corresponding mobile phone.
  • the first-level initial hash tree The first-level initial hash tree. Among them, the target files in each mobile phone are all or part of the files obtained by each mobile phone from the file server.
  • any parent node in the first-level initial hash tree is the hash value of all child nodes corresponding to the parent node
  • the leaf node of the first-level initial hash tree is the file name of the target file f_req
  • the hash value of the file metadata matadata_f_req and the file version vers_f_req, that is, the leaf node Hash_f_req_ID of the first-level initial hash tree H(req_ID
  • the mobile phone when constructing the first-level initial hash tree, the mobile phone can first sort the target files corresponding to the mobile phone according to the first preset sorting method, and then construct a corresponding target file of the mobile phone according to the sorted target files.
  • the first preset sorting method may be a sorting method in ascending order (a ⁇ z) according to the first letter of the file name f_req, or may be a sorting method in descending order (z ⁇ a) according to the first letter of the file name f_req.
  • the mobile phone ID1 can construct the first-level initial hash tree corresponding to the mobile phone ID1 according to the target files in the mobile phone ID1 (f1_req_ID1 to f3_req_ID1), and the mobile phone ID2 can construct the mobile phone according to the target files in the mobile phone ID2 (f1_req_ID2 to f9_req_ID2)
  • the first-level initial hash tree corresponding to ID2 the mobile phone ID3 can construct the first-level initial hash tree corresponding to the mobile phone ID3 according to the target files (f1_req_ID3 to f3_req_ID3) in the mobile phone ID3.
  • f1_req_ID1 is the first target file sorted according to the aforementioned first preset sorting method in the mobile phone ID
  • f3_req_ID1 is the third target file sorted according to the aforementioned first preset sorting method in the mobile phone ID1
  • other expressions are the same as this similar.
  • the first-level initial root node of each first-level initial hash tree can be signed by obtaining the signature private key corresponding to each mobile phone from the key management server.
  • the aggregation gateway can use the signature public key corresponding to each mobile phone to perform the first level of the initial integrity verification information Info_IDi sent by each mobile phone.
  • the initial root node signature information sign(Hash_IDi) is verified.
  • the aggregation gateway can construct the first-level initial root node according to the received initial integrity check information Info_IDi.
  • the process of verifying the first-level initial root node signature information sign (Hash_IDi) in the initial integrity check information Info_IDi is similar to the process of verifying the root node signature information of the target root node in the first embodiment, and the basic principle is The same, for the sake of brevity, I will not repeat them here.
  • the aggregation gateway may first sort the mobile phones corresponding to the aggregation gateway according to the second preset sorting method, and then according to the first-level initial hash tree of the first-level initial hash tree corresponding to the sorted mobile phones.
  • the root node constructs the secondary initial hash tree corresponding to the aggregation gateway.
  • the second preset sorting method may be a sorting method from small to large according to the device identification of the mobile phone (such as a mobile phone ID number), or may be a sorting method according to the device identification of the mobile phone (such as a mobile phone ID number) from large to small. The sorting method.
  • the aggregation gateway Agg1 can construct the second-level initial root nodes Hash_ID1, Hash_ID2, and Hash_ID3 of the first-level initial hash tree sent by its corresponding mobile phone ID1, mobile phone ID2, and mobile phone ID3.
  • Level initial hash tree mobile phone ID1 is the first mobile phone sorted according to the above second preset sorting method
  • mobile phone ID2 is the second mobile phone sorted according to the above second preset sorting method
  • mobile phone ID3 is sorted according to the above second preset sorting method
  • the third mobile phone is ranked after sorting by way.
  • d_Aggi is the first signature private key corresponding to the aggregation gateway Aggi
  • (e_Aggi, n) is the first signature public key corresponding to the aggregation gateway Aggi.
  • the verification server After the verification server receives the integrity check information Info_Aggi sent by each aggregation gateway, it can use the first signature public key corresponding to each aggregation gateway to check the integrity check information Info_Aggi sent by each aggregation gateway. The signature information of the secondary initial root node is verified.
  • the first signature public key A corresponding to the aggregation gateway Agg1 can be used to verify the secondary initial root node signature information in the integrity verification information Info_Agg1 sent by the aggregation gateway Agg1, and the first signature public key corresponding to the aggregation gateway Agg2 can be used.
  • the key B verifies the secondary initial root node signature information in the integrity verification information Info_Agg2 sent by the aggregation gateway Agg2
  • the first signature public key C corresponding to the aggregation gateway Agg3 can be used to verify the integrity verification information sent by the aggregation gateway Agg1
  • the signature information of the secondary initial root node in Info_Agg3 is verified.
  • the verification server can construct the target hash tree according to the secondary initial root node in each integrity verification information Info_Aggi it receives.
  • the target hash tree may also be a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, reduce the amount of signature calculation, and at the same time facilitate the subsequent rapid location of the terminal device whose integrity has been compromised.
  • the verification server may first sort the aggregation gateways according to a third preset sorting manner, and then may construct the target hash according to the secondary initial root node of the secondary initial hash tree corresponding to the sorted aggregation gateway. tree.
  • the third preset sorting manner may be a sorting manner from small to large according to the gateway identification of the aggregation gateway (for example, the gateway ID number), or may be according to the gateway identification of the aggregation gateway (for example, the gateway ID number) Sort from largest to smallest.
  • the file server may also send the requested files (including file name, file version, file metadata, etc.) requested by each mobile phone to the verification in real time or periodically.
  • the verification server can construct a first-level local hash tree corresponding to each mobile phone according to the request file.
  • the first-level local hash tree corresponding to mobile phone A can be constructed according to the request files a, b, c, d, e, f, g, h, and i corresponding to mobile phone A, and the request files j, k corresponding to mobile phone B can be constructed.
  • l construct the first-level local hash tree corresponding to mobile phone B.
  • the construction process of the first-level local hash tree is similar to the construction process of the aforementioned first-level initial hash tree, and the basic principles are the same. For the sake of brevity, it will not be repeated here.
  • the verification server when the verification server constructs the first-level local hash tree corresponding to the mobile phone, it can perform the request file corresponding to the mobile phone according to the first preset sorting method used in the construction of the first-level initial hash tree described above. Perform sorting, and construct a first-level local hash tree corresponding to the mobile phone according to the sorted request file.
  • the verification server when the first preset sorting method used in the construction of the first-level initial hash tree described above is the sorting method in ascending order (a ⁇ z) according to the initials of the file name f_req, the verification server then The requested files can be sorted according to the sorting method of the first letter of the file name f_req in ascending order (a ⁇ z).
  • the verification server After the verification server obtains the first-level local hash tree corresponding to each mobile phone, it can first obtain the first-level local root node of each first-level local hash tree and the aggregation gateway corresponding to each mobile phone, and can compare the aggregation gateway according to the aggregation gateway.
  • the first-level local root nodes are grouped, that is, the first-level local root nodes corresponding to the mobile phones corresponding to the same aggregation gateway can be divided into the same group; then, the corresponding first-level local root nodes of each aggregation gateway can be constructed according to the first-level local root node corresponding to each aggregation gateway.
  • the secondary local hash tree The secondary local hash tree.
  • the verification server may determine the corresponding second-level hash tree of the aggregation gateway according to the second preset ordering method used in the construction of the second-level initial hash tree.
  • Each mobile phone is sorted, and the second-level local hash tree corresponding to the aggregation gateway can be constructed according to the first-level local root node of the first-level local hash tree corresponding to the sorted mobile phone.
  • the verification server can then use the mobile phone ID number Sort the mobile phones in a descending order.
  • the verification server After the verification server obtains the second-level local hash tree corresponding to each aggregation gateway, it can obtain the second-level local root node of each second-level local hash tree, and can also obtain the second-level local root node corresponding to each second-level local hash tree.
  • the local root node constructs the local hash tree.
  • the aggregation gateways may be sorted according to the third preset sorting method used in the construction of the target hash tree, and may be sorted according to the sorting method.
  • the second-level local root node of the second-level local hash tree corresponding to the subsequent aggregation gateway constructs the local hash tree.
  • the root nodes at all levels are sorted by using the same preset sorting method to avoid different hash values caused by different sorts, thereby affecting the integrity Result of sexual verification.
  • S605 Check the integrity of each terminal device according to the local root node and the target root node.
  • the verification server may determine that the integrity check of the terminal device passes, that is, the application files in all terminal devices have not been tampered with or replaced, etc. If the local root node is not the same as the target root node, the verification server can determine that the integrity check of the terminal device fails, that is, the integrity of one or more terminal devices is damaged, In other words, the application files stored in one or more terminal devices have been tampered with or replaced.
  • the verification server may compare the local hash tree with the target hash tree to locate the integrity failure.
  • the damaged target terminal device can determine the target terminal device whose integrity has been damaged according to the comparison result of the local hash tree and the target hash tree.
  • This embodiment uses a hash tree and signs the root node of the hash tree to verify the integrity of the terminal device, so that both the terminal device and the aggregation gateway only need to sign the root node of the relevant hash tree.
  • Each file needs to be signed, which greatly reduces the calculation amount of terminal devices and aggregation gateways, and eases the calculation burden of terminal devices and aggregation gateways.
  • the calculation amount of the verification server can be reduced and the calculation burden of the verification server can be alleviated.
  • FIG. 7 and FIG. 8 show the structural block diagram of the integrity check device provided by the embodiment of the present application. Example related parts.
  • an embodiment of the present application provides an integrity verification device, which is applied to a terminal device, and the integrity verification device may include:
  • the file obtaining module 701 is configured to obtain the file to be verified sent by the file server and the integrity check information of the file to be verified.
  • the integrity check information includes the information about the target hash tree using the first signature private key.
  • the root node signature information obtained by the signature of the target root node, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, the target has Xishu is a hash tree constructed based on all files in the file server;
  • the signature information verification module 702 is configured to use the first signature public key to verify the root node signature information
  • the current root node construction module 703 is configured to construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes when the root node signature information is verified;
  • the integrity check module 704 is configured to check the integrity of the file to be checked according to the current root node and the target root node.
  • the integrity verification device may further include:
  • a version verification information acquisition module configured to acquire target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
  • the version legitimacy verification module is configured to verify the version legitimacy of the file to be verified according to the current file version of the file to be verified and the target version verification information.
  • the target version verification information is chameleon signature information generated according to the target file version and the device identifier of the terminal device;
  • version legality verification module may include:
  • the first hash value calculation unit is configured to calculate the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
  • the second hash value calculation unit is configured to use the second signature public key in the chameleon signature information to calculate the second chameleon hash value corresponding to the chameleon signature information;
  • the version legitimacy verification unit is configured to verify the version legitimacy of the file to be verified according to the first chameleon hash value and the second chameleon hash value.
  • the integrity verification device may further include:
  • the device private key obtaining module is configured to obtain the device private key corresponding to the terminal device according to the device identifier.
  • the version verification information obtaining module is specifically configured to obtain the target version verification information of the file to be verified sent by the verification server, and the target version verification information is the verification server according to the file The target file version of the file to be verified sent by the server and version verification information generated by the device identifier of the terminal device that receives the file to be verified.
  • the target hash tree is a trigeminal hash tree.
  • an embodiment of the present application provides an integrity verification device, which is applied to a verification server, and the integrity verification device may include:
  • the integrity information acquisition module 801 is configured to acquire the integrity verification information of each terminal device, the integrity verification information including the initial root node signature obtained by signing the initial root node of the initial hash tree with the first signature private key Information and the first signature public key corresponding to the first signature private key;
  • the signature information verification module 802 is configured to use the first signature public key to verify the initial root node signature information
  • a hash tree construction module 803, configured to construct a target hash tree according to the initial root node when the initial root node signature information is verified;
  • the root node obtaining module 804 is configured to obtain the local root node of the local hash tree and the target root node of the target hash tree;
  • the integrity check module 805 is configured to check the integrity of each terminal device according to the local root node and the target root node.
  • the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
  • the first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
  • the second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
  • the aggregation gateway may include:
  • a signature public key acquisition unit configured to acquire a second signature public key sent by each of the terminal devices
  • the signature information verification unit is configured to use each of the second signature public keys to verify the first-level root node signature information sent by each of the terminal devices;
  • the hash tree construction unit is configured to construct the second-level initial hash tree according to the first-level initial root node of each first-level initial hash tree when the signature information of each of the first-level root nodes is verified.
  • the integrity verification device may further include:
  • a request file obtaining module configured to obtain a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
  • a first-level local hash tree construction module configured to construct a first-level local hash tree corresponding to each terminal device according to the request file, and obtain the first-level local root node of each first-level local hash tree;
  • the second-level local hash tree building module is used to construct the second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtain the second-level local hash tree of each of the second-level local hash trees. Root node
  • the local hash tree construction module is used to construct the local hash tree according to each of the second-level local root nodes.
  • the integrity check module may include:
  • a verification result obtaining unit configured to obtain a verification result that the integrity verification of the terminal device passes if the local root node is the same as the target root node;
  • a hash tree comparison unit configured to obtain a verification result that the integrity check of the terminal device fails if the local root node is different from the target root node, and compare the local hash Tree and the target hash tree;
  • the target terminal device determining unit is configured to determine the target terminal device that fails the integrity check according to the comparison result of the local hash tree and the target hash tree.
  • the local hash tree and the target hash tree are both trigeminal hash trees.
  • FIG. 9 is a schematic structural diagram of a verification server provided by an embodiment of the application.
  • the verification server 9 of this embodiment includes: at least one processor 90 (only one is shown in FIG. 9), a processor, a memory 91, and a processor that is stored in the memory 91 and can be processed in the at least one processor.
  • the computer program 92 running on the processor 90 when the processor 90 executes the computer program 92, implements the steps in any of the integrity verification method embodiments in the second embodiment.
  • the verification server 9 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the verification server may include, but is not limited to, a processor 90 and a memory 91.
  • FIG. 9 is only an example of the verification server 9 and does not constitute a limitation on the verification server 9. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the processor 90 may be a central processing unit (Central Processing Unit, CPU), and the processor 90 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 91 may be an internal storage unit of the verification server 9 in some embodiments, such as a hard disk or memory of the verification server 9. In other embodiments, the memory 91 may also be an external storage device of the verification server 9, such as a plug-in hard disk equipped on the verification server 9, a smart media card (SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc. Further, the storage 91 may also include both an internal storage unit of the verification server 9 and an external storage device.
  • the memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 can also be used to temporarily store data that has been output or will be output.
  • the terminal device also includes at least one processor, a memory, and a computer program that is stored in the memory and can run on the at least one processor.
  • the processor implements the foregoing when the computer program is executed. Steps in any of the integrity verification method embodiments in the first embodiment.
  • the principles of the processor and the memory are the same as those of the processor 90 and the memory 91 described above. For the sake of brevity, the details are not repeated here.
  • the embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the embodiments of the present application provide a computer program product.
  • the terminal device can implement the steps in the first embodiment of the method when executed by the terminal device.
  • the embodiment of the present application provides a computer program product.
  • the verification server can implement the steps in the second embodiment of the above method when the verification server is executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the computer program can be stored in a computer-readable storage medium.
  • the computer program can be stored in a computer-readable storage medium.
  • the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable storage medium may at least include: any entity or device capable of carrying computer program code to the device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electric carrier signal, telecommunications signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • electric carrier signal telecommunications signal and software distribution medium.
  • U disk mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable storage media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed device/terminal device/verification server and method can be implemented in other ways.
  • the device/terminal device/verification server embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as Multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Abstract

The present application is applicable to the technical field of terminals, and relates in particular to an integrity checking method and apparatus, a terminal device and a verification server. The method comprises: acquiring a file to be checked, that is sent by a file server, and integrity checking information of the file to be checked, wherein the integrity checking information comprises root node signature information obtained by means of signing a target root node of a target hash tree using a first signature private key, a child node, that is related to the file to be checked, in the target hash tree, and a first signature public key corresponding to the first signature private key, and the target hash tree is a hash tree constructed according to all files in the file server; verifying the root node signature information using the first signature public key; when the verification of the root node signature information is passed, according to the file to be checked and the child node, constructing the current root node corresponding to the target hash tree; and according to the current root node and the target root node, checking the integrity of the file to be checked. The problem of a large amount of calculation due to the fact that all files need to be signed respectively at present is solved.

Description

完整性校验方法、装置、终端设备及验证服务器Integrity verification method, device, terminal equipment and verification server
本申请要求于2019年12月13日提交国家知识产权局、申请号为201911284197.5、申请名称为“完整性校验方法、装置、终端设备及验证服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office, the application number is 201911284197.5, and the application name is "Integrity Check Method, Device, Terminal Equipment and Verification Server" on December 13, 2019, and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请属于终端技术领域,尤其涉及完整性校验方法、装置、终端设备、验证服务器及计算机可读存储介质。This application belongs to the field of terminal technology, and in particular relates to integrity verification methods, devices, terminal equipment, verification servers, and computer-readable storage media.
背景技术Background technique
完整性校验是指校验文件的准确性,以检测文件是否被非法篡改的技术手段。随着网络技术的不断发展,终端设备下载或应用的文件容易被非法篡改,因此,如何校验终端设备的下载文件或应用文件的完整性成为本领域技术人员亟待解决的问题。Integrity verification refers to the technical means of verifying the accuracy of files to detect whether the files have been tampered with illegally. With the continuous development of network technology, files downloaded or applied by terminal devices are easily tampered with illegally. Therefore, how to verify the integrity of downloaded files or application files of terminal devices has become an urgent problem for those skilled in the art.
现有技术中,可以通过事先对所有文件分别计算哈希值,并分别对各哈希值进行签名保存,以根据保存的各签名结果来进行文件完整性的校验。这种对所有文件分别进行签名的方式需要执行大量的签名操作,极大地增加了计算量。In the prior art, it is possible to separately calculate hash values for all files in advance, and to separately sign and save each hash value, so as to verify the integrity of the file according to the stored signature results. This method of separately signing all files requires a large number of signature operations, which greatly increases the amount of calculation.
发明内容Summary of the invention
本申请实施例提供了一种完整性校验方法、装置、终端设备、验证服务器及计算机可读存储介质,可以解决现有的完整性校验中需要对所有文件分别进行签名,造成计算量大的问题。The embodiments of the application provide an integrity verification method, device, terminal equipment, verification server, and computer-readable storage medium, which can solve the need to separately sign all files in the existing integrity verification, which causes a large amount of calculation. The problem.
第一方面,本申请实施例提供了一种完整性校验方法,应用于终端设备,所述完整性校验方法包括:In the first aspect, an embodiment of the present application provides an integrity check method, which is applied to a terminal device, and the integrity check method includes:
获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为根据所述文件服务器中的所有文件构建的哈希树;Obtain the file to be verified sent by the file server and the integrity check information of the file to be verified, where the integrity check information includes the root obtained by signing the target root node of the target hash tree with the first signature private key Node signature information, child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, and the target hash tree is based on the file Hash tree constructed by all files in the server;
利用所述第一签名公钥对所述根节点签名信息进行验证;Verifying the signature information of the root node by using the first signature public key;
当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;When the root node signature information is verified, construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes;
根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。The integrity of the file to be verified is verified according to the current root node and the target root node.
本申请实施例,通过使用哈希树及哈希树根节点签名的方式来对终端设备的下载文件进行完整性校验,使得仅需对根节点进行签名即可完成完整性校验,不需要对每一个文件进行签名,极大地减少了签名的计算量,缓解了计算负担。In the embodiment of the present application, the integrity check of the downloaded file of the terminal device is performed by using the hash tree and the signature of the root node of the hash tree, so that the integrity check can be completed only by signing the root node. Signing each file greatly reduces the amount of signature calculation and eases the calculation burden.
在第一方面的一种可能的实现方式中,在所述根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性之后,包括:In a possible implementation manner of the first aspect, after the verifying the integrity of the file to be verified according to the current root node and the target root node, the method includes:
获取所述待校验文件的目标版本校验信息,所述目标版本校验信息为根据所述待校验文件的目标文件版本生成的版本校验信息;Acquiring target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合 法性。Verify the version legality of the file to be verified according to the current file version of the file to be verified and the target version verification information.
在此,通过将完整性校验和版本合法性校验分开请求的方式,使得可以通过密码学安全的方式来验证待校验文件的真实版本,以降低文件替换和重放攻击的风险。Here, by separately requesting the integrity check and the version legality check, the true version of the file to be verified can be verified in a cryptographically safe manner, so as to reduce the risk of file replacement and replay attacks.
可选地,所述目标版本校验信息为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息;Optionally, the target version verification information is chameleon signature information generated according to the target file version and the device identifier of the terminal device;
所述根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性包括:The verifying the version legality of the file to be verified according to the current file version of the file to be verified and the target version verification information includes:
根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值;Calculating the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
利用所述变色龙签名信息中的第二签名公钥计算所述变色龙签名信息对应的第二变色龙哈希值;Calculating the second chameleon hash value corresponding to the chameleon signature information by using the second signature public key in the chameleon signature information;
根据所述第一变色龙哈希值和所述第二变色龙哈希值校验所述待校验文件的版本合法性。Verifying the legality of the version of the file to be verified according to the hash value of the first chameleon and the hash value of the second chameleon.
应理解,通过变色龙签名算法对目标文件版本进行签名,以利用变色龙签名的不可否认性、非交互性以及不可传递的特点保证版本信息的唯一合法性,降低泄漏风险。It should be understood that the target file version is signed by the chameleon signature algorithm to use the non-repudiation, non-interactivity, and non-transmission characteristics of the chameleon signature to ensure the unique legitimacy of the version information and reduce the risk of leakage.
具体地,在所述根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值之前,包括:根据所述设备标识获取所述终端设备对应的设备私钥。Specifically, before the calculation of the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information, the method includes: obtaining according to the device identification The device private key corresponding to the terminal device.
示例的,本申请实施例也可以通过生成版本哈希树以及对版本哈希树的根节点进行签名来生成待校验文件对应的目标版本校验信息。For example, the embodiment of the present application may also generate the target version verification information corresponding to the file to be verified by generating a version hash tree and signing the root node of the version hash tree.
在第一方面的一种可能的实现方式中,所述获取所述待校验文件的目标版本校验信息包括:In a possible implementation manner of the first aspect, the obtaining the target version verification information of the file to be verified includes:
获取验证服务器发送的所述待校验文件的目标版本校验信息,所述目标版本校验信息为所述验证服务器根据所述文件服务器发送的所述待校验文件的目标文件版本和接收所述待校验文件的终端设备的设备标识生成的版本校验信息。Obtain the target version verification information of the file to be verified sent by the verification server, where the target version verification information is the target file version of the file to be verified sent by the file server and the receiving station according to the verification server The version verification information generated by the device identifier of the terminal device of the file to be verified.
在此,通过验证服务器生成待校验文件的目标版本校验信息可实现风险分担,从而降低目标版本校验信息被攻击的风险。Here, the target version verification information of the file to be verified can be generated by the verification server to realize risk sharing, thereby reducing the risk of the target version verification information being attacked.
具体地,所述目标哈希树为三叉哈希树,以通过三叉哈希树来减少哈希树的层次,减少完整性校验所需的完整性校验信息,减少带宽占用。Specifically, the target hash tree is a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, reduce the integrity check information required for the integrity check, and reduce the bandwidth occupation.
第二方面,本申请实施例提供了一种完整性校验方法,应用于验证服务器,所述完整性校验方法包括:In the second aspect, an embodiment of the present application provides an integrity verification method, which is applied to a verification server, and the integrity verification method includes:
获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名私钥对应的第一签名公钥;Obtain the integrity check information of each terminal device, the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key, and the private signature information with the first signature. The first signature public key corresponding to the key;
利用所述第一签名公钥对所述初始根节点签名信息进行验证;Verifying the initial root node signature information by using the first signature public key;
当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;When the initial root node signature information is verified, construct a target hash tree according to the initial root node;
获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;Acquiring the local root node of the local hash tree and the target root node of the target hash tree;
根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。The integrity of each terminal device is verified according to the local root node and the target root node.
本申请实施例,通过使用哈希树及哈希树根节点签名的方式来对终端设备进行完整性校验,使得终端设备和验证服务器均仅需要对相关哈希树的根节点进行签名,而不需要对每一个文件进行签名,极大地减少了终端设备、验证服务器的计算量,缓解了终端设备、验证服务器的计算负担。In the embodiment of the present application, the terminal device is checked for integrity by using the hash tree and the root node signature of the hash tree, so that both the terminal device and the verification server only need to sign the root node of the related hash tree, and There is no need to sign every file, which greatly reduces the calculation amount of the terminal device and the verification server, and eases the calculation burden of the terminal device and the verification server.
可选地,所述初始哈希树包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点;Optionally, the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树;The first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各一级初始哈希树构建的哈希树。The second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
具体地,所述聚合网关构建所述二级初始哈希树的过程包括:Specifically, the process of constructing the secondary initial hash tree by the aggregation gateway includes:
获取各所述终端设备发送的第二签名公钥;Acquiring the second signature public key sent by each of the terminal devices;
分别利用各所述第二签名公钥对各所述终端设备发送的一级根节点签名信息进行验证;Using each of the second signature public keys to verify the signature information of the primary root node sent by each of the terminal devices;
当各所述一级根节点签名信息验证通过时,根据各所述一级初始哈希树的一级初始根节点构建所述二级初始哈希树。When the signature information of each first-level root node is verified, the second-level initial hash tree is constructed according to the first-level initial root node of each first-level initial hash tree.
需要说明的是,在构建一级初始哈希树时,终端设备可以首先根据第一预设排序方式对终端设备中的目标文件进行排序,然后可以根据排序后的目标文件来构建终端设备对应的一级初始哈希树的各叶子节点。在此,所述第一预设排序方式可以为按照文件名f_req的首字母升序(a→z)的排序方式,或者可以为按照文件名f_req的首字母降序(z→a)的排序方式。It should be noted that when constructing the first-level initial hash tree, the terminal device can first sort the target files in the terminal device according to the first preset sorting method, and then can construct the corresponding terminal device according to the sorted target files. Each leaf node of the first-level initial hash tree. Here, the first preset sorting method may be a sorting method in ascending order (a→z) according to the first letter of the file name f_req, or may be a sorting method in descending order (z→a) according to the first letter of the file name f_req.
示例的,在构建二级初始哈希树时,聚合网关可以首先根据第二预设排序方式对聚合网关对应的终端设备进行排序,然后可以根据排序后的终端设备对应的一级初始哈希树的一级初始根节点构建聚合网关对应的二级初始哈希树。在此,所述第二预设排序方式可以为按照终端设备的设备标识(如ID号)由小至大的排序方式,或者可以为按照终端设备的设备标识(如ID号)由大至小的排序方式。For example, when constructing the second-level initial hash tree, the aggregation gateway may first sort the terminal devices corresponding to the aggregation gateway according to the second preset sorting method, and then may according to the first-level initial hash tree corresponding to the sorted terminal devices The first-level initial root node of is constructed the second-level initial hash tree corresponding to the aggregation gateway. Here, the second preset sorting method may be a sorting method from small to large according to the device identification (such as ID number) of the terminal device, or may be a small to large sorting manner according to the device identification (such as ID number) of the terminal device. The sorting method.
在此,通过将大多数的签名验证过程转移至聚合网关,可以有效减少验证服务器的计算量,缓解验证服务器的计算负担。Here, by transferring most of the signature verification process to the aggregation gateway, the calculation amount of the verification server can be effectively reduced, and the calculation burden of the verification server can be alleviated.
可选地,在所述获取本地哈希树的本地根节点之前包括:Optionally, before the obtaining the local root node of the local hash tree, the method includes:
获取所述文件服务器发送的请求文件,所述请求文件为各所述终端设备从所述文件服务器中请求过的文件;Acquiring a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
根据所述请求文件构建各所述终端设备对应的一级本地哈希树,并获取各所述一级本地哈希树的一级本地根节点;Constructing the first-level local hash tree corresponding to each of the terminal devices according to the request file, and obtaining the first-level local root node of each of the first-level local hash trees;
根据各所述一级本地根节点构建各所述聚合网关对应的二级本地哈希树,并获取各所述二级本地哈希树的二级本地根节点;Constructing a second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtaining the second-level local root node of each of the second-level local hash trees;
根据各所述二级本地根节点构建所述本地哈希树。The local hash tree is constructed according to each of the second-level local root nodes.
应理解,在构建终端设备对应的一级本地哈希树时,可以根据前述一级初始哈希树的构建过程中所使用的第一预设排序方式对终端设备对应的请求文件进行排序,并可以根据排序后的请求文件构建终端设备对应的一级本地哈希树。类似地,在构建聚合网关对应的二级本地哈希树时,可以根据前述二级初始哈希树的构建过程中所使用的第二预设排序方式对聚合网关对应的终端设备进行排序,并可以根据排序后的终端设备对应的一级本地哈希树的一级本地根节点构建聚合网关对应的二级本地哈希树,即在本地哈希树和目标哈希树的构建过程中,通过使用相同的预设排序方式进行各级根节点的排序,避免排序不同而带来的哈希值不同,影响完整性校验结果。It should be understood that when constructing the first-level local hash tree corresponding to the terminal device, the request files corresponding to the terminal device can be sorted according to the first preset sorting method used in the construction of the aforementioned first-level initial hash tree, and The first-level local hash tree corresponding to the terminal device can be constructed according to the sorted request files. Similarly, when constructing the secondary local hash tree corresponding to the aggregation gateway, the terminal devices corresponding to the aggregation gateway can be sorted according to the second preset sorting method used in the construction of the aforementioned secondary initial hash tree, and The second-level local hash tree corresponding to the aggregation gateway can be constructed according to the first-level local root node of the first-level local hash tree corresponding to the sorted terminal device, that is, during the construction of the local hash tree and the target hash tree, pass Use the same preset sorting method to sort the root nodes at all levels to avoid different hash values caused by different sorts and affect the integrity check result.
可选地,所述根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性包括:Optionally, the checking the integrity of each terminal device according to the local root node and the target root node includes:
若所述本地根节点与所述目标根节点相同,则得到所述终端设备的完整性校验通过的校验结果;If the local root node is the same as the target root node, a verification result that the integrity verification of the terminal device passes is obtained;
若所述本地根节点与所述目标根节点不相同,则得到所述终端设备的完整性校验不通过的校验结果,并比对所述本地哈希树和所述目标哈希树;If the local root node and the target root node are not the same, obtain a verification result that the integrity check of the terminal device fails, and compare the local hash tree with the target hash tree;
根据所述本地哈希树和所述目标哈希树的比对结果,确定完整性校验不通过的目标终端设备。According to the comparison result of the local hash tree and the target hash tree, a target terminal device that fails the integrity check is determined.
具体地,所述本地哈希树和所述目标哈希树均为三叉哈希树,以通过三叉哈希树减少哈希树的层次,减少签名计算量,同时可方便快速定位完整性遭破坏的终端设备。Specifically, the local hash tree and the target hash tree are both ternary hash trees, so as to reduce the level of the hash tree through the ternary hash tree, reduce the amount of signature calculation, and at the same time, it is convenient to quickly locate the integrity damage Terminal equipment.
第三方面,本申请实施例提供了一种完整性校验装置,应用于终端设备,所述完整性校验装置包括:In a third aspect, an embodiment of the present application provides an integrity verification device, which is applied to a terminal device, and the integrity verification device includes:
文件获取模块,用于获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为根据所述文件服务器中的所有文件构建的哈希树;The file obtaining module is used to obtain the file to be verified sent by the file server and the integrity check information of the file to be verified, and the integrity check information includes the target of the target hash tree using the first signature private key The root node signature information obtained by the root node signature, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, the target hash The tree is a hash tree constructed based on all files in the file server;
签名信息校验模块,用于利用所述第一签名公钥对所述根节点签名信息进行验证;A signature information verification module, configured to use the first signature public key to verify the root node signature information;
当前根节点构建模块,用于当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;The current root node construction module is configured to construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes when the root node signature information is verified;
完整性校验模块,用于根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。The integrity check module is used to check the integrity of the file to be checked according to the current root node and the target root node.
可选地,所述完整性校验装置还包括:Optionally, the integrity verification device further includes:
版本校验信息获取模块,用于获取所述待校验文件的目标版本校验信息,所述目标版本校验信息为根据所述待校验文件的目标文件版本生成的版本校验信息;A version verification information acquisition module, configured to acquire target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
版本合法性校验模块,用于根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性。The version legitimacy verification module is configured to verify the version legitimacy of the file to be verified according to the current file version of the file to be verified and the target version verification information.
在第三方面的一种可能的实现方式中,所述目标版本校验信息为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息;In a possible implementation manner of the third aspect, the target version verification information is chameleon signature information generated according to the target file version and the device identification of the terminal device;
所述版本合法性校验模块包括:The version legality check module includes:
第一哈希值计算单元,用于根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值;The first hash value calculation unit is configured to calculate the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
第二哈希值计算单元,用于利用所述变色龙签名信息中的第二签名公钥计算所述变色龙签名信息对应的第二变色龙哈希值;The second hash value calculation unit is configured to use the second signature public key in the chameleon signature information to calculate the second chameleon hash value corresponding to the chameleon signature information;
版本合法性校验单元,用于根据所述第一变色龙哈希值和所述第二变色龙哈希值校验所述待校验文件的版本合法性。The version legitimacy verification unit is configured to verify the version legitimacy of the file to be verified according to the first chameleon hash value and the second chameleon hash value.
示例的,所述完整性校验装置还包括:For example, the integrity verification device further includes:
设备私钥获取模块,用于根据所述设备标识获取所述终端设备对应的设备私钥。The device private key obtaining module is configured to obtain the device private key corresponding to the terminal device according to the device identifier.
可选地,所述版本校验信息获取模块,具体用于获取验证服务器发送的所述待校验文件的目标版本校验信息,所述目标版本校验信息为所述验证服务器根据所述文件服务器发送的所述待校验文件的目标文件版本和接收所述待校验文件的终端设备的设备标识生成的版本校验信息。Optionally, the version verification information obtaining module is specifically configured to obtain the target version verification information of the file to be verified sent by the verification server, and the target version verification information is the verification server according to the file The target file version of the file to be verified sent by the server and version verification information generated by the device identifier of the terminal device that receives the file to be verified.
具体地,所述目标哈希树为三叉哈希树。Specifically, the target hash tree is a trigeminal hash tree.
第四方面,本申请实施例提供了一种完整性校验装置,应用于验证服务器,所述完整性校验装置包括:In a fourth aspect, an embodiment of the present application provides an integrity verification device, which is applied to a verification server, and the integrity verification device includes:
完整性信息获取模块,用于获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名 私钥对应的第一签名公钥;The integrity information obtaining module is used to obtain the integrity check information of each terminal device. The integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key And a first signature public key corresponding to the first signature private key;
签名信息校验模块,用于利用所述第一签名公钥对所述初始根节点签名信息进行验证;A signature information verification module, configured to verify the initial root node signature information by using the first signature public key;
哈希树构建模块,用于当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;A hash tree construction module, configured to construct a target hash tree according to the initial root node when the initial root node signature information is verified;
根节点获取模块,用于获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;A root node obtaining module, configured to obtain the local root node of the local hash tree and the target root node of the target hash tree;
完整性校验模块,用于根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。The integrity check module is used to check the integrity of each terminal device according to the local root node and the target root node.
可选地,所述初始哈希树包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点;Optionally, the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树;The first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各一级初始哈希树构建的哈希树。The second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
具体地,所述聚合网关包括:Specifically, the aggregation gateway includes:
签名公钥获取单元,用于获取各所述终端设备发送的第二签名公钥;A signature public key acquisition unit, configured to acquire a second signature public key sent by each of the terminal devices;
签名信息校验单元,用于分别利用各所述第二签名公钥对各所述终端设备发送的一级根节点签名信息进行验证;The signature information verification unit is configured to use each of the second signature public keys to verify the first-level root node signature information sent by each of the terminal devices;
哈希树构建单元,用于当各所述一级根节点签名信息验证通过时,根据各所述一级初始哈希树的一级初始根节点构建所述二级初始哈希树。The hash tree construction unit is configured to construct the second-level initial hash tree according to the first-level initial root node of each first-level initial hash tree when the signature information of each of the first-level root nodes is verified.
在第四方面的一种可能的实现方式中,所述完整性校验装置还包括:In a possible implementation manner of the fourth aspect, the integrity verification device further includes:
请求文件获取模块,用于获取所述文件服务器发送的请求文件,所述请求文件为各所述终端设备从所述文件服务器中请求过的文件;A request file obtaining module, configured to obtain a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
一级本地哈希树构建模块,用于根据所述请求文件构建各所述终端设备对应的一级本地哈希树,并获取各所述一级本地哈希树的一级本地根节点;A first-level local hash tree construction module, configured to construct a first-level local hash tree corresponding to each terminal device according to the request file, and obtain the first-level local root node of each first-level local hash tree;
二级本地哈希树构建模块,用于根据各所述一级本地根节点构建各所述聚合网关对应的二级本地哈希树,并获取各所述二级本地哈希树的二级本地根节点;The second-level local hash tree building module is used to construct the second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtain the second-level local hash tree of each of the second-level local hash trees. Root node
本地哈希树构建模块,用于根据各所述二级本地根节点构建所述本地哈希树。The local hash tree construction module is used to construct the local hash tree according to each of the second-level local root nodes.
可选地,所述完整性校验模块包括:Optionally, the integrity check module includes:
校验结果获取单元,用于若所述本地根节点与所述目标根节点相同,则得到所述终端设备的完整性校验通过的校验结果;A verification result obtaining unit, configured to obtain a verification result that the integrity verification of the terminal device passes if the local root node is the same as the target root node;
哈希树比对单元,用于若所述本地根节点与所述目标根节点不相同,则得到所述终端设备的完整性校验不通过的校验结果,并比对所述本地哈希树和所述目标哈希树;A hash tree comparison unit, configured to obtain a verification result that the integrity check of the terminal device fails if the local root node is different from the target root node, and compare the local hash Tree and the target hash tree;
目标终端设备确定单元,用于根据所述本地哈希树和所述目标哈希树的比对结果,确定完整性校验不通过的目标终端设备。The target terminal device determining unit is configured to determine the target terminal device that fails the integrity check according to the comparison result of the local hash tree and the target hash tree.
具体地,所述本地哈希树和所述目标哈希树均为三叉哈希树。Specifically, the local hash tree and the target hash tree are both trigeminal hash trees.
第五方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述的完整性校验方法。In a fifth aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, The integrity verification method described in any one of the above-mentioned first aspects is implemented.
第六方面,本申请实施例提供了一种验证服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第二方面中任一项所述的完整性校验方法。In a sixth aspect, an embodiment of the present application provides a verification server, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, The integrity verification method described in any one of the above-mentioned second aspects is implemented.
第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面或第二方面中任一项所述的完整性校验方法。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the first or second aspects described above is implemented. The integrity check method described in one item.
第八方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的完整性校验方法。In an eighth aspect, the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the integrity verification method described in any one of the above-mentioned first aspects.
第九方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在验证服务器上运行时,使得验证服务器执行上述第二方面中任一项所述的完整性校验方法。In a ninth aspect, an embodiment of the present application provides a computer program product, which when the computer program product runs on a verification server, causes the verification server to execute the integrity verification method described in any one of the above second aspects.
附图说明Description of the drawings
图1是本申请一实施例提供的完整性校验系统的系统示意图;FIG. 1 is a system schematic diagram of an integrity verification system provided by an embodiment of the present application;
图2是本申请另一实施例提供的完整性校验系统的系统示意图;2 is a system schematic diagram of an integrity verification system provided by another embodiment of the present application;
图3是本申请一实施例提供的完整性校验方法所适用于的手机的结构示意图;FIG. 3 is a schematic structural diagram of a mobile phone to which the integrity verification method provided by an embodiment of the present application is applicable;
图4是本申请一实施例提供的完整性校验方法所适用于的软件架构示意图;FIG. 4 is a schematic diagram of a software architecture to which the integrity verification method provided by an embodiment of the present application is applicable;
图5是本申请一实施例提供的完整性校验方法的流程示意图;FIG. 5 is a schematic flowchart of an integrity verification method provided by an embodiment of the present application;
图5a是本申请一实施例构建的三层目标哈希树的示例图;Fig. 5a is an example diagram of a three-layer target hash tree constructed by an embodiment of the present application;
图5b是本申请一实施例提供的哈希树的示例图;FIG. 5b is an example diagram of a hash tree provided by an embodiment of the present application;
图5c是本申请一实施例构建的哈希树的示例图;FIG. 5c is an example diagram of a hash tree constructed by an embodiment of the present application;
图6是本申请另一实施例提供的完整性校验方法的流程示意图;FIG. 6 is a schematic flowchart of an integrity verification method provided by another embodiment of the present application;
图6a是本申请另一实施例构建的哈希树的示例图;Fig. 6a is an example diagram of a hash tree constructed by another embodiment of the present application;
图7是本申请一实施例提供的完整性校验装置的结构示意图;FIG. 7 is a schematic structural diagram of an integrity verification device provided by an embodiment of the present application;
图8是本申请另一实施例提供的完整性校验装置的结构示意图;FIG. 8 is a schematic structural diagram of an integrity verification device provided by another embodiment of the present application;
图9是本申请一实施例提供的验证服务器的结构示意图。Fig. 9 is a schematic structural diagram of a verification server provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the items listed in the associated and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现 的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。The reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the words "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
随着电子技术的不断发展,计算机系统的集群化、分布式趋势不断增强。在一个复杂的网络系统中,大量终端设备互相配合、协同工作,当任一终端设备遭受网络攻击时,将会影响其自身及整个网络系统的安全。因此,如何校验终端设备的关键配置、补丁、可执行文件等重要文件的完整性势在必行。其中,文件可以包括终端设备的下载文件和终端设备中的应用文件。在此,所述下载文件是指终端设备刚从文件服务器下载到的、还未应用的文件。所述应用文件是指终端设备上运行或使用中的文件With the continuous development of electronic technology, the clustering and distributed trend of computer systems is constantly increasing. In a complex network system, a large number of terminal devices cooperate and work together. When any terminal device suffers a network attack, it will affect the security of itself and the entire network system. Therefore, it is imperative to verify the integrity of key configurations, patches, executable files and other important files of terminal equipment. Among them, the file may include the download file of the terminal device and the application file in the terminal device. Here, the downloaded file refers to a file that the terminal device has just downloaded from the file server and has not yet been applied. The application file refers to the file running or in use on the terminal device
现有技术中,一般事先通过对所有文件分别计算哈希值,并对各哈希值分别进行签名保存,以根据保存的签名结果来进行文件完整性的校验。这种对所有文件分别进行签名的方式需要服务器或终端设备执行大量的签名操作,极大地增加了服务器或终端设备的计算量,造成服务器或终端设备的计算负担较重。In the prior art, generally, hash values are calculated separately for all files in advance, and each hash value is separately signed and saved, so as to verify the integrity of the file according to the saved signature result. This method of separately signing all files requires a server or terminal device to perform a large number of signature operations, which greatly increases the calculation amount of the server or terminal device, and causes a heavy calculation burden on the server or terminal device.
为解决上述问题,本申请实施例提供了一种完整性校验方法、完整性校验装置、完整性校验系统、终端设备、验证服务器及计算机可读存储介质,可通过使用哈希树和仅对哈希树的根节点进行签名的方式来进行完整性校验,无需对每一个文件进行签名,可以减少服务器或终端设备的计算量,缓解服务器或终端设备的计算负担。In order to solve the above problems, the embodiments of the present application provide an integrity verification method, an integrity verification device, an integrity verification system, a terminal device, a verification server, and a computer-readable storage medium, which can be achieved by using a hash tree and The integrity check is performed only by signing the root node of the hash tree, without signing each file, which can reduce the calculation amount of the server or terminal device and alleviate the calculation burden of the server or terminal device.
如图1所示,在对终端设备的下载文件进行完整性校验的应用场景中,本申请实施例提供的完整性校验系统可以包括终端设备10、文件服务器11、验证服务器12和密钥管理服务器13。其中,所述终端设备10可以分别与所述文件服务器11、所述验证服务器12、所述密钥管理服务器13通信连接。所述文件服务器11还可以分别与所述验证服务器12、所述密钥管理服务器13通信连接。所述验证服务器12还可以与所述密钥管理服务器13通信连接。所述密钥管理服务器13可以为所述终端设备10、所述文件服务器11、所述验证服务器12等分发对应的签名密钥。As shown in FIG. 1, in an application scenario of performing integrity verification on a downloaded file of a terminal device, the integrity verification system provided in an embodiment of the present application may include a terminal device 10, a file server 11, a verification server 12, and a key Management server 13. Wherein, the terminal device 10 may be in communication connection with the file server 11, the verification server 12, and the key management server 13 respectively. The file server 11 may also be in communication connection with the verification server 12 and the key management server 13 respectively. The verification server 12 may also be in communication connection with the key management server 13. The key management server 13 may distribute corresponding signature keys to the terminal device 10, the file server 11, the verification server 12, and the like.
在此,所述文件服务器11可以事先构建所述文件服务器11内所有文件对应的目标哈希树,并可以将所述目标哈希树的根节点发送至所述验证服务器12进行签名。所述验证服务器12则可以通过从所述密钥管理服务器13中获取签名私钥来对所述目标哈希树的根节点进行签名,并可以将签名结果和签名公钥返回至所述文件服务器11。所述文件服务器11在基于所述终端设备10的文件获取请求向所述终端设备10发送某一文件时,还可以将与该文件对应的完整性校验信息(包括签名结果、签名公钥以及所述目标哈希树中与该文件相关的子节点)发送至所述终端设备10。所述终端设备10获取到该文件和该完整性校验信息后,可以首先根据签名公钥对该签名结果进行验证,当该签名结果验证通过时,可以根据该文件以及该完整性校验信息中的子节点构建所述目标哈希树对应的当前根节点;随后,可以将该当前根节点与签名结果中所包含的所述目标哈希树的根节点进行比对,以此确定该文件的完整性。Here, the file server 11 may construct a target hash tree corresponding to all files in the file server 11 in advance, and may send the root node of the target hash tree to the verification server 12 for signing. The verification server 12 can sign the root node of the target hash tree by obtaining the signature private key from the key management server 13, and can return the signature result and the signature public key to the file server 11. When the file server 11 sends a file to the terminal device 10 based on the file acquisition request of the terminal device 10, it may also send the integrity check information corresponding to the file (including the signature result, the signature public key, and the signature public key). The child nodes related to the file in the target hash tree) are sent to the terminal device 10. After the terminal device 10 obtains the file and the integrity check information, it can first verify the signature result according to the signature public key. When the signature result is verified, it can be based on the file and the integrity check information. The child nodes in constructs the current root node corresponding to the target hash tree; subsequently, the current root node can be compared with the root node of the target hash tree contained in the signature result to determine the file Completeness.
可以理解的是,对所述目标哈希树的根节点进行签名的操作也可以由所述文件服务器12自己执行。It is understandable that the operation of signing the root node of the target hash tree may also be performed by the file server 12 itself.
由上可知,在对终端设备的下载文件进行完整性校验时,验证服务器或文件服务器仅需要对所述目标哈希树的根节点进行签名,而不需要对每一个文件进行签名,极大地减少了验证服务器或文件服务器的计算量,缓解了验证服务器或文件服务器的计算负担。It can be seen from the above that when the integrity check of the downloaded file of the terminal device is performed, the verification server or the file server only needs to sign the root node of the target hash tree, and does not need to sign each file, which greatly The calculation amount of the verification server or the file server is reduced, and the calculation burden of the verification server or the file server is alleviated.
如图2所示,在对各终端设备进行完整性校验的场景中,所述完整性校验系统还可以包括聚合网关14。其中,所述聚合网关14可以分别与所述终端设备10、所述验证服务器12、所述密钥管理服务器13通信连接。在此,对各终端设备进行完整性校验是指对各终端设备中的应用文件进行完整性校验。As shown in FIG. 2, in the scenario of performing integrity verification on each terminal device, the integrity verification system may further include an aggregation gateway 14. Wherein, the aggregation gateway 14 may be in communication connection with the terminal device 10, the verification server 12, and the key management server 13 respectively. Here, performing an integrity check on each terminal device refers to performing an integrity check on an application file in each terminal device.
所述验证服务器12可以事先获取所述文件服务器11发送的各请求文件,并可以根据各所述请求文件构建本地哈希树。其中,所述文件服务器11发送的各请求文件为各所述终端设备10从所述文件服务器11中请求过的文件。The verification server 12 may obtain each request file sent by the file server 11 in advance, and may construct a local hash tree according to each request file. Wherein, each requested file sent by the file server 11 is a file requested by each terminal device 10 from the file server 11.
在需要对各所述终端设备10进行完整性校验时,所述验证服务器12则可以向各所述终端设备10发送完整性校验请求。各所述终端设备10接收到完整性校验请求后,可以获取各所述终端设备10中的目标文件来构建各所述终端设备对应的一级初始哈希树,并可以获取各一级初始哈希树的一级初始根节点;然后可以通过从所述密钥管理服务器13中获取第一签名私钥来对各所述一级初始哈希树的一级初始根节点进行签名,并可以将包含第一签名结果的初始完整性校验信息发送至所对应的聚合网关14。各所述聚合网关14则可以分别利用对应的第一签名公钥对各初始完整性校验信息中的第一签名结果进行验证,各第一签名结果验证通过后,各所述聚合网关14则可以根据各一级初始哈希树的一级初始根节点构建各所述聚合网关对应的二级初始哈希树;随后可以获取各所述二级初始哈希树的二级初始根节点,并可以通过从所述密钥管理服务器13中获取第二签名私钥来对所述二级初始哈希树的二级初始根节点进行签名,并可以将包含第二签名结果的完整性校验信息发送至所述验证服务器12。所述验证服务器12则可以分别利用对应的第二签名公钥对各完整性校验信息中的各第二签名结果进行验证,各第二签名结果均验证通过后,所述验证服务器12则可以根据各二级初始哈希树的二级初始根节点构建目标哈希树,并可以将所述目标哈希树的目标根节点与本地哈希树的本地根节点进行比对,以此确定各所述终端设备的完整性。When it is necessary to perform an integrity check on each of the terminal devices 10, the verification server 12 may send an integrity check request to each of the terminal devices 10. After each terminal device 10 receives the integrity check request, it can obtain the target file in each terminal device 10 to construct the first-level initial hash tree corresponding to each terminal device, and can obtain each first-level initial hash tree. The first-level initial root node of the hash tree; then the first-level initial root node of each first-level initial hash tree can be signed by obtaining the first signature private key from the key management server 13, and The initial integrity verification information including the first signature result is sent to the corresponding aggregation gateway 14. Each aggregation gateway 14 can use the corresponding first signature public key to verify the first signature result in each initial integrity check information. After each first signature result is verified, each aggregation gateway 14 then The second-level initial hash tree corresponding to each aggregation gateway can be constructed according to the first-level initial root node of each first-level initial hash tree; then the second-level initial root node of each second-level initial hash tree can be obtained, and The second-level initial root node of the second-level initial hash tree can be signed by obtaining the second signature private key from the key management server 13, and the integrity check information containing the second signature result can be signed. Send to the verification server 12. The verification server 12 can use the corresponding second signature public key to verify each second signature result in each integrity verification information. After each second signature result is verified, the verification server 12 can The target hash tree is constructed according to the second-level initial root node of each second-level initial hash tree, and the target root node of the target hash tree can be compared with the local root node of the local hash tree to determine each The integrity of the terminal equipment.
由上可知,在对终端设备进行完整性校验时,所述终端设备10和所述聚合网关14均仅需要对相关哈希树的根节点进行签名,而不需要对每一个文件进行签名,极大地减少了所述终端设备10和所述聚合网关14的计算量,缓解了所述终端设备10和所述聚合网关14的计算负担。It can be seen from the above that when performing integrity verification on a terminal device, both the terminal device 10 and the aggregation gateway 14 only need to sign the root node of the relevant hash tree, instead of signing every file. The calculation amount of the terminal device 10 and the aggregation gateway 14 is greatly reduced, and the calculation burden of the terminal device 10 and the aggregation gateway 14 is alleviated.
所述终端设备10可以为手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The terminal device 10 may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer). On terminal devices such as computer, UMPC), netbooks, and personal digital assistants (personal digital assistants, PDAs), the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
以所述终端设备10为手机为例。图3示出的是与本申请实施例提供的手机的部分结构的框图。参考图3,手机包括:射频(Radio Frequency,RF)电路310、存储器320、输入单元330、显示单元340、传感器350、音频电路360、无线保真(wireless fidelity,WiFi)模块370、处理器380、以及电源390等部件。本领域技术人员可以理解,图3中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Take the terminal device 10 as a mobile phone as an example. Fig. 3 shows a block diagram of a part of the structure of a mobile phone provided in an embodiment of the present application. 3, the mobile phone includes: a radio frequency (RF) circuit 310, a memory 320, an input unit 330, a display unit 340, a sensor 350, an audio circuit 360, a wireless fidelity (WiFi) module 370, and a processor 380 , And power supply 390 and other components. Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 3 does not constitute a limitation on the mobile phone, and may include more or less components than those shown in the figure, or a combination of some components, or different component arrangements.
下面结合图3对手机的各个构成部件进行具体的介绍:The following is a detailed introduction to each component of the mobile phone in conjunction with Figure 3:
RF电路310可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器380处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路310还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication, GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 310 can be used for receiving and sending signals during the process of sending and receiving information or talking. In particular, after receiving the downlink information of the base station, it is processed by the processor 380; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 310 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
存储器320可用于存储软件程序以及模块,处理器380通过运行存储在存储器320的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器320可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器320可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 320 may be used to store software programs and modules. The processor 380 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 320. The memory 320 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of mobile phones (such as audio data, phone book, etc.), etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
输入单元330可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元330可包括触控面板331以及其他输入设备332。触控面板331,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板331上或在触控面板331附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板331可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器380,并能接收处理器380发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板331。除了触控面板331,输入单元330还可以包括其他输入设备332。具体地,其他输入设备332可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 330 may be used to receive inputted digital or character information, and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 330 may include a touch panel 331 and other input devices 332. The touch panel 331, also called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 331 or near the touch panel 331. Operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 331 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 380, and can receive and execute the commands sent by the processor 380. In addition, the touch panel 331 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 331, the input unit 330 may also include other input devices 332. Specifically, the other input device 332 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
显示单元340可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元340可包括显示面板341,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板341。进一步的,触控面板331可覆盖显示面板341,当触控面板331检测到在其上或附近的触摸操作后,传送给处理器380以确定触摸事件的类型,随后处理器380根据触摸事件的类型在显示面板341上提供相应的视觉输出。虽然在图3中,触控面板331与显示面板341是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板331与显示面板341集成而实现手机的输入和输出功能。The display unit 340 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 340 may include a display panel 341. Optionally, the display panel 341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 331 can cover the display panel 341. When the touch panel 331 detects a touch operation on or near it, it transmits it to the processor 380 to determine the type of the touch event, and then the processor 380 determines the type of the touch event. The type provides corresponding visual output on the display panel 341. Although in FIG. 3, the touch panel 331 and the display panel 341 are used as two independent components to realize the input and input functions of the mobile phone, but in some embodiments, the touch panel 331 and the display panel 341 can be integrated. Realize the input and output functions of the mobile phone.
手机还可包括至少一种传感器350,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板341的亮度,接近传感器可在手机移动到耳边时,关闭显示面板341和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The mobile phone may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 341 according to the brightness of the ambient light. The proximity sensor can close the display panel 341 and/or when the mobile phone is moved to the ear. Or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when it is stationary. It can be used to identify mobile phone posture applications (such as horizontal and vertical screen switching, related Games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, percussion), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which can also be configured in mobile phones, I will not here Go into details.
音频电路360、扬声器361,传声器362可提供用户与手机之间的音频接口。音频电路360可将接收到的音频数据转换后的电信号,传输到扬声器361,由扬声器361转换为声音信号输出;另一方面,传声器362将收集的声音信号转换为电信号,由音频电路360接收后转换为音频数据, 再将音频数据输出处理器380处理后,经RF电路310以发送给比如另一手机,或者将音频数据输出至存储器320以便进一步处理。The audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the mobile phone. The audio circuit 360 can transmit the electrical signal converted from the received audio data to the speaker 361, and the speaker 361 converts it into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is then output by the audio circuit 360. After being received, it is converted into audio data, and then processed by the audio data output processor 380, and sent to, for example, another mobile phone via the RF circuit 310, or the audio data is output to the memory 320 for further processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块370可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图3示出了WiFi模块370,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 370. It provides users with wireless broadband Internet access. Although FIG. 3 shows the WiFi module 370, it is understandable that it is not a necessary component of the mobile phone, and can be omitted as needed without changing the essence of the invention.
处理器380是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器320内的软件程序和/或模块,以及调用存储在存储器320内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器380可包括一个或多个处理单元;优选的,处理器380可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器380中。The processor 380 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes by running or executing software programs and/or modules stored in the memory 320, and calling data stored in the memory 320. Various functions and processing data of the mobile phone can be used to monitor the mobile phone as a whole. Optionally, the processor 380 may include one or more processing units; preferably, the processor 380 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 380.
手机还包括给各个部件供电的电源390(比如电池),优选的,电源可以通过电源管理系统与处理器380逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone also includes a power source 390 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 380 through a power management system, so that functions such as charging, discharging, and power management can be managed through the power management system.
尽管未示出,手机还可以包括摄像头。可选地,摄像头在手机的上的位置可以为前置的,也可以为后置的,本申请实施例对此不作限定。Although not shown, the mobile phone may also include a camera. Optionally, the position of the camera on the mobile phone may be front-mounted or rear-mounted, which is not limited in the embodiment of the present application.
可选地,手机可以包括单摄像头、双摄像头或三摄像头等,本申请实施例对此不作限定。Optionally, the mobile phone may include a single camera, a dual camera, or a triple camera, etc., which is not limited in the embodiment of the present application.
例如,手机可以包括三摄像头,其中,一个为主摄像头、一个为广角摄像头、一个为长焦摄像头。For example, a mobile phone may include three cameras, of which one is a main camera, one is a wide-angle camera, and one is a telephoto camera.
可选地,当手机包括多个摄像头时,这多个摄像头可以全部前置,或者全部后置,或者一部分前置、另一部分后置,本申请实施例对此不作限定。Optionally, when the mobile phone includes multiple cameras, the multiple cameras may be all front-mounted, or all rear-mounted, or partly front-mounted and another part rear-mounted, which is not limited in the embodiment of the present application.
另外,尽管未示出,手机还可以包括蓝牙模块等,在此不再赘述。In addition, although not shown, the mobile phone may also include a Bluetooth module, etc., which will not be repeated here.
图4是本申请实施例的手机的软件结构示意图。以手机操作系统为Android系统为例,在一些实施例中,将Android系统分为四层,分别为应用程序层、应用程序框架层(framework,FWK)、系统层以及硬件抽象层,层与层之间通过软件接口通信。Fig. 4 is a schematic diagram of the software structure of a mobile phone according to an embodiment of the present application. Taking the Android system as the mobile phone operating system as an example, in some embodiments, the Android system is divided into four layers, namely the application layer, the application framework layer (framework, FWK), the system layer, and the hardware abstraction layer. Through the software interface communication between.
如图4所示,所述应用程序层可以一系列应用程序包,应用程序包可以包括短信息,日历,相机,视频,导航,图库,通话等应用程序。As shown in Figure 4, the application layer can be a series of application packages, which can include applications such as short message, calendar, camera, video, navigation, gallery, and call.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数,例如用于接收应用程序框架层所发送的事件的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer may include some predefined functions, such as functions for receiving events sent by the application framework layer.
如图4所示,应用程序框架层可以包括窗口管理器、资源管理器以及通知管理器等。As shown in Figure 4, the application framework layer can include a window manager, a resource manager, and a notification manager.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc. The content provider is used to store and retrieve data and make these data accessible to applications. The data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用 程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
应用程序框架层还可以包括:The application framework layer can also include:
视图系统,所述视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。A view system, which includes visual controls, such as controls that display text, controls that display pictures, and so on. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
电话管理器用于提供手机的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the mobile phone. For example, the management of the call status (including connecting, hanging up, etc.).
系统层可以包括多个功能模块。例如:传感器服务模块,物理状态识别模块,三维图形处理库(例如:OpenGL ES)等。The system layer can include multiple functional modules. For example: sensor service module, physical state recognition module, 3D graphics processing library (for example: OpenGL ES), etc.
传感器服务模块,用于对硬件层各类传感器上传的传感器数据进行监测,确定手机的物理状态;The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer to determine the physical state of the mobile phone;
物理状态识别模块,用于对用户手势、人脸等进行分析和识别;Physical state recognition module, used to analyze and recognize user gestures, faces, etc.;
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
系统层还可以包括:The system layer can also include:
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
硬件抽象层是硬件和软件之间的层。硬件抽象层可以包括显示驱动,摄像头驱动,传感器驱动等,用于驱动硬件层的相关硬件,如显示屏、摄像头、传感器等。The hardware abstraction layer is the layer between hardware and software. The hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., used to drive related hardware at the hardware layer, such as display screens, cameras, sensors, and so on.
【实施例一】[Embodiment One]
实施例一提供的完整性校验方法可以在具有上述硬件结构/软件结构的手机上实现,以对手机的下载文件进行完整性校验,即手机从文件服务器中下载到文件后,可以在应用该文件之前通过本实施例提供的完整性校验方法对该文件进行完整性校验,确保手机下载到的文件为未被篡改、版本合法、来源可追溯的文件。以下将结合图1所示的完整性校验系统对本实施例提供的完整性校验方法进行详细说明。The integrity verification method provided by the first embodiment can be implemented on a mobile phone with the above hardware structure/software structure to verify the integrity of the downloaded file of the mobile phone, that is, after the mobile phone downloads the file from the file server, it can be used in the application The integrity of the file was previously verified by the integrity verification method provided in this embodiment to ensure that the file downloaded by the mobile phone is a file that has not been tampered with, has a legal version, and has a traceable source. The integrity verification method provided in this embodiment will be described in detail below in conjunction with the integrity verification system shown in FIG. 1.
如图5所示,本实施例提供的完整性校验方法可以包括:As shown in FIG. 5, the integrity verification method provided in this embodiment may include:
S501、获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为基于所述文件服务器中的所有文件构建的哈希树;S501. Obtain a file to be verified sent by a file server and integrity verification information of the file to be verified, where the integrity verification information includes signing the target root node of the target hash tree using the first signature private key. The root node signature information of the target hash tree, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, and the target hash tree is based on the The hash tree constructed by all the files in the file server;
应理解,在文件服务器初始化或者进行文件更新时,所述文件服务器可以构建所述文件服务器内所有文件对应的目标哈希树,并可以对所述目标哈希树的目标根节点进行签名,以得到所述目标根节点对应的根节点签名信息。It should be understood that when the file server is initialized or files are updated, the file server may construct a target hash tree corresponding to all files in the file server, and may sign the target root node of the target hash tree to Obtain the root node signature information corresponding to the target root node.
示例的,所述文件服务器也可以将所述目标哈希树的目标根节点发送至验证服务器,所述验证服务器则可以对所述目标根节点进行签名,并可以将签名得到的根节点签名信息和签名对应的签名公钥返回至所述文件服务器,以实现目标根节点的生成和签名分离的目的,降低根节点签名信息被攻击的风险。For example, the file server may also send the target root node of the target hash tree to the verification server, and the verification server may sign the target root node, and may send the root node signature information obtained by the signature The signature public key corresponding to the signature is returned to the file server to achieve the purpose of generating the target root node and separating the signature, and reduce the risk of the root node signature information being attacked.
需要说明的是,所述文件服务器或者所述验证服务器可以通过从密钥管理服务器中获取签名密钥(包括第一签名私钥和第一签名公钥)来对所述目标根节点进行签名,具体地,可以通过所 述第一签名私钥来对所述目标根节点进行签名。在此,所述签名密钥可以为任意签名算法对应的签名密钥,本实施例对此不作限定。It should be noted that the file server or the verification server may sign the target root node by obtaining the signature key (including the first signature private key and the first signature public key) from the key management server, Specifically, the target root node may be signed by the first signature private key. Here, the signature key may be a signature key corresponding to any signature algorithm, which is not limited in this embodiment.
例如,所述签名密钥可以为RSA签名算法对应的签名密钥,假设RSA签名算法对应的第一签名私钥为d,第一签名公钥为(e,n)时,则所述目标根节点H_root的根节点签名信息可以为sign(H_root)=(H_root) dmod n。 For example, the signature key may be the signature key corresponding to the RSA signature algorithm. Assuming that the first signature private key corresponding to the RSA signature algorithm is d and the first signature public key is (e, n), then the target root The root node signature information of the node H_root may be sign(H_root)=(H_root) d mod n.
应理解,在对所述目标根节点进行签名时,还可以加入签名有效时间信息,以使得根节点签名信息的有效时间缩短,降低根节点签名信息被攻击的攻击时间窗,降低根节点签名信息被攻击的风险。It should be understood that when signing the target root node, signature validity time information can also be added to shorten the validity time of the root node signature information, reduce the attack time window for the root node signature information to be attacked, and reduce the root node signature information Risk of being attacked.
在一种可能的实现方式中,所述目标哈希树可以为三叉哈希树,以通过三叉哈希树来减少哈希树的层次,减少完整性校验所需的完整性校验信息,减少带宽占用。In a possible implementation manner, the target hash tree may be a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, and reduce the integrity check information required for the integrity check. Reduce bandwidth usage.
作为示例而非限定,所述目标哈希树的叶子节点可以为所述文件服务器中任一文件的文件名与该文件的文件元数据的哈希值,而除叶子节点以外的其他节点则可以为该节点的所有子节点的哈希值。As an example and not a limitation, the leaf node of the target hash tree may be the file name of any file in the file server and the hash value of the file metadata of the file, and other nodes except the leaf node may be It is the hash value of all child nodes of this node.
例如,图5a示出了所述文件服务器构建的一个三层目标哈希树的示例图,该三层目标哈希树中一层的叶子节点H_leaf i可以为H(f_i||matadata i),二层的子节点H_father j可以为H(H_leaf i-1||H_leaf i||H_leaf i+1),其中,H_leaf i-1、H_leaf i和H_leaf i+1为H_father j的子节点,三层的目标根节点H_root可以为H(H_father 1||H_father 2||H_father 3)。在此,f_i为文件名,matadata i为元数据,||为连接符,H为哈希函数。应理解,所述哈希函数可以为安全哈希函数(例如可以为SHA-256),也可以为其他任意类型的哈希函数,本实施例对此不作限定。 For example, Figure 5a shows an example diagram of a three-layer target hash tree constructed by the file server. The leaf node H_leaf i of one layer in the three-layer target hash tree can be H(f_i||matadata i ), The child node H_father j of the second layer can be H(H_leaf i-1 ||H_leaf i ||H_leaf i+1 ), where H_leaf i-1 , H_leaf i and H_leaf i+1 are the child nodes of H_father j , the third layer The target root node H_root can be H(H_father 1 ||H_father 2 ||H_father 3 ). Here, f_i is the file name, matadata i is the metadata, || is the connector, and H is the hash function. It should be understood that the hash function may be a secure hash function (for example, SHA-256), or any other type of hash function, which is not limited in this embodiment.
应理解,当手机向所述文件服务器发送文件获取请求以请求某一文件时,或者当所述文件服务器向手机发送某一文件的文件更新指示,而手机根据该文件更新指令确认进行文件更新时,所述文件服务器则可以将该文件发送至手机,并可以将该文件对应的完整性校验信息发送至手机。在此,手机所获取的该文件即为S601中所述的待校验文件。It should be understood that when the mobile phone sends a file acquisition request to the file server to request a certain file, or when the file server sends a file update instruction for a certain file to the mobile phone, and the mobile phone confirms the file update according to the file update instruction , The file server can send the file to the mobile phone, and can send the integrity check information corresponding to the file to the mobile phone. Here, the file obtained by the mobile phone is the file to be verified in S601.
可以理解的是,所述完整性校验信息可以包括该待校验文件对应的目标哈希树的根节点签名信息、所述目标哈希树中与该待校验文件相关的子节点以及第一签名公钥。其中,所述根节点签名信息为所述文件服务器或者所述验证服务器利用第一签名私钥对所述目标哈希树的根节点进行签名后的信息,所述第一签名公钥与所述第一签名私钥相对应。所述目标哈希树中与该待校验文件相关的子节点可以包括所述目标哈希树中与该待校验文件属于同一父节点H_father j的叶子节点、父节点H_father j到目标根节点的完整哈希路径上的子节点以及目标根节点。 It is understandable that the integrity verification information may include signature information of the root node of the target hash tree corresponding to the file to be verified, child nodes in the target hash tree that are related to the file to be verified, and the first A signature public key. Wherein, the root node signature information is information obtained by the file server or the verification server using the first signature private key to sign the root node of the target hash tree, and the first signature public key and the The first signature private key corresponds. The child nodes related to the file to be verified in the target hash tree may include leaf nodes in the target hash tree that belong to the same parent node H_father j as the file to be verified, and from the parent node H_father j to the target root node. The child nodes on the full hash path and the target root node.
具体地,父节点H_father j到目标根节点的完整哈希路径上的子节点是指由父节点H_father j开始生成所述目标哈希树的目标根节点所需的所有子节点。 Specifically, the child nodes on the complete hash path from the parent node H_father j to the target root node refer to all child nodes required by the parent node H_father j to start generating the target root node of the target hash tree.
例如,在图5a所示的应用场景中,当H_leaf 6对应的文件f_6为所述文件服务器发送至手机的待校验文件时,则H_leaf 6对应的父节点H_father 2到目标根节点H_root的完整哈希路径上的子节点可以包括H_father 1和H_father 3,即所述目标哈希树中与待校验文件f_6相关的子节点可以包括叶子节点H_leaf 4、叶子节点H_leaf 5、子节点H_father 1、子节点H_father 3以及根节点H_root。 For example, in the application scenario shown in Figure 5a, when the file f_6 corresponding to H_leaf 6 is the file to be verified sent by the file server to the mobile phone, then the parent node H_father 2 corresponding to H_leaf 6 to the target root node H_root is complete The child nodes on the hash path may include H_father 1 and H_father 3 , that is, the child nodes related to the file to be verified f_6 in the target hash tree may include leaf nodes H_leaf 4 , leaf nodes H_leaf 5 , and child nodes H_father 1 , Child node H_father 3 and root node H_root.
例如,在图5b所示的应用场景中,当H_leaf 6对应的文件f_6为所述文件服务器发送至手机的待校验文件时,则H_leaf 6对应的父节点H_ffather 2到目标根节点H_root的完整哈希路径上的子节点可以包括H_ffather 1、H_ffather 3、H_sfather 1、H_sfather 3、H_tfather 2和H_tfather 3,即所述目标哈希树中与待校验文件f_6相关的子节点可以包括叶子节点H_leaf 4、叶子节点H_leaf 5、子节点 H_ffather 1、子节点H_ffather 3、子节点H_sfather 1、子节点H_sfather 3、子节点H_tfather 2和子节点H_tfather 3以及根节点H_root。 For example, in the application scenario shown in Figure 5b, when the file f_6 corresponding to H_leaf 6 is the file to be verified sent by the file server to the mobile phone, then the parent node H_ffather 2 corresponding to H_leaf 6 to the target root node H_root is complete The child nodes on the hash path may include H_ffather 1 , H_ffather 3 , H_sfather 1 , H_sfather 3 , H_tfather 2 and H_tfather 3 , that is, the child nodes related to the file to be verified f_6 in the target hash tree may include leaf nodes H_leaf 4. Leaf node H_leaf 5 , child node H_ffather 1 , child node H_ffather 3 , child node H_sfather 1 , child node H_sfather 3 , child node H_tfather 2 and child node H_tfather 3, and root node H_root.
S502、利用所述第一签名公钥对所述根节点签名信息进行验证;S502. Use the first signature public key to verify the signature information of the root node.
应理解,手机获取的完整性校验信息可以包括所述根节点签名信息和所述根节点签名信息对应的原始信息(即所述目标根节点H_root)。It should be understood that the integrity check information obtained by the mobile phone may include the root node signature information and the original information corresponding to the root node signature information (that is, the target root node H_root).
在此,手机获取到该待校验文件和该待校验文件对应的完整性校验信息后,可以利用该完整性校验信息中的第一签名公钥对所述根节点签名信息进行验证,以确定所述完整性校验信息是否为来源合法、可追溯的校验信息,从而确定所述待校验文件是否为来源合法、可追溯的文件。Here, after the mobile phone obtains the file to be verified and the integrity verification information corresponding to the file to be verified, the first signature public key in the integrity verification information can be used to verify the root node signature information , To determine whether the integrity check information is a valid and traceable source, so as to determine whether the to-be-verified file is a valid and traceable source.
例如,在所述第一签名公钥为(e,n)以及所述目标根节点H_root的根节点签名信息为sign(H_root)=(H_root) dmod n的应用场景中,手机可以利用所述第一签名公钥(e,n)对sign(H_root)进行验签,得到验签信息H’_root=(sign(H_root)) emod n,以根据所述验签信息H’_root和所述目标根节点H_root来确定所述完整性校验信息是否为来源合法、可追溯的校验信息。 For example, in an application scenario where the first signature public key is (e, n) and the root node signature information of the target root node H_root is sign(H_root)=(H_root) d mod n, the mobile phone can use the The first signature public key (e, n) verifies the sign (H_root), and obtains the verification information H'_root=(sign(H_root)) e mod n, which is based on the verification information H'_root and the The target root node H_root is used to determine whether the integrity check information is the check information whose source is legal and traceable.
其中,当所述验签信息H’_root和所述目标根节点H_root相同时,则可得到所述根节点签名信息验证通过的校验结果,其中,验证通过表明所述完整性校验信息为来源合法、可追溯的校验信息,可以用于所述待校验文件的完整性校验,以确定所述待校验文件的完整性以及确定所述待校验文件是否为来源合法、可追溯的文件。而当所述验签信息H’_root和所述目标根节点H_root不相同时,则可得到所述根节点签名信息验证不通过的校验结果,其中,验证不通过表明所述完整性校验信息不是来源合法、可追溯的校验信息,从而可以直接确定所述待校验文件为来源不合法的文件。Wherein, when the verification information H'_root and the target root node H_root are the same, the verification result of the root node signature information verification passing can be obtained, wherein the verification passing indicates that the integrity verification information is The verification information whose source is legal and traceable can be used for the integrity verification of the document to be verified to determine the integrity of the document to be verified and to determine whether the document to be verified is of a legitimate source and can be verified. Traceable documents. When the verification information H'_root and the target root node H_root are not the same, a verification result that the root node signature information verification fails can be obtained, wherein the verification failure indicates the integrity check The information is not verified information whose source is legal and traceable, so that it can be directly determined that the document to be verified is a document whose source is illegal.
需要说明的是,当所述校验结果为所述根节点签名信息验证不通过的校验结果时,手机可以在手机的校验日志中对所述待校验文件为来源不合法的校验结果进行记录,以方便后续进行校验结果的查看,同时,手机还可以实时在手机的显示屏幕中进行校验结果的呈现,提醒该手机所在的用户其当前所获取的文件可能为来源不合法的文件,告知用户当前的文件下载风险。It should be noted that when the verification result is the verification result that the root node signature information verification fails, the mobile phone can verify the file to be verified as having an illegal source in the verification log of the mobile phone. The results are recorded to facilitate the subsequent review of the verification results. At the same time, the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located that the file currently obtained may be of an illegal source File to inform users of the current file download risk.
S503、当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;S503: When the root node signature information is verified, construct a current root node corresponding to the target hash tree according to the file to be verified and the child node;
应理解,当所述根节点签名信息验证通过时,即当所述完整性校验信息为来源合法、可追溯的校验信息时,手机则可以根据所述待校验文件以及所述完整性校验信息中的子节点构建所述目标哈希树对应的当前根节点。It should be understood that when the root node signature information is verified, that is, when the integrity verification information is verification information whose source is legal and traceable, the mobile phone can use the file to be verified and the integrity verification information. The child nodes in the verification information construct the current root node corresponding to the target hash tree.
例如,当所述待校验文件为图5a中所示的H_leaf 6对应的文件f_6时,手机首先可以根据文件f_6的文件名f_6和元件元数据matadata 6’计算得到所述待校验文件对应的叶子节点H’_leaf 6=H(f_6||matadata 6’);然后,可以根据H’_leaf 6以及所述完整性校验信息中与H’_leaf 6属于同一父节点的叶子节点H_leaf 4和叶子节点H_leaf 5计算得到子节点H’_father 2=H(H(f_4||matadata 4)||H(f_5||matadata 5)||H’(f_6||matadata 6));最后,可以根据H’_father 2以及H’_father 2到目标根节点H_root的完整哈希路径上的子节点H_father 1和H_father 3计算得到所述目标哈希树对应的当前根节点H’_root=H(H_father 1||H’_father 2||H_father 3)。 For example, when the file to be verified is the file f_6 corresponding to H_leaf 6 shown in Figure 5a, the mobile phone can first calculate the file to be verified according to the file name f_6 of the file f_6 and the component metadata matadata 6 ' The leaf node H'_leaf 6 = H(f_6||matadata 6 '); then, according to H'_leaf 6 and the integrity check information, the leaf nodes H'_leaf 6 belonging to the same parent node H_leaf 4 and H'_leaf 6 The leaf node H_leaf 5 calculates the child node H'_father 2 = H(H(f_4||matadata 4 )||H(f_5||matadata 5 )||H'(f_6||matadata 6 )); finally, it can be based on The child nodes H_father 1 and H_father 3 on the complete hash path from H'_father 2 and H'_father 2 to the target root node H_root are calculated to obtain the current root node H'_root = H(H_father 1 | |H'_father 2 ||H_father 3 ).
在此,手机也可以根据所述待校验文件和所述子节点还原构建所述目标哈希树,然后将还原后的目标哈希树的根节点确定为所述目标哈希树的当前根节点,即手机可以首先计算所述待校验文件的文件名和文件元数据的哈希值,并可以将计算得到的哈希值确定为所述待校验文件对应的叶子节点,然后可以根据该叶子节点和所述完整性校验信息中的子节点还原构建所述目标哈希树。Here, the mobile phone may also restore and construct the target hash tree according to the file to be verified and the child nodes, and then determine the root node of the restored target hash tree as the current root of the target hash tree Node, that is, the mobile phone can first calculate the file name of the file to be verified and the hash value of the file metadata, and can determine the calculated hash value as the leaf node corresponding to the file to be verified, and then can be based on the The leaf node and the child nodes in the integrity check information restore and construct the target hash tree.
需要说明的是,还原构建的目标哈希树中各节点的位置与原始的目标哈希树中的各节点的位置相同,以避免节点位置错误而造成哈希值的计算错误,从而降低完整性校验的准确性。即所述完整性校验信息中还可以包括所述待校验文件对应的叶子节点在目标哈希树中的位置信息以及各所述子节点在目标哈希树中的位置信息。因此,手机在根据所述待校验文件和所述完整性校验信息中的各子节点还原构建所述目标哈希树时,可以结合所述待校验文件的位置信息和各所述子节点的位置信息来还原构建所述目标哈希树。例如,当所述待校验文件为图5a中所示的H_leaf 6对应的文件f_6时,手机根据所述待校验文件和所述完整性校验信息中的子节点可以构建得到如图5c所示的目标哈希树。 It should be noted that the position of each node in the target hash tree constructed by the restoration is the same as the position of each node in the original target hash tree, so as to avoid the error of the node position and the calculation error of the hash value, thereby reducing the integrity The accuracy of the calibration. That is, the integrity check information may also include the position information of the leaf node corresponding to the file to be checked in the target hash tree and the position information of each of the child nodes in the target hash tree. Therefore, when the mobile phone restores and constructs the target hash tree according to the file to be verified and each child node in the integrity check information, it can combine the location information of the file to be verified with each child node. The location information of the node is restored to construct the target hash tree. For example, when the file to be verified is the file f_6 corresponding to H_leaf 6 shown in FIG. 5a, the mobile phone can construct the child node according to the file to be verified and the integrity check information as shown in FIG. 5c. The target hash tree shown.
S504、根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。S504: Verify the integrity of the file to be verified according to the current root node and the target root node.
具体地,手机根据所述待校验文件和所述完整性校验信息中的子节点构建出所述目标哈希树对应的当前根节点后,可以将所述目标哈希树的当前根节点与所述目标哈希树的目标根节点进行比对,以此确定所述待校验文件的完整性。其中,当所述当前根节点与所述目标根节点相同时,则可以得到所述待校验文件的完整性校验通过的校验结果,完整性校验通过是指所述待校验文件为从所述文件服务器获取的内容完整未被篡改的、来源合法的、可追溯的文件;当所述当前根节点与所述目标根节点不相同时,则可以得到所述待校验文件的完整性校验不通过的校验结果,完整性校验不通过是指所述待校验文件为完整性遭到破坏的文件,即可以表明所述待校验文件为内容被篡改的文件。Specifically, after the mobile phone constructs the current root node corresponding to the target hash tree according to the file to be verified and the child nodes in the integrity verification information, the current root node of the target hash tree may be Compare with the target root node of the target hash tree to determine the integrity of the file to be verified. Wherein, when the current root node is the same as the target root node, the verification result of the integrity verification of the file to be verified can be obtained, and the integrity verification refers to the file to be verified. It is a file whose content obtained from the file server is complete and has not been tampered with, and whose source is legal and traceable; when the current root node is not the same as the target root node, the information of the file to be verified can be obtained The result of the verification that the integrity check fails, which means that the file to be verified is a file whose integrity has been damaged, that is, it can indicate that the file to be verified is a file whose content has been tampered with.
需要说明的是,当手机得到的是所述待校验文件的完整性校验不通过的校验结果时,手机可以在手机的校验日志中对所述待校验文件的完整性校验不通过的校验结果进行记录,以方便后续进行校验结果的查看,同时,手机还可以实时在手机的显示屏幕中进行校验结果的呈现,提醒该手机所在的用户其当前所获取的文件可能为内容被篡改的文件,告知用户当前的文件下载风险。It should be noted that when the mobile phone obtains the verification result that the integrity check of the file to be verified fails, the mobile phone can verify the integrity of the file to be verified in the verification log of the mobile phone. The failed verification results are recorded to facilitate the subsequent review of verification results. At the same time, the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located about the files currently obtained It may be a file whose content has been tampered with, and inform the user of the current file download risk.
本实施例,通过使用哈希树及对哈希树根节点签名的方式来对手机的下载文件进行完整性校验,使得仅需对根节点进行签名即可完成完整性校验,而不需要对每一个文件进行签名,极大地减少了签名的计算量,缓解了计算负担。In this embodiment, the integrity check is performed on the downloaded file of the mobile phone by using the hash tree and the way of signing the root node of the hash tree, so that the integrity check can be completed by signing the root node only, without the need Signing each file greatly reduces the amount of signature calculation and eases the calculation burden.
在完整性校验中,当所述待校验文件存在历史版本时,若利用历史版本的待校验文件替换当前版本的待校验文件发送至手机,手机在对接收到的待校验文件进行完整性校验时,也可以得到该待校验文件的完整性校验通过的校验结果,但此时手机获取的待校验文件并不是手机所请求的文件或者并不是文件服务器所期望发送至手机的文件,而可能是攻击者重新投放的文件。因此,为抵抗利用历史版本文件进行的重放攻击,在根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性之后,当得到的校验结果为所述待校验文件的完整性校验通过的校验结果时,手机还可以获取所述待校验文件的目标版本校验信息,并可以根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性,其中,所述目标版本校验信息可以为根据所述待校验文件的目标文件版本生成的版本校验信息。In the integrity verification, when the document to be verified has a historical version, if the document to be verified in the historical version is used to replace the document to be verified in the current version and sent to the mobile phone, the mobile phone is checking the received document to be verified. When performing integrity verification, you can also get the verification result of the integrity verification of the file to be verified, but the file to be verified obtained by the mobile phone at this time is not the file requested by the mobile phone or is not expected by the file server A file sent to a mobile phone, but it may be a file reposted by an attacker. Therefore, in order to resist replay attacks using historical version files, after verifying the integrity of the file to be verified according to the current root node and the target root node, when the obtained verification result is the to-be-verified file When verifying the verification result that the integrity of the file is verified, the mobile phone can also obtain the verification information of the target version of the file to be verified, and can be based on the current file version of the file to be verified and the target version The verification information verifies the validity of the version of the file to be verified, wherein the target version verification information may be version verification information generated according to the target file version of the file to be verified.
在此,通过将完整性校验和版本合法性校验分开请求的方式,使得可以通过密码学安全的方式来验证待校验文件的真实版本,以降低文件替换和重放攻击的风险。Here, by separately requesting the integrity check and the version legality check, the true version of the file to be verified can be verified in a cryptographically safe manner, so as to reduce the risk of file replacement and replay attacks.
需要说明的是,所述文件服务器在将所述待校验文件和所述待校验文件对应的完整性校验信息发送至手机时,还可以实时根据其所发送的待校验文件的目标文件版本生成所述待校验文件的目标版本校验信息,并可以基于手机发送的版本校验信息获取请求将所述目标版本校验信息发送给手机。It should be noted that when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it can also real-time according to the target of the file to be verified. The file version generates target version verification information of the file to be verified, and can send the target version verification information to the mobile phone based on the version verification information acquisition request sent by the mobile phone.
可选地,所述文件服务器在将所述待校验文件和所述待校验文件对应的完整性校验信息发送至手机时,还可以实时将其所发送的待校验文件的目标文件版本发送至验证服务器,所述验证服务器则可以根据所述目标文件版本生成所述待校验文件的目标版本校验信息,并可以基于手机发送的版本校验信息获取请求将所述目标版本校验信息发送给手机,以通过验证服务器执行校验信息的生成来进行风险分担,从而降低目标版本校验信息被攻击的风险。Optionally, when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also send the target file of the file to be verified in real time. The version is sent to the verification server, and the verification server may generate the target version verification information of the file to be verified according to the target file version, and may verify the target version based on the version verification information acquisition request sent by the mobile phone. The verification information is sent to the mobile phone to perform risk sharing by generating verification information by the verification server, thereby reducing the risk of the target version verification information being attacked.
示例的,所述文件服务器或者所述验证服务器可以利用任一签名算法对应的签名密钥对所述目标文件版本进行签名,并可以将签名得到的所述目标文件版本对应的版本签名信息作为所述目标版本校验信息。For example, the file server or the verification server may use a signature key corresponding to any signature algorithm to sign the target file version, and may use the version signature information corresponding to the target file version obtained by the signature as the all Describe the target version verification information.
在此,手机得到所述待校验文件的完整性校验通过的校验结果后,可以向所述文件服务器或者所述验证服务器发送版本校验请求,以通过版本校验确定所述待校验文件是否为替换文件等。所述文件服务器或者所述验证服务器则可以根据所述版本校验请求将前述签名得到的版本签名信息和所对应的签名公钥发送至手机,手机则可以利用所接收到的签名公钥对所述版本签名信息进行验证,并可以将验证通过的目标文件版本与手机当前接收到的当前文件版本进行比较。若两者相同,则可确定当前文件版本的待校验文件为版本合法的文件,即可以认为当前文件版本的待校验文件为所述文件服务器发送的合法文件;若两者不相同,则可确定当前文件版本的待校验文件为版本不合法的文件,即可以认为当前文件版本的待校验文件可能为替换文件,表明所述文件服务器发送给手机的文件可能已被攻击者进行了文件替换等。Here, after the mobile phone obtains the verification result that the integrity verification of the file to be verified is passed, it may send a version verification request to the file server or the verification server to determine the verification of the file to be verified through the version verification. Check whether the file is a replacement file, etc. The file server or the verification server can send the version signature information obtained by the aforementioned signature and the corresponding signature public key to the mobile phone according to the version verification request, and the mobile phone can use the received signature public key to verify the The version signature information is verified, and the verified target file version can be compared with the current file version currently received by the mobile phone. If the two are the same, it can be determined that the file to be verified of the current file version is a legal version, that is, the file to be verified of the current file version can be considered as a legal file sent by the file server; if the two are not the same, then It can be determined that the file to be verified of the current file version is an illegal version, that is, it can be considered that the file to be verified of the current file version may be a replacement file, indicating that the file sent by the file server to the mobile phone may have been processed by the attacker File replacement, etc.
在一种可能的实现方式中,所述文件服务器或者所述验证服务器可以通过变色龙签名算法对所述目标文件版本进行签名,即所述目标版本校验信息可以为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息,以利用变色龙签名的不可否认性、非交互性以及不可传递的特点保证版本信息的唯一合法性,降低泄漏风险。In a possible implementation manner, the file server or the verification server may sign the target file version using the chameleon signature algorithm, that is, the target version verification information may be based on the target file version and the The chameleon signature information generated by the device identifier of the terminal device uses the non-repudiation, non-interactivity, and non-transmission characteristics of the chameleon signature to ensure the unique legitimacy of the version information and reduce the risk of leakage.
示例的,所述文件服务器在将所述待校验文件和所述待校验文件对应的完整性校验信息发送至手机时,还可以实时利用变色龙签名算法生成所发送的待校验文件的目标文件版本和接收所述待校验文件的手机的设备标识(例如手机的设备ID或者设备编号等)的变色龙签名信息。For example, when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also use the chameleon signature algorithm to generate the information of the sent file to be verified in real time. The target file version and the chameleon signature information of the device identification (such as the device ID or device number of the mobile phone, etc.) of the mobile phone receiving the file to be verified.
可选地,所述文件服务器在将所述待校验文件和所述待校验文件对应的完整性校验信息发送至手机时,还可以实时将其所发送的待校验文件的目标文件版本和接收所述待校验文件的手机的设备标识发送至验证服务器,所述验证服务器则可以利用变色龙签名算法生成所述目标文件版本和所述设备标识对应的变色龙签名信息,以通过验证服务器执行变色龙签名操作来进行风险分担,从而降低目标版本校验信息被攻击的风险。Optionally, when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also send the target file of the file to be verified in real time. The version and the device identification of the mobile phone receiving the file to be verified are sent to the verification server, and the verification server may use the chameleon signature algorithm to generate the target file version and the chameleon signature information corresponding to the device identification to pass the verification server Perform the chameleon signature operation to share the risk, thereby reducing the risk of the target version verification information being attacked.
需要说明的是,所述验证服务器利用变色龙签名算法生成变色龙签名信息的过程具体可以为:It should be noted that the process of generating the chameleon signature information by the verification server using the chameleon signature algorithm may specifically be:
首先可以通过密钥管理服务器随机选取两个大质数p和q,使得p=kq+1,并选取一个阶为q的元素
Figure PCTCN2020124157-appb-000001
然后可以通过密钥管理服务器随机选取设备标识req_ID对应的设备私钥
Figure PCTCN2020124157-appb-000002
计算设备私钥x对应的设备公钥y=g xmod p,并可以将设备私钥x发送给设备标识req_ID对应的手机,同时还可以将设备公钥的相关信息(req_ID,y,g,p)发送至所述验证服务器。
First, the key management server can randomly select two large prime numbers p and q, so that p=kq+1, and select an element of order q
Figure PCTCN2020124157-appb-000001
Then you can randomly select the device private key corresponding to the device ID req_ID through the key management server
Figure PCTCN2020124157-appb-000002
Calculate the device public key y=g x mod p corresponding to the device private key x, and send the device private key x to the mobile phone corresponding to the device identification req_ID. At the same time, it can also send the related information of the device public key (req_ID, y, g, p) Send to the verification server.
所述验证服务器在收到所述文件服务器发送的目标文件版本vers_f_req和设备标识req_ID之后,可以首先生成所述验证服务器对应的签名密钥,例如,可以生成所述验证服务器对应的签名私钥d和所述验证服务器对应的签名公钥(e,n);然后可以选择一个变色龙随机数
Figure PCTCN2020124157-appb-000003
并可以利用变色龙随机数r和密钥管理服务器发送的设备公钥的相关信息来计算目标文件版本vers_f_req的变色龙哈希值h_req_ID=g vers_f_reqg rxmod p;最后可以利用所述验证服务器对应的签 名私钥对计算得到的变色龙哈希值h_req_ID进行签名sign(h_req_ID)=(h_req_ID) dmod n,以此得到目标文件版本vers_f_req对应的变色龙签名信息(req_ID,vers_f_req,r,sign(h_req_ID),(e,n),g,p),并可以基于手机的版本校验信息获取请求将变色龙签名信息(req_ID,vers_f_req,r,sign(h_req_ID),(e,n),g,p)发送给手机。
After the verification server receives the target file version vers_f_req and the device identification req_ID sent by the file server, it may first generate a signature key corresponding to the verification server, for example, may generate a signature private key d corresponding to the verification server The signature public key (e, n) corresponding to the verification server; then a chameleon random number can be selected
Figure PCTCN2020124157-appb-000003
And can use the chameleon random number r and the related information of the device public key sent by the key management server to calculate the chameleon hash value of the target file version vers_f_req h_req_ID = g vers_f_req g rx mod p; finally, the signature corresponding to the verification server can be used The private key signs the calculated chameleon hash value h_req_ID sign(h_req_ID)=(h_req_ID) d mod n, so as to obtain the chameleon signature information corresponding to the target file version vers_f_req (req_ID, vers_f_req, r, sign(h_req_ID), ( e, n), g, p), and can send the chameleon signature information (req_ID, vers_f_req, r, sign(h_req_ID), (e, n), g, p) to the mobile phone based on the mobile phone version verification information acquisition request .
应理解,所述文件服务器利用变色龙签名算法生成变色龙签名信息的过程与所述验证服务器利用变色龙签名算法生成变色龙签名信息的过程相似,基本原理相同,为简明起见,在此不再赘述。It should be understood that the process of the file server using the chameleon signature algorithm to generate the chameleon signature information is similar to the process of the verification server using the chameleon signature algorithm to generate the chameleon signature information, and the basic principles are the same. For the sake of brevity, it will not be repeated here.
具体地,手机获取到所述待校验文件的变色龙签名信息后,可以首先利用从密钥管理服务器获取的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述待校验文件对应的当前文件版本vers_f_req’的第一变色龙哈希值h_req_ID’=g vers_f_req’g rx mod p;然后可以利用所述变色龙签名信息中的签名公钥(e,n)计算所述变色龙签名信息对应的第二变色龙哈希值H’=(sign(h_req_ID)) e mod n;最后可以根据第一变色龙哈希值h_req_ID’和第二变色龙哈希值H’来校验所述待校验文件的版本合法性。在此,当第一变色龙哈希值h_req_ID’和第二变色龙哈希值H’相同时,则可确定所述待校验文件的文件版本合法,即可以认为所述待校验文件为所述文件服务器当前所发送的合法文件;当第一变色龙哈希值h_req_ID’和第二变色龙哈希值H’不相同时,则可以确定所述待校验文件的文件版本不合法,即可以认为所述待校验文件可能为被替换或者为被重新投放的文件。 Specifically, after the mobile phone obtains the chameleon signature information of the file to be verified, it can first use the device private key obtained from the key management server and the chameleon random number in the chameleon signature information to calculate the corresponding file to be verified. The first chameleon hash value of the current file version vers_f_req'h_req_ID' = g vers_f_req' g rx mod p; then the signature public key (e, n) in the chameleon signature information can be used to calculate the corresponding chameleon signature information The second chameleon hash value H'=(sign(h_req_ID)) e mod n; finally, the version of the file to be verified can be verified according to the first chameleon hash value h_req_ID' and the second chameleon hash value H' legality. Here, when the first chameleon hash value h_req_ID' and the second chameleon hash value H'are the same, it can be determined that the file version of the file to be verified is legal, that is, the file to be verified can be considered as the The legal file currently sent by the file server; when the first chameleon hash value h_req_ID' and the second chameleon hash value H'are not the same, it can be determined that the file version of the file to be verified is illegal, that is, it can be considered that the file version of the file to be verified is illegal. The file to be verified may be a file that has been replaced or reposted.
需要说明的是,当手机得到的是所述待校验文件的文件版本不合法时,手机可以在手机的校验日志中对所述待校验文件的文件版本不合法的校验结果进行记录,以方便后续进行校验结果的查看,同时,手机还可以实时在手机的显示屏幕中进行校验结果的呈现,提醒该手机所在的用户其当前所获取的文件可能为被替换或者为被重新投放的不合法文件,告知用户当前的文件下载风险。It should be noted that when the mobile phone obtains that the file version of the file to be verified is illegal, the mobile phone can record the verification result that the file version of the file to be verified is illegal in the verification log of the mobile phone. , In order to facilitate the subsequent review of the verification results. At the same time, the mobile phone can also display the verification results on the display screen of the mobile phone in real time, reminding the user where the mobile phone is located that the file currently obtained may be replaced or renewed. The illegal files that are posted inform users of the current file download risk.
应理解,所述文件服务器和/或所述验证服务器也可以通过生成版本哈希树以及对版本哈希树的根节点进行签名来生成所述待校验文件对应的目标版本校验信息。It should be understood that the file server and/or the verification server may also generate the target version verification information corresponding to the file to be verified by generating a version hash tree and signing the root node of the version hash tree.
具体地,所述文件服务器在将所述待校验文件和所述待校验文件对应的完整性校验信息发送至手机时,还可以实时根据其所发送的待校验文件的目标文件版本以及所述文件服务器中其他所有文件的目标文件版本生成版本哈希树,并可以对所述版本哈希树的根节点进行签名来生成所述待校验文件对应的目标版本校验信息。或者所述文件服务器可以将所述版本哈希树的根节点发送至所述验证服务器,以通过所述验证服务器对所述版本哈希树的根节点进行签名来生成所述待校验文件对应的目标版本校验信息。而在接收到手机发送的版本校验信息获取请求时,所述文件服务器或所述验证服务器则可以将所述目标版本校验信息(包括版本哈希树的根节点签名信息、签名公钥以及版本哈希树中相关的子节点)发送给手机,手机则可以基于接收到的目标版本校验信息来对所述待校验文件的当前文件版本进行校验。Specifically, when the file server sends the file to be verified and the integrity verification information corresponding to the file to be verified to the mobile phone, it may also be based on the target file version of the file to be verified in real time. And the target file versions of all other files in the file server generate a version hash tree, and the root node of the version hash tree can be signed to generate target version verification information corresponding to the file to be verified. Or the file server may send the root node of the version hash tree to the verification server, so that the root node of the version hash tree is signed by the verification server to generate the corresponding file to be verified. The target version verification information. When receiving the version verification information acquisition request sent by the mobile phone, the file server or the verification server may send the target version verification information (including the root node signature information of the version hash tree, the signature public key, and The relevant child node in the version hash tree) is sent to the mobile phone, and the mobile phone can verify the current file version of the file to be verified based on the received target version verification information.
其中,手机基于版本哈希树对所述待校验文件的当前文件版本进行校验的过程与手机基于目标哈希树对所述待校验文件的完整性进行校验的过程相似,基本原理相同,为简明起见,在此不再赘述。The process of verifying the current file version of the file to be verified based on the version hash tree by the mobile phone is similar to the process of verifying the integrity of the file to be verified based on the target hash tree by the mobile phone. The basic principle is The same, for the sake of brevity, I will not repeat them here.
【实施例二】[Embodiment 2]
实施例二提供的完整性校验方法可以在如图2所示的完整性校验系统的验证服务器中实现,以对各终端设备进行完整性校验,即可以通过本实施例提供的完整性校验方法对各终端设备中的应用文件进行完整性校验,确保各终端设备中的应用文件为未被篡改、版本合法的文件。以下将 结合图2所示的完整性校验系统对本实施例提供的完整性校验方法进行详细说明。The integrity check method provided in the second embodiment can be implemented in the verification server of the integrity check system as shown in FIG. 2 to perform integrity check on each terminal device, that is, the integrity provided by this embodiment can be used The verification method performs integrity verification on the application files in each terminal device to ensure that the application files in each terminal device are files that have not been tampered with and have a legal version. The integrity verification method provided in this embodiment will be described in detail below in conjunction with the integrity verification system shown in FIG. 2.
如图6所示,本实施例提供的完整性校验方法可以包括:As shown in FIG. 6, the integrity verification method provided by this embodiment may include:
S601、获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名私钥对应的第一签名公钥;S601. Obtain integrity check information of each terminal device, where the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key, and the signature information associated with the first The first signature public key corresponding to the signature private key;
需要说明的是,所述初始哈希树可以包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点。其中,所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树,所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各终端设备的一级初始哈希树构建的哈希树。It should be noted that the initial hash tree may include a first-level initial hash tree and a second-level initial hash tree, and the initial root node is the root node of the second-level initial hash tree. Wherein, the first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device, and the second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each aggregation A hash tree constructed by the first-level initial hash tree of each terminal device corresponding to the gateway.
可选地,所述一级初始哈希树和所述二级初始哈希树均为三叉哈希树,以通过三叉哈希树减少哈希树的层次,减少签名计算量。Optionally, the first-level initial hash tree and the second-level initial hash tree are both ternary hash trees, so as to reduce the level of the hash tree through the ternary hash tree and reduce the amount of signature calculation.
以终端设备为手机为例。在需要校验各手机的完整性,所述验证服务器可以向各手机发送完整性校验请求,各手机接收到完整性校验请求后,可以获取各手机中的目标文件来构建各手机对应的一级初始哈希树。其中,各手机中的目标文件为各手机从文件服务器中获取的全部或者部分文件。在此,所述一级初始哈希树中任一父节点为该父节点所对应的所有子节点的哈希值,所述一级初始哈希树的叶子节点为目标文件的文件名f_req、文件元数据matadata_f_req及文件版本vers_f_req的哈希值,即所述一级初始哈希树的叶子节点Hash_f_req_ID=H(req_ID||f_req||matadata_f_req||vers_f_req)。Take the terminal device as a mobile phone as an example. When the integrity of each mobile phone needs to be verified, the verification server can send an integrity verification request to each mobile phone. After each mobile phone receives the integrity verification request, it can obtain the target file in each mobile phone to construct the corresponding mobile phone. The first-level initial hash tree. Among them, the target files in each mobile phone are all or part of the files obtained by each mobile phone from the file server. Here, any parent node in the first-level initial hash tree is the hash value of all child nodes corresponding to the parent node, and the leaf node of the first-level initial hash tree is the file name of the target file f_req, The hash value of the file metadata matadata_f_req and the file version vers_f_req, that is, the leaf node Hash_f_req_ID of the first-level initial hash tree = H(req_ID||f_req||matadata_f_req||vers_f_req).
需要说明的是,在构建一级初始哈希树时,手机可以首先根据第一预设排序方式对该手机对应的目标文件进行排序,然后可以根据排序后的目标文件来构建该手机对应的一级初始哈希树的各叶子节点。在此,所述第一预设排序方式可以为按照文件名f_req的首字母升序(a→z)的排序方式,或者可以为按照文件名f_req的首字母降序(z→a)的排序方式。It should be noted that when constructing the first-level initial hash tree, the mobile phone can first sort the target files corresponding to the mobile phone according to the first preset sorting method, and then construct a corresponding target file of the mobile phone according to the sorted target files. Each leaf node of the initial hash tree. Here, the first preset sorting method may be a sorting method in ascending order (a→z) according to the first letter of the file name f_req, or may be a sorting method in descending order (z→a) according to the first letter of the file name f_req.
如图6a所示,手机ID1可根据手机ID1中的目标文件(f1_req_ID1至f3_req_ID1)构建手机ID1对应的一级初始哈希树,手机ID2可以根据手机ID2中的目标文件(f1_req_ID2至f9_req_ID2)构建手机ID2对应的一级初始哈希树,手机ID3可以根据手机ID3中的目标文件(f1_req_ID3至f3_req_ID3)构建手机ID3对应的一级初始哈希树。其中,f1_req_ID1为手机ID1中根据上述第一预设排序方式排序后的第一个目标文件,f3_req_ID1为手机ID1中根据上述第一预设排序方式排序后的第三个目标文件,其他表述与此相似。As shown in Figure 6a, the mobile phone ID1 can construct the first-level initial hash tree corresponding to the mobile phone ID1 according to the target files in the mobile phone ID1 (f1_req_ID1 to f3_req_ID1), and the mobile phone ID2 can construct the mobile phone according to the target files in the mobile phone ID2 (f1_req_ID2 to f9_req_ID2) The first-level initial hash tree corresponding to ID2, the mobile phone ID3 can construct the first-level initial hash tree corresponding to the mobile phone ID3 according to the target files (f1_req_ID3 to f3_req_ID3) in the mobile phone ID3. Among them, f1_req_ID1 is the first target file sorted according to the aforementioned first preset sorting method in the mobile phone ID1, f3_req_ID1 is the third target file sorted according to the aforementioned first preset sorting method in the mobile phone ID1, and other expressions are the same as this similar.
示例的,手机得到一级初始哈希树后,可首先获取一级初始哈希树的一级初始根节点Hash_IDi,然后可利用手机对应的签名私钥对一级初始根节点进行签名sign(Hash_IDi)=(Hash_IDi) d_IDi mod n,得到一级初始根节点签名信息,并可以将包含一级初始根节点签名信息的初始完整性校验信息Info_IDi={Hash_IDi,sign(Hash_IDi),(e_IDi,n)}发送至手机所对应的聚合网关,其中,d_IDi为手机IDi对应的签名私钥,(e_IDi,n)为手机IDi对应的签名公钥。 For example, after the mobile phone obtains the first-level initial hash tree, it can first obtain the first-level initial root node Hash_IDi of the first-level initial hash tree, and then use the signature private key corresponding to the mobile phone to sign the first-level initial root node sign(Hash_IDi )=(Hash_IDi) d_IDi mod n to obtain the first-level initial root node signature information, and the initial integrity check information that contains the first-level initial root node signature information Info_IDi={Hash_IDi, sign(Hash_IDi), (e_IDi, n )} is sent to the aggregation gateway corresponding to the mobile phone, where d_IDi is the signature private key corresponding to the mobile phone IDi, and (e_IDi, n) is the signature public key corresponding to the mobile phone IDi.
例如,可以通过从密钥管理服务器中获取各手机对应的签名私钥来对各一级初始哈希树的一级初始根节点进行签名。For example, the first-level initial root node of each first-level initial hash tree can be signed by obtaining the signature private key corresponding to each mobile phone from the key management server.
应理解,聚合网关接收到其所对应的各手机发送的初始完整性校验信息Info_Dii之后,可分别利用各手机对应的签名公钥对各手机发送的初始完整性校验信息Info_IDi中的一级初始根节点签名信息sign(Hash_IDi)进行验证。当该聚合网关对应的各一级初始根节点签名信息sign(Hash_IDi)均验证通过时,该聚合网关即可以根据其接收到的各初始完整性校验信息Info_IDi中的一级初始 根节点构建该聚合网关对应的二级初始哈希树。在此,对初始完整性校验信息Info_IDi中的一级初始根节点签名信息sign(Hash_IDi)进行验证的过程与实施例一中对目标根节点的根节点签名信息进行验证的过程相似,基本原理相同,为简明起见,在此不再赘述。It should be understood that after the aggregation gateway receives the initial integrity verification information Info_Dii sent by each mobile phone to which it corresponds, it can use the signature public key corresponding to each mobile phone to perform the first level of the initial integrity verification information Info_IDi sent by each mobile phone. The initial root node signature information sign(Hash_IDi) is verified. When the first-level initial root node signature information sign(Hash_IDi) corresponding to the aggregation gateway is verified, the aggregation gateway can construct the first-level initial root node according to the received initial integrity check information Info_IDi. The secondary initial hash tree corresponding to the aggregation gateway. Here, the process of verifying the first-level initial root node signature information sign (Hash_IDi) in the initial integrity check information Info_IDi is similar to the process of verifying the root node signature information of the target root node in the first embodiment, and the basic principle is The same, for the sake of brevity, I will not repeat them here.
在构建二级初始哈希树时,聚合网关可以首先根据第二预设排序方式对该聚合网关对应的手机进行排序,然后可以根据排序后的手机对应的一级初始哈希树的一级初始根节点构建聚合网关对应的二级初始哈希树。在此,所述第二预设排序方式可以为按照手机的设备标识(如手机ID号)由小至大的排序方式,或者可以为按照手机的设备标识(如手机ID号)由大至小的排序方式。When constructing the second-level initial hash tree, the aggregation gateway may first sort the mobile phones corresponding to the aggregation gateway according to the second preset sorting method, and then according to the first-level initial hash tree of the first-level initial hash tree corresponding to the sorted mobile phones. The root node constructs the secondary initial hash tree corresponding to the aggregation gateway. Here, the second preset sorting method may be a sorting method from small to large according to the device identification of the mobile phone (such as a mobile phone ID number), or may be a sorting method according to the device identification of the mobile phone (such as a mobile phone ID number) from large to small. The sorting method.
如图6a所示,聚合网关Agg1可以根据其所对应的手机ID1、手机ID2以及手机ID3发送的一级初始哈希树的各一级初始根节点Hash_ID1、Hash_ID2和Hash_ID3构建聚合网关Agg1对应的二级初始哈希树。其中,手机ID1为根据上述第二预设排序方式排序后排序第一的手机,手机ID2为根据上述第二预设排序方式排序后排序第二的手机,手机ID3为根据上述第二预设排序方式排序后排序第三的手机。As shown in Figure 6a, the aggregation gateway Agg1 can construct the second-level initial root nodes Hash_ID1, Hash_ID2, and Hash_ID3 of the first-level initial hash tree sent by its corresponding mobile phone ID1, mobile phone ID2, and mobile phone ID3. Level initial hash tree. Among them, mobile phone ID1 is the first mobile phone sorted according to the above second preset sorting method, mobile phone ID2 is the second mobile phone sorted according to the above second preset sorting method, and mobile phone ID3 is sorted according to the above second preset sorting method The third mobile phone is ranked after sorting by way.
示例的,聚合网关得到二级初始哈希树后,可以首先获取二级初始哈希树的二级初始根节点Hash_Aggi,然后可以利用聚合网关对应的签名私钥(即S602中所述的第一签名公钥所对应的第一签名私钥)来对二级初始根节点进行签名sign(Hash_Aggi)=(Hash_Aggi) d_Aggi mod n,得到二级初始根节点签名信息,并可以将包含二级初始根节点签名信息的完整性校验信息Info_Aggi={Hash_Aggi,sign(Hash_Aggi),(e_Aggi,n)}发送至所述验证服务器。其中,d_Aggi为聚合网关Aggi对应的第一签名私钥,(e_Aggi,n)为聚合网关Aggi对应的第一签名公钥。 For example, after the aggregation gateway obtains the secondary initial hash tree, it can first obtain the secondary initial root node Hash_Aggi of the secondary initial hash tree, and then can use the signature private key corresponding to the aggregation gateway (that is, the first Sign(Hash_Aggi)=(Hash_Aggi) d_Aggi mod n to obtain the signature information of the second-level initial root node, and can include the second-level initial root node The integrity verification information Info_Aggi={Hash_Aggi, sign(Hash_Aggi), (e_Aggi, n)} of the node signature information is sent to the verification server. Among them, d_Aggi is the first signature private key corresponding to the aggregation gateway Aggi, and (e_Aggi, n) is the first signature public key corresponding to the aggregation gateway Aggi.
例如,可以通过从密钥管理服务器中获取各聚合网关对应的第一签名私钥来对各二级初始哈希树的二级初始根节点进行签名。For example, it is possible to sign the secondary initial root node of each secondary initial hash tree by obtaining the first signature private key corresponding to each aggregation gateway from the key management server.
S602、利用所述第一签名公钥对所述初始根节点签名信息进行验证;S602. Use the first signature public key to verify the initial root node signature information.
在此,所述验证服务器接收到各聚合网关发送的完整性校验信息Info_Aggi后,则可以分别利用各聚合网关对应的第一签名公钥对各聚合网关发送的完整性校验信息Info_Aggi中的二级初始根节点签名信息进行验证。Here, after the verification server receives the integrity check information Info_Aggi sent by each aggregation gateway, it can use the first signature public key corresponding to each aggregation gateway to check the integrity check information Info_Aggi sent by each aggregation gateway. The signature information of the secondary initial root node is verified.
例如,可以利用聚合网关Agg1对应的第一签名公钥A对聚合网关Agg1发送的完整性校验信息Info_Agg1中的二级初始根节点签名信息进行验证,可以利用聚合网关Agg2对应的第一签名公钥B对聚合网关Agg2发送的完整性校验信息Info_Agg2中的二级初始根节点签名信息进行验证,可以利用聚合网关Agg3对应的第一签名公钥C对聚合网关Agg1发送的完整性校验信息Info_Agg3中的二级初始根节点签名信息进行验证。For example, the first signature public key A corresponding to the aggregation gateway Agg1 can be used to verify the secondary initial root node signature information in the integrity verification information Info_Agg1 sent by the aggregation gateway Agg1, and the first signature public key corresponding to the aggregation gateway Agg2 can be used. The key B verifies the secondary initial root node signature information in the integrity verification information Info_Agg2 sent by the aggregation gateway Agg2, and the first signature public key C corresponding to the aggregation gateway Agg3 can be used to verify the integrity verification information sent by the aggregation gateway Agg1 The signature information of the secondary initial root node in Info_Agg3 is verified.
应理解,对完整性校验信息Info_Aggi中的二级初始根节点签名信息进行验证的过程与实施例一中对目标根节点的根节点签名信息进行验证的过程相似,基本原理相同,为简明起见,在此不再赘述。It should be understood that the process of verifying the secondary initial root node signature information in the integrity check information Info_Aggi is similar to the process of verifying the root node signature information of the target root node in the first embodiment, and the basic principles are the same, for the sake of brevity , I won’t repeat it here.
S603、当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;S603: When the initial root node signature information is verified, construct a target hash tree according to the initial root node;
应理解,当各二级初始根节点签名信息均验证通过时,所述验证服务器即可以根据其接收到的各完整性校验信息Info_Aggi中的二级初始根节点构建目标哈希树。其中,所述目标哈希树也可以为三叉哈希树,以通过三叉哈希树减少哈希树的层次,减少签名计算量,同时方便后续快速定位完整性遭到破坏的终端设备。It should be understood that when the signature information of each secondary initial root node is verified, the verification server can construct the target hash tree according to the secondary initial root node in each integrity verification information Info_Aggi it receives. Wherein, the target hash tree may also be a ternary hash tree, so as to reduce the level of the hash tree through the ternary hash tree, reduce the amount of signature calculation, and at the same time facilitate the subsequent rapid location of the terminal device whose integrity has been compromised.
具体地,所述验证服务器可以首先根据第三预设排序方式对聚合网关进行排序,然后可以根据排序后的聚合网关对应的二级初始哈希树的二级初始根节点构建所述目标哈希树。在此,所述 第三预设排序方式可以为按照聚合网关的网关标识(例如,网关ID号)由小至大的排序方式,或者可以为按照聚合网关的网关标识(例如,网关ID号)由大至小的排序方式。Specifically, the verification server may first sort the aggregation gateways according to a third preset sorting manner, and then may construct the target hash according to the secondary initial root node of the secondary initial hash tree corresponding to the sorted aggregation gateway. tree. Here, the third preset sorting manner may be a sorting manner from small to large according to the gateway identification of the aggregation gateway (for example, the gateway ID number), or may be according to the gateway identification of the aggregation gateway (for example, the gateway ID number) Sort from largest to smallest.
S604、获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;S604. Obtain the local root node of the local hash tree and the target root node of the target hash tree.
需要说明的是,在手机从文件服务器中获取文件之后,所述文件服务器也可实时或定期将各手机请求过的请求文件(包括文件名、文件版本和文件元数据等)发送至所述验证服务器,所述验证服务器则可以根据所述请求文件构建各手机对应的一级本地哈希树。例如,可根据手机A对应的请求文件a、b、c、d、e、f、g、h及i构建手机A对应的一级本地哈希树,可根据手机B对应的请求文件j、k及l构建手机B对应的一级本地哈希树。在此,一级本地哈希树的构建过程与前述一级初始哈希树的构建过程相似,基本原理相同,为简明起见,在此不再赘述。It should be noted that after the mobile phone obtains the file from the file server, the file server may also send the requested files (including file name, file version, file metadata, etc.) requested by each mobile phone to the verification in real time or periodically. Server, the verification server can construct a first-level local hash tree corresponding to each mobile phone according to the request file. For example, the first-level local hash tree corresponding to mobile phone A can be constructed according to the request files a, b, c, d, e, f, g, h, and i corresponding to mobile phone A, and the request files j, k corresponding to mobile phone B can be constructed. And l construct the first-level local hash tree corresponding to mobile phone B. Here, the construction process of the first-level local hash tree is similar to the construction process of the aforementioned first-level initial hash tree, and the basic principles are the same. For the sake of brevity, it will not be repeated here.
应理解,所述验证服务器构建手机对应的一级本地哈希树时,可以根据前述所述的一级初始哈希树的构建过程中所使用的第一预设排序方式对手机对应的请求文件进行排序,并可以根据排序后的请求文件构建手机对应的一级本地哈希树。It should be understood that when the verification server constructs the first-level local hash tree corresponding to the mobile phone, it can perform the request file corresponding to the mobile phone according to the first preset sorting method used in the construction of the first-level initial hash tree described above. Perform sorting, and construct a first-level local hash tree corresponding to the mobile phone according to the sorted request file.
例如,当前述所述的一级初始哈希树的构建过程中所使用的第一预设排序方式为根据文件名f_req的首字母升序(a→z)的排序方式时,所述验证服务器则可以根据文件名f_req的首字母升序(a→z)的排序方式对请求文件进行排序。For example, when the first preset sorting method used in the construction of the first-level initial hash tree described above is the sorting method in ascending order (a→z) according to the initials of the file name f_req, the verification server then The requested files can be sorted according to the sorting method of the first letter of the file name f_req in ascending order (a→z).
在此,所述验证服务器得到各手机对应的一级本地哈希树后,可以首先获取各一级本地哈希树的一级本地根节点和各手机对应的聚合网关,并可以根据聚合网关对各一级本地根节点进行分组,即可以将对应于同一聚合网关的手机对应的一级本地根节点划分至同一组;随后可以根据各聚合网关对应的一级本地根节点构建各聚合网关对应的二级本地哈希树。Here, after the verification server obtains the first-level local hash tree corresponding to each mobile phone, it can first obtain the first-level local root node of each first-level local hash tree and the aggregation gateway corresponding to each mobile phone, and can compare the aggregation gateway according to the aggregation gateway. The first-level local root nodes are grouped, that is, the first-level local root nodes corresponding to the mobile phones corresponding to the same aggregation gateway can be divided into the same group; then, the corresponding first-level local root nodes of each aggregation gateway can be constructed according to the first-level local root node corresponding to each aggregation gateway. The secondary local hash tree.
应理解,所述验证服务器构建聚合网关对应的二级本地哈希树时,可以根据前述所述的二级初始哈希树的构建过程中所使用的第二预设排序方式对聚合网关对应的各手机进行排序,并可以根据排序后的手机对应的一级本地哈希树的一级本地根节点构建聚合网关对应的二级本地哈希树。It should be understood that when the verification server constructs the second-level local hash tree corresponding to the aggregation gateway, the verification server may determine the corresponding second-level hash tree of the aggregation gateway according to the second preset ordering method used in the construction of the second-level initial hash tree. Each mobile phone is sorted, and the second-level local hash tree corresponding to the aggregation gateway can be constructed according to the first-level local root node of the first-level local hash tree corresponding to the sorted mobile phone.
例如,当前述所述的二级初始哈希树的构建过程中所使用的第二预设排序方式为按照手机ID号由小至大的排序方式时,所述验证服务器则可以根据手机ID号由小至大的顺序方式对各手机进行排序。For example, when the second preset sorting method used in the construction of the aforementioned secondary initial hash tree is sorting according to the mobile phone ID number from small to large, the verification server can then use the mobile phone ID number Sort the mobile phones in a descending order.
在此,所述验证服务器得到各聚合网关对应的二级本地哈希树后,可以获取各二级本地哈希树的二级本地根节点,并可以根据各二级本地哈希树对应的二级本地根节点构建所述本地哈希树。Here, after the verification server obtains the second-level local hash tree corresponding to each aggregation gateway, it can obtain the second-level local root node of each second-level local hash tree, and can also obtain the second-level local root node corresponding to each second-level local hash tree. The local root node constructs the local hash tree.
应理解,所述验证服务器构建所述本地哈希树时,可以根据前述所述的目标哈希树的构建过程中所使用的第三预设排序方式对各聚合网关进行排序,并可以根据排序后的聚合网关对应的二级本地哈希树的二级本地根节点构建所述本地哈希树。It should be understood that when the verification server constructs the local hash tree, the aggregation gateways may be sorted according to the third preset sorting method used in the construction of the target hash tree, and may be sorted according to the sorting method. The second-level local root node of the second-level local hash tree corresponding to the subsequent aggregation gateway constructs the local hash tree.
本实施例,在本地哈希树和目标哈希树的构建过程中,通过使用相同的预设排序方式进行各级根节点的排序,避免排序不同而带来的哈希值不同,从而影响完整性校验结果。In this embodiment, during the construction of the local hash tree and the target hash tree, the root nodes at all levels are sorted by using the same preset sorting method to avoid different hash values caused by different sorts, thereby affecting the integrity Result of sexual verification.
S605、根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。S605: Check the integrity of each terminal device according to the local root node and the target root node.
具体地,若所述本地根节点与所述目标根节点相同,所述验证服务器则可以确定所述终端设备的完整性校验通过,即所有终端设备中的应用文件均未被篡改或替换等;若所述本地根节点与所述目标根节点不相同,所述验证服务器则可以确定所述终端设备的完整性校验不通过,即存在一个或多个终端设备的完整性遭到破坏,也就是说,存在一个或多个终端设备中的应用文件被篡改或者被替换。Specifically, if the local root node is the same as the target root node, the verification server may determine that the integrity check of the terminal device passes, that is, the application files in all terminal devices have not been tampered with or replaced, etc. If the local root node is not the same as the target root node, the verification server can determine that the integrity check of the terminal device fails, that is, the integrity of one or more terminal devices is damaged, In other words, the application files stored in one or more terminal devices have been tampered with or replaced.
示例的,当得到所述终端设备的完整性校验不通过的校验结果时,所述验证服务器则可以通 过比对所述本地哈希树和所述目标哈希树来定位完整性遭到破坏的目标终端设备,即可以根据所述本地哈希树和所述目标哈希树的比对结果,来确定完整性遭到破坏的目标终端设备。For example, when the verification result that the integrity check of the terminal device fails, the verification server may compare the local hash tree with the target hash tree to locate the integrity failure. The damaged target terminal device can determine the target terminal device whose integrity has been damaged according to the comparison result of the local hash tree and the target hash tree.
本实施例通过使用哈希树及对哈希树根节点签名的方式来对终端设备进行完整性校验,使得终端设备、聚合网关均仅需要对相关哈希树的根节点进行签名,而不需要对每一个文件进行签名,极大地减少了终端设备、聚合网关的计算量,缓解了终端设备、聚合网关的计算负担。同时,通过将大多数的签名验证过程转移至聚合网关,可减少验证服务器的计算量,缓解验证服务器的计算负担。This embodiment uses a hash tree and signs the root node of the hash tree to verify the integrity of the terminal device, so that both the terminal device and the aggregation gateway only need to sign the root node of the relevant hash tree. Each file needs to be signed, which greatly reduces the calculation amount of terminal devices and aggregation gateways, and eases the calculation burden of terminal devices and aggregation gateways. At the same time, by transferring most of the signature verification process to the aggregation gateway, the calculation amount of the verification server can be reduced and the calculation burden of the verification server can be alleviated.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
对应于上文实施例所述的完整性校验方法,图7和图8示出了本申请实施例提供的完整性校验装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the integrity check method described in the above embodiment, FIG. 7 and FIG. 8 show the structural block diagram of the integrity check device provided by the embodiment of the present application. Example related parts.
如图7所示,本申请实施例提供了一种完整性校验装置,应用于终端设备,所述完整性校验装置可以包括:As shown in FIG. 7, an embodiment of the present application provides an integrity verification device, which is applied to a terminal device, and the integrity verification device may include:
文件获取模块701,用于获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为根据所述文件服务器中的所有文件构建的哈希树;The file obtaining module 701 is configured to obtain the file to be verified sent by the file server and the integrity check information of the file to be verified. The integrity check information includes the information about the target hash tree using the first signature private key. The root node signature information obtained by the signature of the target root node, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, the target has Xishu is a hash tree constructed based on all files in the file server;
签名信息校验模块702,用于利用所述第一签名公钥对所述根节点签名信息进行验证;The signature information verification module 702 is configured to use the first signature public key to verify the root node signature information;
当前根节点构建模块703,用于当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;The current root node construction module 703 is configured to construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes when the root node signature information is verified;
完整性校验模块704,用于根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。The integrity check module 704 is configured to check the integrity of the file to be checked according to the current root node and the target root node.
可选地,所述完整性校验装置还可以包括:Optionally, the integrity verification device may further include:
版本校验信息获取模块,用于获取所述待校验文件的目标版本校验信息,所述目标版本校验信息为根据所述待校验文件的目标文件版本生成的版本校验信息;A version verification information acquisition module, configured to acquire target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
版本合法性校验模块,用于根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性。The version legitimacy verification module is configured to verify the version legitimacy of the file to be verified according to the current file version of the file to be verified and the target version verification information.
在一种可能的实现方式中,所述目标版本校验信息为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息;In a possible implementation manner, the target version verification information is chameleon signature information generated according to the target file version and the device identifier of the terminal device;
相应地,所述版本合法性校验模块可以包括:Correspondingly, the version legality verification module may include:
第一哈希值计算单元,用于根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值;The first hash value calculation unit is configured to calculate the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
第二哈希值计算单元,用于利用所述变色龙签名信息中的第二签名公钥计算所述变色龙签名信息对应的第二变色龙哈希值;The second hash value calculation unit is configured to use the second signature public key in the chameleon signature information to calculate the second chameleon hash value corresponding to the chameleon signature information;
版本合法性校验单元,用于根据所述第一变色龙哈希值和所述第二变色龙哈希值校验所述待校验文件的版本合法性。The version legitimacy verification unit is configured to verify the version legitimacy of the file to be verified according to the first chameleon hash value and the second chameleon hash value.
示例的,所述完整性校验装置还可以包括:For example, the integrity verification device may further include:
设备私钥获取模块,用于根据所述设备标识获取所述终端设备对应的设备私钥。The device private key obtaining module is configured to obtain the device private key corresponding to the terminal device according to the device identifier.
可选地,所述版本校验信息获取模块,具体用于获取验证服务器发送的所述待校验文件的目 标版本校验信息,所述目标版本校验信息为所述验证服务器根据所述文件服务器发送的所述待校验文件的目标文件版本和接收所述待校验文件的终端设备的设备标识生成的版本校验信息。Optionally, the version verification information obtaining module is specifically configured to obtain the target version verification information of the file to be verified sent by the verification server, and the target version verification information is the verification server according to the file The target file version of the file to be verified sent by the server and version verification information generated by the device identifier of the terminal device that receives the file to be verified.
具体地,所述目标哈希树为三叉哈希树。Specifically, the target hash tree is a trigeminal hash tree.
如图8所示,本申请实施例提供了一种完整性校验装置,应用于验证服务器,所述完整性校验装置可以包括:As shown in FIG. 8, an embodiment of the present application provides an integrity verification device, which is applied to a verification server, and the integrity verification device may include:
完整性信息获取模块801,用于获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名私钥对应的第一签名公钥;The integrity information acquisition module 801 is configured to acquire the integrity verification information of each terminal device, the integrity verification information including the initial root node signature obtained by signing the initial root node of the initial hash tree with the first signature private key Information and the first signature public key corresponding to the first signature private key;
签名信息校验模块802,用于利用所述第一签名公钥对所述初始根节点签名信息进行验证;The signature information verification module 802 is configured to use the first signature public key to verify the initial root node signature information;
哈希树构建模块803,用于当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;A hash tree construction module 803, configured to construct a target hash tree according to the initial root node when the initial root node signature information is verified;
根节点获取模块804,用于获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;The root node obtaining module 804 is configured to obtain the local root node of the local hash tree and the target root node of the target hash tree;
完整性校验模块805,用于根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。The integrity check module 805 is configured to check the integrity of each terminal device according to the local root node and the target root node.
可选地,所述初始哈希树包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点;Optionally, the initial hash tree includes a first-level initial hash tree and a second-level initial hash tree, and the initial root node is a root node of the second-level initial hash tree;
所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树;The first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各一级初始哈希树构建的哈希树。The second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
具体地,所述聚合网关可以包括:Specifically, the aggregation gateway may include:
签名公钥获取单元,用于获取各所述终端设备发送的第二签名公钥;A signature public key acquisition unit, configured to acquire a second signature public key sent by each of the terminal devices;
签名信息校验单元,用于分别利用各所述第二签名公钥对各所述终端设备发送的一级根节点签名信息进行验证;The signature information verification unit is configured to use each of the second signature public keys to verify the first-level root node signature information sent by each of the terminal devices;
哈希树构建单元,用于当各所述一级根节点签名信息验证通过时,根据各所述一级初始哈希树的一级初始根节点构建所述二级初始哈希树。The hash tree construction unit is configured to construct the second-level initial hash tree according to the first-level initial root node of each first-level initial hash tree when the signature information of each of the first-level root nodes is verified.
在一种可能的实现方式中,所述完整性校验装置还可以包括:In a possible implementation manner, the integrity verification device may further include:
请求文件获取模块,用于获取所述文件服务器发送的请求文件,所述请求文件为各所述终端设备从所述文件服务器中请求过的文件;A request file obtaining module, configured to obtain a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
一级本地哈希树构建模块,用于根据所述请求文件构建各所述终端设备对应的一级本地哈希树,并获取各所述一级本地哈希树的一级本地根节点;A first-level local hash tree construction module, configured to construct a first-level local hash tree corresponding to each terminal device according to the request file, and obtain the first-level local root node of each first-level local hash tree;
二级本地哈希树构建模块,用于根据各所述一级本地根节点构建各所述聚合网关对应的二级本地哈希树,并获取各所述二级本地哈希树的二级本地根节点;The second-level local hash tree building module is used to construct the second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtain the second-level local hash tree of each of the second-level local hash trees. Root node
本地哈希树构建模块,用于根据各所述二级本地根节点构建所述本地哈希树。The local hash tree construction module is used to construct the local hash tree according to each of the second-level local root nodes.
可选地,所述完整性校验模块可以包括:Optionally, the integrity check module may include:
校验结果获取单元,用于若所述本地根节点与所述目标根节点相同,则得到所述终端设备的完整性校验通过的校验结果;A verification result obtaining unit, configured to obtain a verification result that the integrity verification of the terminal device passes if the local root node is the same as the target root node;
哈希树比对单元,用于若所述本地根节点与所述目标根节点不相同,则得到所述终端设备的完整性校验不通过的校验结果,并比对所述本地哈希树和所述目标哈希树;A hash tree comparison unit, configured to obtain a verification result that the integrity check of the terminal device fails if the local root node is different from the target root node, and compare the local hash Tree and the target hash tree;
目标终端设备确定单元,用于根据所述本地哈希树和所述目标哈希树的比对结果,确定完整 性校验不通过的目标终端设备。The target terminal device determining unit is configured to determine the target terminal device that fails the integrity check according to the comparison result of the local hash tree and the target hash tree.
具体地,所述本地哈希树和所述目标哈希树均为三叉哈希树。Specifically, the local hash tree and the target hash tree are both trigeminal hash trees.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section for details. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
图9为本申请一实施例提供的验证服务器的结构示意图。如图9所示,该实施例的验证服务器9包括:至少一个处理器90(图9中仅示出一个)处理器、存储器91以及存储在所述存储器91中并可在所述至少一个处理器90上运行的计算机程序92,所述处理器90执行所述计算机程序92时实现上述实施例二中任意各个完整性校验方法实施例中的步骤。FIG. 9 is a schematic structural diagram of a verification server provided by an embodiment of the application. As shown in FIG. 9, the verification server 9 of this embodiment includes: at least one processor 90 (only one is shown in FIG. 9), a processor, a memory 91, and a processor that is stored in the memory 91 and can be processed in the at least one processor. The computer program 92 running on the processor 90, when the processor 90 executes the computer program 92, implements the steps in any of the integrity verification method embodiments in the second embodiment.
所述验证服务器9可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该验证服务器可包括,但不仅限于,处理器90、存储器91。本领域技术人员可以理解,图9仅仅是验证服务器9的举例,并不构成对验证服务器9的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The verification server 9 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The verification server may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art can understand that FIG. 9 is only an example of the verification server 9 and does not constitute a limitation on the verification server 9. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
所述处理器90可以是中央处理单元(Central Processing Unit,CPU),该处理器90还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 90 may be a central processing unit (Central Processing Unit, CPU), and the processor 90 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器91在一些实施例中可以是所述验证服务器9的内部存储单元,例如验证服务器9的硬盘或内存。所述存储器91在另一些实施例中也可以是所述验证服务器9的外部存储设备,例如所述验证服务器9上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器91还可以既包括所述验证服务器9的内部存储单元也包括外部存储设备。所述存储器91用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器91还可以用于暂时地存储已经输出或者将要输出的数据。The memory 91 may be an internal storage unit of the verification server 9 in some embodiments, such as a hard disk or memory of the verification server 9. In other embodiments, the memory 91 may also be an external storage device of the verification server 9, such as a plug-in hard disk equipped on the verification server 9, a smart media card (SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc. Further, the storage 91 may also include both an internal storage unit of the verification server 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 can also be used to temporarily store data that has been output or will be output.
类似地,所述终端设备也包括至少一个处理器、存储器、以及存储在所述存储器中并可在所述至少一个处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述实施例一中任意各个完整性校验方法实施例中的步骤。在此,所述处理器、所述存储器与前述所述的处理器90、存储器91的原理相同,为简明起见,在此不再赘述。Similarly, the terminal device also includes at least one processor, a memory, and a computer program that is stored in the memory and can run on the at least one processor. The processor implements the foregoing when the computer program is executed. Steps in any of the integrity verification method embodiments in the first embodiment. Here, the principles of the processor and the memory are the same as those of the processor 90 and the memory 91 described above. For the sake of brevity, the details are not repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。The embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终 端设备执行时可实现上述方法实施例一中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the first embodiment of the method when executed by the terminal device.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在验证服务器上运行时,使得验证服务器执行时可实现上述方法实施例二中的步骤。The embodiment of the present application provides a computer program product. When the computer program product runs on a verification server, the verification server can implement the steps in the second embodiment of the above method when the verification server is executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质至少可以包括:能够将计算机程序代码携带到装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in the present application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable storage medium may at least include: any entity or device capable of carrying computer program code to the device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electric carrier signal, telecommunications signal and software distribution medium. For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, in accordance with legislation and patent practices, computer-readable storage media cannot be electrical carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备/验证服务器和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备/验证服务器实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/terminal device/verification server and method can be implemented in other ways. For example, the device/terminal device/verification server embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as Multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (27)

  1. 一种完整性校验方法,其特征在于,应用于终端设备,所述完整性校验方法包括:An integrity verification method, characterized in that it is applied to a terminal device, and the integrity verification method includes:
    获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为根据所述文件服务器中的所有文件构建的哈希树;Obtain the file to be verified sent by the file server and the integrity check information of the file to be verified, where the integrity check information includes the root obtained by signing the target root node of the target hash tree with the first signature private key Node signature information, child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, and the target hash tree is based on the file Hash tree constructed by all files in the server;
    利用所述第一签名公钥对所述根节点签名信息进行验证;Verifying the signature information of the root node by using the first signature public key;
    当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;When the root node signature information is verified, construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes;
    根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。The integrity of the file to be verified is verified according to the current root node and the target root node.
  2. 如权利要求1所述的完整性校验方法,其特征在于,在所述根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性之后,包括:5. The integrity verification method of claim 1, wherein after the verification of the integrity of the file to be verified according to the current root node and the target root node, the method comprises:
    获取所述待校验文件的目标版本校验信息,所述目标版本校验信息为根据所述待校验文件的目标文件版本生成的版本校验信息;Acquiring target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
    根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性。The validity of the version of the file to be verified is verified according to the current file version of the file to be verified and the target version verification information.
  3. 如权利要求2所述的完整性校验方法,其特征在于,所述目标版本校验信息为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息;3. The integrity verification method of claim 2, wherein the target version verification information is chameleon signature information generated according to the target file version and the device identification of the terminal device;
    所述根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性包括:The verifying the version legality of the file to be verified according to the current file version of the file to be verified and the target version verification information includes:
    根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值;Calculating the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
    利用所述变色龙签名信息中的第二签名公钥计算所述变色龙签名信息对应的第二变色龙哈希值;Calculating the second chameleon hash value corresponding to the chameleon signature information by using the second signature public key in the chameleon signature information;
    根据所述第一变色龙哈希值和所述第二变色龙哈希值校验所述待校验文件的版本合法性。Verifying the legality of the version of the file to be verified according to the hash value of the first chameleon and the hash value of the second chameleon.
  4. 如权利要求3所述的完整性校验方法,其特征在于,在所述根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值之前,包括:The integrity verification method of claim 3, wherein the first step of the current file version is calculated according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information. Before the Chameleon hash value, it includes:
    根据所述设备标识获取所述终端设备对应的设备私钥。Acquire the device private key corresponding to the terminal device according to the device identifier.
  5. 如权利要求2所述的完整性校验方法,其特征在于,所述获取所述待校验文件的目标版本校验信息包括:3. The integrity verification method of claim 2, wherein said obtaining the target version verification information of the file to be verified comprises:
    获取验证服务器发送的所述待校验文件的目标版本校验信息,所述目标版本校验信息为所述验证服务器根据所述文件服务器发送的所述待校验文件的目标文件版本和接收所述待校验文件的终端设备的设备标识生成的版本校验信息。Obtain the target version verification information of the file to be verified sent by the verification server, where the target version verification information is the target file version of the file to be verified sent by the file server and the receiving station according to the verification server The version verification information generated by the device identifier of the terminal device of the file to be verified.
  6. 如权利要求1至5中任一项所述的完整性校验方法,其特征在于,所述目标哈希树为三叉哈希树。The integrity verification method according to any one of claims 1 to 5, wherein the target hash tree is a trigeminal hash tree.
  7. 一种完整性校验方法,其特征在于,应用于验证服务器,所述完整性校验方法包括:An integrity verification method, characterized in that it is applied to a verification server, and the integrity verification method includes:
    获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名私钥对应的第一签名公钥;Obtain the integrity check information of each terminal device, the integrity check information includes the initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key, and the private signature information with the first signature. The first signature public key corresponding to the key;
    利用所述第一签名公钥对所述初始根节点签名信息进行验证;Verifying the initial root node signature information by using the first signature public key;
    当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;When the initial root node signature information is verified, construct a target hash tree according to the initial root node;
    获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;Acquiring the local root node of the local hash tree and the target root node of the target hash tree;
    根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。The integrity of each terminal device is verified according to the local root node and the target root node.
  8. 如权利要求7所述的完整性校验方法,其特征在于,所述初始哈希树包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点;The integrity verification method of claim 7, wherein the initial hash tree comprises a primary initial hash tree and a secondary initial hash tree, and the initial root node is the secondary initial hash tree. The root node of Xishu;
    所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树;The first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
    所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各一级初始哈希树构建的哈希树。The second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
  9. 如权利要求8所述的完整性校验方法,其特征在于,所述聚合网关构建所述二级初始哈希树的过程包括:8. The integrity verification method of claim 8, wherein the process of constructing the secondary initial hash tree by the aggregation gateway comprises:
    获取各所述终端设备发送的第二签名公钥;Acquiring the second signature public key sent by each of the terminal devices;
    分别利用各所述第二签名公钥对各所述终端设备发送的一级根节点签名信息进行验证;Using each of the second signature public keys to verify the signature information of the primary root node sent by each of the terminal devices;
    当各所述一级根节点签名信息验证通过时,根据各所述一级初始哈希树的一级初始根节点构建所述二级初始哈希树。When the signature information of each first-level root node is verified, the second-level initial hash tree is constructed according to the first-level initial root node of each first-level initial hash tree.
  10. 如权利要求8所述的完整性校验方法,其特征在于,在所述获取本地哈希树的本地根节点之前包括:8. The integrity verification method according to claim 8, characterized in that, before said obtaining the local root node of the local hash tree, it comprises:
    获取所述文件服务器发送的请求文件,所述请求文件为各所述终端设备从所述文件服务器中请求过的文件;Acquiring a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
    根据所述请求文件构建各所述终端设备对应的一级本地哈希树,并获取各所述一级本地哈希树的一级本地根节点;Constructing the first-level local hash tree corresponding to each of the terminal devices according to the request file, and obtaining the first-level local root node of each of the first-level local hash trees;
    根据各所述一级本地根节点构建各所述聚合网关对应的二级本地哈希树,并获取各所述二级本地哈希树的二级本地根节点;Constructing a second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtaining the second-level local root node of each of the second-level local hash trees;
    根据各所述二级本地根节点构建所述本地哈希树。The local hash tree is constructed according to each of the second-level local root nodes.
  11. 如权利要求7所述的完整性校验方法,其特征在于,所述根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性包括:8. The integrity verification method according to claim 7, wherein the verifying the integrity of each terminal device according to the local root node and the target root node comprises:
    若所述本地根节点与所述目标根节点相同,则得到所述终端设备的完整性校验通过的校验结果;If the local root node is the same as the target root node, a verification result that the integrity verification of the terminal device passes is obtained;
    若所述本地根节点与所述目标根节点不相同,则得到所述终端设备的完整性校验不通过的校验结果,并比对所述本地哈希树和所述目标哈希树;If the local root node and the target root node are not the same, obtain a verification result that the integrity check of the terminal device fails, and compare the local hash tree with the target hash tree;
    根据所述本地哈希树和所述目标哈希树的比对结果,确定完整性校验不通过的目标终端设备。According to the comparison result of the local hash tree and the target hash tree, a target terminal device that fails the integrity check is determined.
  12. 如权利要求7至11中任一项所述的完整性校验方法,其特征在于,所述本地哈希树和所述目标哈希树均为三叉哈希树。The integrity verification method according to any one of claims 7 to 11, wherein the local hash tree and the target hash tree are both trigeminal hash trees.
  13. 一种完整性校验装置,其特征在于,应用于终端设备,所述完整性校验装置包括:An integrity verification device, which is characterized in that it is applied to a terminal device, and the integrity verification device includes:
    文件获取模块,用于获取文件服务器发送的待校验文件和所述待校验文件的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对目标哈希树的目标根节点签名得到的根节点签名信息、所述目标哈希树中与所述待校验文件相关的子节点以及与所述第一签名私钥对应的第一签名公钥,所述目标哈希树为根据所述文件服务器中的所有文件构建的哈希树;The file obtaining module is used to obtain the file to be verified sent by the file server and the integrity check information of the file to be verified, and the integrity check information includes the target of the target hash tree using the first signature private key The root node signature information obtained by the root node signature, the child nodes related to the file to be verified in the target hash tree, and the first signature public key corresponding to the first signature private key, the target hash The tree is a hash tree constructed based on all files in the file server;
    签名信息校验模块,用于利用所述第一签名公钥对所述根节点签名信息进行验证;A signature information verification module, configured to use the first signature public key to verify the root node signature information;
    当前根节点构建模块,用于当所述根节点签名信息验证通过时,根据所述待校验文件和所述子节点构建所述目标哈希树对应的当前根节点;The current root node construction module is configured to construct the current root node corresponding to the target hash tree according to the file to be verified and the child nodes when the root node signature information is verified;
    完整性校验模块,用于根据所述当前根节点和所述目标根节点校验所述待校验文件的完整性。The integrity check module is used to check the integrity of the file to be checked according to the current root node and the target root node.
  14. 如权利要求13所述的完整性校验装置,其特征在于,所述完整性校验装置还包括:The integrity verification device of claim 13, wherein the integrity verification device further comprises:
    版本校验信息获取模块,用于获取所述待校验文件的目标版本校验信息,所述目标版本校验信息为根据所述待校验文件的目标文件版本生成的版本校验信息;A version verification information acquisition module, configured to acquire target version verification information of the file to be verified, where the target version verification information is version verification information generated according to the target file version of the file to be verified;
    版本合法性校验模块,用于根据所述待校验文件的当前文件版本和所述目标版本校验信息校验所述待校验文件的版本合法性。The version legitimacy verification module is configured to verify the version legitimacy of the file to be verified according to the current file version of the file to be verified and the target version verification information.
  15. 如权利要求14所述的完整性校验装置,其特征在于,所述目标版本校验信息为根据所述目标文件版本和所述终端设备的设备标识生成的变色龙签名信息;The integrity verification device of claim 14, wherein the target version verification information is chameleon signature information generated according to the target file version and the device identifier of the terminal device;
    所述版本合法性校验模块包括:The version legality check module includes:
    第一哈希值计算单元,用于根据所述终端设备对应的设备私钥和所述变色龙签名信息中的变色龙随机数计算所述当前文件版本的第一变色龙哈希值;The first hash value calculation unit is configured to calculate the first chameleon hash value of the current file version according to the device private key corresponding to the terminal device and the chameleon random number in the chameleon signature information;
    第二哈希值计算单元,用于利用所述变色龙签名信息中的第二签名公钥计算所述变色龙签名信息对应的第二变色龙哈希值;The second hash value calculation unit is configured to use the second signature public key in the chameleon signature information to calculate the second chameleon hash value corresponding to the chameleon signature information;
    版本合法性校验单元,用于根据所述第一变色龙哈希值和所述第二变色龙哈希值校验所述待校验文件的版本合法性。The version legitimacy verification unit is configured to verify the version legitimacy of the file to be verified according to the first chameleon hash value and the second chameleon hash value.
  16. 如权利要求15所述的完整性校验装置,其特征在于,所述完整性校验装置还包括:15. The integrity verification device of claim 15, wherein the integrity verification device further comprises:
    设备私钥获取模块,用于根据所述设备标识获取所述终端设备对应的设备私钥。The device private key obtaining module is configured to obtain the device private key corresponding to the terminal device according to the device identifier.
  17. 如权利要求14所述的完整性校验装置,其特征在于,所述版本校验信息获取模块,具体用于获取验证服务器发送的所述待校验文件的目标版本校验信息,所述目标版本校验信息为所述验证服务器根据所述文件服务器发送的所述待校验文件的目标文件版本和接收所述待校验文件的终端设备的设备标识生成的版本校验信息。The integrity verification device of claim 14, wherein the version verification information acquisition module is specifically configured to acquire the target version verification information of the file to be verified sent by the verification server, and the target The version verification information is version verification information generated by the verification server according to the target file version of the file to be verified sent by the file server and the device identifier of the terminal device that receives the file to be verified.
  18. 如权利要求13至17中任一项所述的完整性校验装置,其特征在于,所述目标哈希树为三叉哈希树。The integrity verification device according to any one of claims 13 to 17, wherein the target hash tree is a trigeminal hash tree.
  19. 一种完整性校验装置,其特征在于,应用于验证服务器,所述完整性校验装置包括:An integrity verification device, characterized in that it is applied to a verification server, and the integrity verification device includes:
    完整性信息获取模块,用于获取各终端设备的完整性校验信息,所述完整性校验信息包括利用第一签名私钥对初始哈希树的初始根节点签名得到的初始根节点签名信息以及与所述第一签名私钥对应的第一签名公钥;The integrity information obtaining module is used to obtain the integrity check information of each terminal device. The integrity check information includes initial root node signature information obtained by signing the initial root node of the initial hash tree with the first signature private key And a first signature public key corresponding to the first signature private key;
    签名信息校验模块,用于利用所述第一签名公钥对所述初始根节点签名信息进行验证;A signature information verification module, configured to verify the initial root node signature information by using the first signature public key;
    哈希树构建模块,用于当所述初始根节点签名信息验证通过时,根据所述初始根节点构建目标哈希树;A hash tree construction module, configured to construct a target hash tree according to the initial root node when the initial root node signature information is verified;
    根节点获取模块,用于获取本地哈希树的本地根节点和所述目标哈希树的目标根节点;A root node obtaining module, configured to obtain the local root node of the local hash tree and the target root node of the target hash tree;
    完整性校验模块,用于根据所述本地根节点和所述目标根节点校验各所述终端设备的完整性。The integrity check module is used to check the integrity of each terminal device according to the local root node and the target root node.
  20. 如权利要求19所述的完整性校验装置,其特征在于,所述初始哈希树包括一级初始哈希树和二级初始哈希树,所述初始根节点为所述二级初始哈希树的根节点;The integrity check device according to claim 19, wherein the initial hash tree comprises a first-level initial hash tree and a second-level initial hash tree, and the initial root node is the second-level initial hash tree. The root node of Xishu;
    所述一级初始哈希树为各所述终端设备根据各所述终端设备中的各目标文件构建的哈希树;The first-level initial hash tree is a hash tree constructed by each terminal device according to each target file in each terminal device;
    所述二级初始哈希树为各聚合网关根据各所述聚合网关对应的各一级初始哈希树构建的哈希树。The second-level initial hash tree is a hash tree constructed by each aggregation gateway according to each first-level initial hash tree corresponding to each aggregation gateway.
  21. 如权利要求20所述的完整性校验装置,其特征在于,所述聚合网关包括:21. The integrity verification device of claim 20, wherein the aggregation gateway comprises:
    签名公钥获取单元,用于获取各所述终端设备发送的第二签名公钥;A signature public key acquisition unit, configured to acquire a second signature public key sent by each of the terminal devices;
    签名信息校验单元,用于分别利用各所述第二签名公钥对各所述终端设备发送的一级根节点签名信息进行验证;The signature information verification unit is configured to use each of the second signature public keys to verify the first-level root node signature information sent by each of the terminal devices;
    哈希树构建单元,用于当各所述一级根节点签名信息验证通过时,根据各所述一级初始哈希树的一级初始根节点构建所述二级初始哈希树。The hash tree construction unit is configured to construct the second-level initial hash tree according to the first-level initial root node of each first-level initial hash tree when the signature information of each of the first-level root nodes is verified.
  22. 如权利要求20所述的完整性校验装置,其特征在于,所述完整性校验装置还包括:22. The integrity verification device of claim 20, wherein the integrity verification device further comprises:
    请求文件获取模块,用于获取所述文件服务器发送的请求文件,所述请求文件为各所述终端设备从所述文件服务器中请求过的文件;A request file obtaining module, configured to obtain a request file sent by the file server, where the request file is a file requested by each terminal device from the file server;
    一级本地哈希树构建模块,用于根据所述请求文件构建各所述终端设备对应的一级本地哈希树,并获取各所述一级本地哈希树的一级本地根节点;A first-level local hash tree construction module, configured to construct a first-level local hash tree corresponding to each terminal device according to the request file, and obtain the first-level local root node of each first-level local hash tree;
    二级本地哈希树构建模块,用于根据各所述一级本地根节点构建各所述聚合网关对应的二级本地哈希树,并获取各所述二级本地哈希树的二级本地根节点;The second-level local hash tree building module is used to construct the second-level local hash tree corresponding to each of the aggregation gateways according to each of the first-level local root nodes, and obtain the second-level local hash tree of each of the second-level local hash trees. Root node
    本地哈希树构建模块,用于根据各所述二级本地根节点构建所述本地哈希树。The local hash tree construction module is used to construct the local hash tree according to each of the second-level local root nodes.
  23. 如权利要求19所述的完整性校验装置,其特征在于,所述完整性校验模块包括:The integrity check device of claim 19, wherein the integrity check module comprises:
    校验结果获取单元,用于若所述本地根节点与所述目标根节点相同,则得到所述终端设备的完整性校验通过的校验结果;A verification result obtaining unit, configured to obtain a verification result that the integrity verification of the terminal device passes if the local root node is the same as the target root node;
    哈希树比对单元,用于若所述本地根节点与所述目标根节点不相同,则得到所述终端设备的完整性校验不通过的校验结果,并比对所述本地哈希树和所述目标哈希树;A hash tree comparison unit, configured to obtain a verification result that the integrity check of the terminal device fails if the local root node is different from the target root node, and compare the local hash Tree and the target hash tree;
    目标终端设备确定单元,用于根据所述本地哈希树和所述目标哈希树的比对结果,确定完整性校验不通过的目标终端设备。The target terminal device determining unit is configured to determine the target terminal device that fails the integrity check according to the comparison result of the local hash tree and the target hash tree.
  24. 如权利要求19至23中任一项所述的完整性校验装置,其特征在于,所述本地哈希树和所述目标哈希树均为三叉哈希树。The integrity verification device according to any one of claims 19 to 23, wherein the local hash tree and the target hash tree are both trigeminal hash trees.
  25. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至6任一项所述的完整性校验方法。A terminal device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program as claimed in claims 1 to 6. The integrity verification method of any one of the above.
  26. 一种验证服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求7至12任一项所述的完整性校验方法。A verification server, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program as claimed in claims 7 to 12. The integrity verification method described in any one of items.
  27. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至12任一项所述的完整性校验方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the integrity check according to any one of claims 1 to 12 is implemented method.
PCT/CN2020/124157 2019-12-13 2020-10-27 Integrity checking method and apparatus, terminal device and verification server WO2021114918A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911284197.5 2019-12-13
CN201911284197.5A CN112989430A (en) 2019-12-13 2019-12-13 Integrity verification method and device, terminal equipment and verification server

Publications (1)

Publication Number Publication Date
WO2021114918A1 true WO2021114918A1 (en) 2021-06-17

Family

ID=76329545

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124157 WO2021114918A1 (en) 2019-12-13 2020-10-27 Integrity checking method and apparatus, terminal device and verification server

Country Status (2)

Country Link
CN (1) CN112989430A (en)
WO (1) WO2021114918A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710298A (en) * 2022-06-02 2022-07-05 深圳天谷信息科技有限公司 Method, device, equipment and medium for batch signature of documents based on chameleon Hash
CN114780129A (en) * 2022-05-25 2022-07-22 歌尔股份有限公司 Differential upgrade repairing method and device, electronic equipment and readable storage medium
CN115442106A (en) * 2022-08-31 2022-12-06 长沙理工大学 Block chain supervision method, system, equipment and storage medium
CN117094037A (en) * 2023-10-16 2023-11-21 湘江实验室 Path+ORAM-based multipath cache write-back method and device and related equipment

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112016134B (en) * 2020-09-01 2023-08-18 中国银行股份有限公司 Method and device for verifying file integrity
CN114528598A (en) * 2022-02-14 2022-05-24 维沃移动通信有限公司 Method and device for determining file integrity of file system and electronic equipment
WO2024031378A1 (en) * 2022-08-09 2024-02-15 北京小米移动软件有限公司 Error source information sending method and apparatus, error source information receiving method and apparatus, device, and storage medium
CN115906780B (en) * 2023-03-14 2023-06-23 杭州天谷信息科技有限公司 Electronic document signature method, device and equipment capable of modifying format and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976322A (en) * 2010-11-11 2011-02-16 清华大学 Safety metadata management method based on integrality checking
CN102413313A (en) * 2010-09-26 2012-04-11 索尼公司 Data integrity authentication information generation method and device as well as data integrity authentication method and device
US9223789B1 (en) * 2013-03-14 2015-12-29 Amazon Technologies, Inc. Range retrievals from archived data objects according to a predefined hash tree schema
CN104881615B (en) * 2015-06-08 2017-12-15 武汉大学 A kind of efficient secret protection ciphertext connected reference operation demonstration method under cloud environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102413313A (en) * 2010-09-26 2012-04-11 索尼公司 Data integrity authentication information generation method and device as well as data integrity authentication method and device
CN101976322A (en) * 2010-11-11 2011-02-16 清华大学 Safety metadata management method based on integrality checking
US9223789B1 (en) * 2013-03-14 2015-12-29 Amazon Technologies, Inc. Range retrievals from archived data objects according to a predefined hash tree schema
CN104881615B (en) * 2015-06-08 2017-12-15 武汉大学 A kind of efficient secret protection ciphertext connected reference operation demonstration method under cloud environment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780129A (en) * 2022-05-25 2022-07-22 歌尔股份有限公司 Differential upgrade repairing method and device, electronic equipment and readable storage medium
CN114710298A (en) * 2022-06-02 2022-07-05 深圳天谷信息科技有限公司 Method, device, equipment and medium for batch signature of documents based on chameleon Hash
CN114710298B (en) * 2022-06-02 2022-09-06 深圳天谷信息科技有限公司 Chameleon hash-based document batch signing method, device, equipment and medium
CN115442106A (en) * 2022-08-31 2022-12-06 长沙理工大学 Block chain supervision method, system, equipment and storage medium
CN117094037A (en) * 2023-10-16 2023-11-21 湘江实验室 Path+ORAM-based multipath cache write-back method and device and related equipment
CN117094037B (en) * 2023-10-16 2024-01-05 湘江实验室 Path+ORAM-based multipath cache write-back method and device and related equipment

Also Published As

Publication number Publication date
CN112989430A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
WO2021114918A1 (en) Integrity checking method and apparatus, terminal device and verification server
US10379818B2 (en) Multi-tenant, tenant-specific applications
CN107786504B (en) ELF file release method, ELF file verification method, server and terminal
EP2184668B1 (en) Method, system and graphical user interface for enabling a user to access enterprise data on a portable electronic device
CN112865956B (en) Certificate updating method and device, terminal equipment and server
CN103279288B (en) Data transmission method, device and terminal unit
CN107924333B (en) Method and apparatus for update log conversion and association in multi-tenant cloud services
CN109726067B (en) Process monitoring method and client device
WO2017211205A1 (en) Method and device for updating whitelist
CN107766747A (en) Method, mobile terminal and the server of verification Application program installation kit integrality
US20210312040A1 (en) Enhancing security using anomaly detection
CN105550252A (en) File positioning method and device and electronic equipment
CN108280341B (en) Channel number adding and installation package checking method and device
CN113038434B (en) Device registration method and device, mobile terminal and storage medium
CN107992498B (en) Method and system for importing data into data warehouse
WO2021114928A1 (en) Error correction word sorting method and apparatus, terminal device and storage medium
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
CN113018868A (en) Cloud game login method, device and system
CN110377235A (en) Data processing method, device, mobile terminal and computer readable storage medium
US20160308879A1 (en) Application-Based Service Providing Method, Apparatus, and System
US11080284B2 (en) Hybrid search connector
CN109271779A (en) A kind of installation packet inspection method, terminal device and server
US10922193B2 (en) Data backup method, storage medium, and terminal
CN109845224B (en) Electronic device and method for operating an electronic device
CN109889325B (en) Verification method, verification device, electronic equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20898986

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20898986

Country of ref document: EP

Kind code of ref document: A1