Information verification method and device, electronic device and computer-readable storage medium
By using the irreversible characteristics of the hash chain at the lock end and the key end for verification, the problem of limited computing capabilities of the lock end or key end is solved, and trustworthy verification during the remote switch lock process is realized, reducing safety risks.
Patent Information
- Application Number
- CN202211634429.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-12-19
AI Technical Summary
When the computing power of the lock end or key end is limited, traditional information verification methods are difficult to implement, resulting in safety hazards during remote switching and locking.
The hash chain method is adopted. The key end uses the N-Mth hash value on the first hash chain as the hash value to be verified, and the lock end uses the N-M+1 hash value in the first hash chain as the hash value to be authenticated. It uses the irreversible characteristics of the hash operation to verify, and realizes a trusted switch lock.
Without adding computing power modules, it can effectively reduce the security risks caused by malicious attacks and ensure the trusted verification of switch locks.
Smart Images

Figure CN116055056B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing technology, and in particular to an information verification method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the advancement of technology, remote lock opening and closing has become more widely used than traditional key lock opening and closing. However, the communication protocol during remote lock opening and closing is vulnerable to attacks. Attackers can intercept the lock opening and closing commands and re-issue them, posing a security risk. Therefore, to ensure security, it is necessary to verify the lock opening and closing commands.
[0003] Traditional information verification methods often require the lock or key end to have strong computing power. However, due to internal space and economic factors, the computing power of the lock or key end is generally limited. In other words, when the computing power of the lock or key end is limited, traditional information verification methods are difficult to implement. Summary of the Invention
[0004] In view of this, the present disclosure provides an information verification method and device, an electronic device, and a computer-readable storage medium to solve the problem that traditional information verification methods are difficult to implement when the computing power of the lock end or the key end is limited.
[0005] In the first aspect, an information verification method is applied to a lock end, the method comprising: receiving a switch lock control message corresponding to an M-th switch lock instruction, the switch lock control message including a switch lock event and a first hash value to be verified, where M is a positive integer; obtaining a first authentication hash value corresponding to the M-th switch lock instruction, the first authentication hash value being the N-M+1th hash value in a first hash chain, the first hash chain being obtained by performing N hash iteration operations on a first random number, where N is a positive integer greater than or equal to 2; performing an operation on the first hash value to be verified, and verifying whether the operation result is consistent with the first authentication hash value; if the first hash value to be verified is the NMth hash value in the first hash chain, and the operation result is the N-M+1th hash value in the first hash chain, then executing the switch lock event included in the switch lock control message.
[0006] In a second aspect, an information verification method is provided, the method comprising: determining a switch lock control message corresponding to an M-th switch lock instruction, wherein the switch lock control message comprises a switch lock event and a first hash value to be verified, the first hash value to be verified is the NMth hash value on a first hash chain, the first hash chain is obtained by performing N hash iteration operations on a first random number, M is a positive integer, and N is a positive integer greater than or equal to 2; sending a switch lock control message to a lock end, so that the lock end verifies the first hash value to be verified based on a first authentication hash value corresponding to the M-th switch lock instruction, wherein the first authentication hash value is the N-M+1th hash value in the first hash chain.
[0007] According to a third aspect, an information verification device is provided, which is applied to a lock end, and the device includes: a receiving module, configured to receive a switch lock control message corresponding to the Mth switch lock instruction, the switch lock control message including a switch lock event and a first hash value to be verified, where M is a positive integer; an acquisition module, configured to obtain a first authentication hash value corresponding to the Mth switch lock instruction, the first authentication hash value is the N-M+1th hash value in the first hash chain, and the first hash chain is obtained by performing N hash iteration operations on a first random number, where N is a positive integer greater than or equal to 2; a verification module, configured to operate on the first hash value to be verified, and verify whether the operation result is consistent with the first authentication hash value; an execution module, configured to execute the switch lock event included in the switch lock control message if the first hash value to be verified is the NMth hash value in the first hash chain and the operation result is the N-M+1th hash value in the first hash chain.
[0008] In a fourth aspect, an information verification device is provided, which is applied to a key end, and the device includes: a determination module, configured to determine a switch lock control message corresponding to the Mth switch lock instruction, wherein the switch lock control message includes a switch lock event and a first hash value to be verified, and the first hash value to be verified is the NMth hash value on the first hash chain, and the first hash chain is obtained by performing N hash iteration operations on the first random number, M is a positive integer, and N is a positive integer greater than or equal to 2; a sending module, configured to send the switch lock control message to the lock end, so that the lock end verifies the first hash value to be verified based on the first authentication hash value corresponding to the Mth switch lock instruction, wherein the first authentication hash value is the N-M+1th hash value in the first hash chain.
[0009] In a fifth aspect, an electronic device is provided, comprising: a processor and a memory for storing computer-executable instructions, wherein the processor is configured to execute the computer-executable instructions to implement the method mentioned in the first aspect or the second aspect above.
[0010] In a sixth aspect, a computer-readable storage medium is provided, which stores instructions. When the instructions are executed, the method mentioned in the first or second aspect above can be implemented.
[0011] In a seventh aspect, a computer program product is provided, comprising instructions, which, when executed, can implement the method mentioned in the previous aspect or the second aspect.
[0012] The information verification method provided by the disclosed embodiments utilizes the irreversible nature of hash operations, under the premise that the key side uses the NMth hash value in the first hash chain as the first hash value to be verified corresponding to the Mth on / off lock instruction. The lock side uses the N-M+1th hash value in the first hash chain as the first authentication hash value corresponding to the Mth on / off lock instruction. This method ensures that even if an attacker intercepts the NMth hash value, they cannot infer the NM-1th hash value in the first hash chain. In other words, even if an attacker obtains the first hash value to be verified corresponding to the Mth on / off lock instruction, they cannot infer the first hash value to be verified corresponding to the M+1th on / off lock instruction. This achieves trusted on / off lock verification with limited computing power, thereby reducing the probability of security risks caused by malicious attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 Shown is a schematic diagram of the system architecture of an information verification application scenario provided by an embodiment of the present disclosure.
[0014] Figure 2 The figure shows an interactive flow diagram of an information verification method provided by an embodiment of the present disclosure.
[0015] Figure 3 Shown is a schematic diagram of the interactive flow of an information verification method provided by another embodiment of the present disclosure.
[0016] Figure 4 Shown is a schematic diagram of the interactive flow of an information verification method provided in yet another embodiment of the present disclosure.
[0017] Figure 5 Shown is a schematic structural diagram of an information verification device provided by an embodiment of the present disclosure.
[0018] Figure 6 Shown is a schematic structural diagram of an information verification device provided by another embodiment of the present disclosure.
[0019] Figure 7 Shown is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments.
[0021] The remote lock-on / off method is widely used in various industries due to its convenience and intelligence. The remote lock-on / off method means that the key end uses the communication protocol to send the lock-on / off command to the lock end, and the lock end executes the lock-on / off command. Since the communication protocol is vulnerable to attacks during the remote lock-on / off process, there is a problem that attackers can intercept the lock-on / off command and re-play it, thereby causing security risks. For example, using the mobile phone Bluetooth protocol, a mobile phone application (application, app) can send a lock-on / off command to the Bluetooth lock of a shared bicycle. If the Bluetooth protocol is attacked, the attacker can obtain the unlocking command wirelessly when unlocking the bicycle, and then replay the unlocking command to unlock the bicycle.
[0022] Therefore, to ensure security, verifying the unlocking and unlocking commands is essential. Traditional information verification methods incorporate cryptographic algorithm modules such as AES, RSA, or ECC into the key to ensure security. However, because cryptographic algorithms like RSA require sufficient computing power to perform complex operations such as modular multiplication and modular inversion of large numbers, existing locks, such as Bluetooth lock cylinders, often lack the required computing power. This means that when the computing power of the lock or key is limited, traditional information verification methods are difficult to implement.
[0023] To address the aforementioned issues, the disclosed embodiments provide an information verification method. Under the premise that the key side uses the NMth hash value in the first hash chain as the first hash value to be verified corresponding to the Mth on / off lock instruction, the lock side uses the N-M+1th hash value in the first hash chain as the first authentication hash value corresponding to the Mth on / off lock instruction. This method fully utilizes the irreversible nature of hash operations, thereby achieving the goal of preventing an attacker from inferring the NM-1th hash value in the first hash chain even if they intercept the NMth hash value. In other words, even if an attacker obtains the first hash value to be verified corresponding to the Mth on / off lock instruction, they cannot infer the first hash value to be verified corresponding to the M+1th on / off lock instruction. This achieves the goal of trusted on / off lock verification under limited computing power, thereby reducing the probability of security risks caused by malicious attacks.
[0024] The following combination Figure 1 An example is given to illustrate the system architecture of the application scenario of the information verification method.
[0025] like Figure 1 As shown, the application scenario of the information verification method provided by the embodiment of the present disclosure involves a key end 110 and a lock end 120 communicatively connected to the key end 110 .
[0026] In actual application, the key end 110 determines the lock control message corresponding to the Mth lock opening and closing instruction. The lock control message includes the lock opening and closing event and a first hash value to be verified. The first hash value to be verified is the NMth hash value in a first hash chain. The first hash chain is obtained by performing N hash iterations on a first random number, where M is a positive integer and N is a positive integer greater than or equal to 2. The key end 110 sends the lock control message corresponding to the Mth lock opening and closing instruction to the lock end 120, so that the lock end verifies the first hash value to be verified based on the first authentication hash value, where the first authentication hash value is the N-M+1th hash value in the first hash chain.
[0027] Accordingly, the lock terminal 120 receives the lock switch control message corresponding to the Mth lock switch instruction, which includes the lock switch event and the first hash value to be verified, and obtains the first authentication hash value corresponding to the Mth lock switch instruction. The first authentication hash value is the N-M+1th hash value in the first hash chain, which is obtained by performing N hash iterations on the first random number. Then, the lock terminal 120 operates on the first hash value to be verified and verifies whether the operation result is consistent with the first authentication hash value. If the first hash value to be verified is the NMth hash value in the first hash chain and the operation result is the N-M+1th hash value in the first hash chain (that is, the verification operation result is consistent with the first authentication hash value), the lock switch event included in the lock switch control message is executed.
[0028] In one example, the lock end 120 can be a Bluetooth lock set on a bicycle, and the key end can be a mobile phone, a tablet computer (Internet Portable Apple Device, IPAD), a smart phone watch, or other devices. During use, the user uses an APP or applet on the mobile phone, IPAD, or smart phone watch to use the information verification method for the key end to achieve the purpose of sending the Mth lock switch instruction. Correspondingly, the Bluetooth lock uses the information verification method for the lock end to calculate the first hash value to be verified, and when the verification calculation result is consistent with the first authentication hash value (that is, the first hash value to be verified is the NMth hash value in the first hash chain, and the first hash value to be verified is determined to be sent by a legitimate key end), the purpose of executing the lock switch event included in the lock switch control message.
[0029] In another example, the lock terminal 120 can be a car lock, and the key terminal can still be a mobile phone, iPad, smartwatch, or other device that comes with the car key. During use, the user uses the car key and utilizes the key-side information verification method to send the Mth lock opening and closing command. Correspondingly, the Bluetooth lock utilizes the lock-side information verification method to execute the lock opening and closing event included in the lock opening and closing control message if the first hash value to be verified is successfully verified.
[0030] The information verification method mentioned in the embodiment of the present disclosure can achieve the purpose of trusted verification of the switch lock without adding an additional computing power module, thereby reducing the probability of security risks caused by malicious attacks.
[0031] The following combination Figures 2 to 4 The information verification method mentioned in the embodiment of the present disclosure is introduced in detail.
[0032] Figure 2 FIG. 1 is a schematic diagram of an interactive process of an information verification method provided by an embodiment of the present disclosure. Figure 2 As shown, the key end and the lock end mentioned in the embodiment of the present disclosure.
[0033] For the key side, the information verification method provided by the embodiment of the present disclosure includes the following steps.
[0034] Step S210: determining the lock switch control message corresponding to the Mth lock switch instruction.
[0035] The lock / unlock control message includes a lock / unlock event and a first hash value to be verified, where the first hash value to be verified is the NMth hash value in a first hash chain. For example, the first hash chain is obtained by performing N hash iterations on the first random number, where M is a positive integer and N is a positive integer greater than or equal to 2.
[0036] For example, the on / off lock command includes lock-side identity authentication information, such as the Bluetooth lock's identity ID (Identity Document, ID), an on / off lock control message, and the time the on / off lock control command was generated. The on / off lock control message corresponding to the Mth on / off lock command mentioned above refers to the on / off lock control message included in the Mth on / off lock command.
[0037] For the convenience of description, the first to-be-verified hash value included in the lock switch control message corresponding to the M-th lock switch instruction may also be referred to as the first to-be-verified hash value corresponding to the M-th lock switch instruction.
[0038] In one example, a specific implementation method for determining the first to-be-verified hash value corresponding to the Mth on / off lock instruction is to perform N iterative hash operations on a first random number to obtain a first hash chain, store the first hash chain, and select the NMth hash value in the first hash chain as the first to-be-verified hash value in the on / off lock control message corresponding to the Mth on / off lock instruction. The hash function used in the iterative hash operations can be SHA256 or BLAKE2.
[0039] In another example, a specific implementation method for determining the first hash value to be verified corresponding to the Mth switch lock instruction is to perform NM hash iteration operations on the first random number and use the obtained hash value as the first hash value to be verified corresponding to the Mth switch lock instruction.
[0040] Step S220: Send a lock opening and closing control message corresponding to the Mth lock opening and closing instruction to the lock terminal.
[0041] The purpose of sending the switch lock control message corresponding to the Mth switch lock instruction to the lock end mentioned above is to enable the lock end to verify the first hash value to be verified based on the first authentication hash value corresponding to the Mth switch lock instruction, and execute the switch lock event included in the switch lock control message if the first hash value to be verified is successfully verified.
[0042] For the lock terminal, the information verification method provided by the embodiment of the present disclosure includes the following steps.
[0043] Step S230: receiving a lock switch control message corresponding to the Mth lock switch instruction.
[0044] The lock switch control message includes a lock switch event and a first hash value to be verified.
[0045] Considering that the lock control message corresponding to the Mth lock opening and closing instruction has a certain probability of being intercepted by an attacker, the lock control message corresponding to the Mth lock opening and closing instruction received by the lock end may be sent by the key end, or it may be a lock control message that was intercepted and replaced by the middleman. For example, the lock control message corresponding to the M-1th lock opening and closing instruction was intercepted by the middleman and re-delivered during the Mth lock opening and closing instruction. Therefore, it is necessary to verify the first to-be-verified hash value included in the lock control message corresponding to the Mth lock opening and closing instruction.
[0046] Step S240: Obtain a first authentication hash value corresponding to the Mth lock opening and closing instruction.
[0047] The first authentication hash value is the N-M+1th hash value in the first hash chain.
[0048] In one example, if M is equal to 1, obtaining the first authentication hash value corresponding to the first lock switch instruction can be executed as follows: before the lock end receives the first lock switch instruction, receiving the Nth hash value in the first hash chain sent by the key end, and using the Nth hash value as the first authentication hash value corresponding to the first lock switch instruction.
[0049] In another example, if M is greater than 1 and less than or equal to N, obtaining the first authentication hash value corresponding to the Mth switch lock instruction can be executed as follows: when the first hash value to be verified corresponding to the M-1th switch lock instruction is successfully verified, deleting the first authentication hash value corresponding to the M-1th switch lock instruction stored on the lock end; and storing the first hash value to be verified corresponding to the M-1th switch lock instruction as the first authentication hash value corresponding to the Mth switch lock instruction.
[0050] That is to say, when the first hash value to be verified is successfully verified, the lock end will delete the first authentication hash value corresponding to the Mth switch lock instruction stored in the lock end, and store the first hash value to be verified corresponding to the Mth switch lock instruction as the first authentication hash value corresponding to the M+1th switch lock instruction, so as to verify the first hash value to be verified corresponding to the M+1th switch lock instruction.
[0051] Step S250: Calculate the first hash value to be verified and verify whether the calculation result is consistent with the first authentication hash value.
[0052] Exemplarily, performing an operation on the first hash value to be verified and verifying whether the operation result is consistent with the first authentication hash value can be performed as follows: obtaining a hash function corresponding to the first hash chain; using the hash function to perform a hash operation on the first hash value to be verified to obtain an operation result corresponding to the first hash value to be verified; if the operation result corresponding to the first hash value to be verified is equal to the first authentication hash value, then determining that the verification operation result is consistent with the first authentication hash value (that is, the first hash value to be verified passes verification). If the operation result corresponding to the first hash value to be verified is not equal to the first hash value to be verified, then determining that the verification operation result is inconsistent with the first authentication hash value (that is, the first hash value to be verified does not pass verification).
[0053] Since hash operations are irreversible, only the N-M+1th hash value in the first hash chain can be inferred from the NMth hash value in the first hash chain, but the NM-1th hash value in the first hash chain cannot be inferred from the NMth hash value in the first hash chain (that is, the first to-be-verified hash value corresponding to the M+1th on / off lock instruction cannot be inferred based on the first to-be-verified hash value corresponding to the Mth on / off lock instruction). Therefore, even if a middleman intercepts the on / off lock control message before the Mth on / off lock instruction, it will not pass the verification if it is re-posted.
[0054] For example, if an attacker intercepts the first hash value to be verified corresponding to the M-1th on / off lock instruction, and then intercepts the N-M+1th hash value, due to the irreversible nature of the hash algorithm, the attacker cannot infer the NMth hash value and can only re-insert the N-M+1th hash value. In other words, the hash value re-inserted by the attacker for the Mth time is still the N-M+1th hash value. For the lock end, the first hash value to be verified is received as the N-M+1th hash value, and the N-M+1th hash value is hashed again to obtain the N-M+2th hash value. However, the first authentication hash value corresponding to the Mth on / off lock instruction is the N-M+1th hash value, and the N-M+2th hash value is not equal to the N-M+1th hash value. Therefore, even if the attacker intercepts and re-inserts it, it will still fail the verification.
[0055] Step S260: If the first hash value to be verified is the NMth hash value in the first hash chain, and the operation result is the N-M+1th hash value in the first hash chain, the switch lock event included in the switch lock control message is executed.
[0056] If the first hash value to be verified is the NMth hash value in the first hash chain, a hash operation is performed on it again, and the operation result should be equal to the N-M+1th hash value in the first hash chain. The operation result is consistent with the first hash value to be verified, which means that the first hash value to be verified has passed the verification and is sent by a legitimate key end.
[0057] The aforementioned lock / unlock event is used to indicate whether the lock is unlocked or locked. If the first hash value to be verified is the NMth hash value in the first hash chain, and the result of the hash operation on the NMth hash value is the N-M+1th hash value in the first hash chain, indicating that the result of the operation is consistent with the first authentication hash value, that is, the first hash value to be verified is successfully verified, and it also indicates that this is the Mth lock / unlock instruction sent by the legitimate key end, then the lock end can perform the specific unlocking or locking operation.
[0058] Combined with the above description, it can be seen that the above-mentioned lock end and key end only need to perform simple hash operations, and do not need to perform complex cryptographic operations such as large number modular multiplication and modular inverse operations. Therefore, there is no need to add additional computing power modules to the lock end and key end. In other words, even if the computing power of the lock end or the key end is limited, the above-mentioned information verification method can be implemented.
[0059] The information verification method provided by the embodiment of the present disclosure fully utilizes the irreversible property of hash operation, under the premise that the NMth hash value on the first hash chain is used as the first hash value to be verified corresponding to the Mth switch lock instruction on the key side, and the N-M+1th hash value in the first hash chain is used as the first authentication hash value corresponding to the Mth switch lock instruction on the lock side. Thus, even if an attacker intercepts the NMth hash value, the attacker cannot infer the NM-1th hash value in the first hash chain. In other words, even if an attacker obtains the first hash value to be verified corresponding to the Mth switch lock instruction, the attacker cannot infer the first hash value to be verified corresponding to the M+1th switch lock instruction. Thus, the purpose of trusted switch lock verification is achieved under the condition of limited computing power, and the probability of security risks caused by malicious attacks is reduced.
[0060] Figure 3 The following is a schematic diagram of the interactive process of the information verification method provided by another embodiment of the present disclosure. Figure 3 The embodiment shown and Figure 2 The differences and similarities between the illustrated embodiments are not described in detail.
[0061] like Figure 3 As shown, for the lock end, in the embodiment of the present disclosure, after executing the switch lock event step included in the switch lock control message, the following steps are also included.
[0062] Step S310: Determine the verification success feedback message corresponding to the Mth lock opening and closing instruction.
[0063] The verification success feedback message includes a second hash value to be verified, where the second hash value to be verified is the NMth hash value in the second hash chain.
[0064] Exemplarily, the second Hash chain is obtained by performing N hash iteration operations on the second random number.
[0065] The verification success feedback message is used to indicate that the first lock switch verification message in the lock switch control message corresponding to the M lock switch instructions has been successfully verified. The verification success feedback message includes the lock switch successful execution time, the message that the lock switch event was successfully executed, and the second hash value to be verified.
[0066] For the sake of convenience, the second to-be-verified hash value included in the verification success feedback message corresponding to the Mth on / off lock instruction mentioned above may also be referred to as the second to-be-verified hash value corresponding to the Mth on / off lock instruction.
[0067] In one example, a specific implementation method for determining the second hash value to be verified corresponding to the Mth switch lock instruction is to perform N hash iteration operations on the second random number to obtain a second hash chain, store the second hash chain, and select the NMth hash value on the second hash chain as the second hash value to be verified in the verification success feedback message corresponding to the Mth switch lock instruction.
[0068] In another example, the specific implementation method for determining the second hash value to be verified corresponding to the Mth switch lock instruction is to perform NM hash iteration operations on the second random number, and use the obtained hash value as the second hash value to be verified in the verification success feedback message corresponding to the Mth switch lock instruction.
[0069] Step S320: Send a verification success feedback message to the key terminal.
[0070] The purpose of sending a verification success feedback message to the key end is to enable the key end to verify the second hash value to be verified based on the second authentication hash value, and if the second hash value to be verified is successfully verified, the message that the switch lock event included in the switch lock control message is successfully executed is uploaded to the chain.
[0071] The second authentication hash value mentioned above is the N-M+1th hash value in the second hash chain. Uploading the information to the blockchain refers to storing the successful execution of the lock-on / off event on the blockchain connected to the lock. Because blockchains are difficult to tamper with, storing the successful execution of the lock-on / off event on the blockchain facilitates subsequent tracing.
[0072] For the key side, the information verification method provided by the embodiment of the present disclosure also includes the following steps.
[0073] Step S330: Receive a verification success feedback message corresponding to the Mth lock opening and closing instruction.
[0074] The verification success feedback message includes the second hash value to be verified.
[0075] Considering that the verification success feedback message corresponding to the Mth on / off lock command may have been intercepted and re-delivered to deceive the user into completing the on / off lock event, for example, the lock terminal may receive a fake message from an attacker indicating that the lock terminal has completed the lock event, but the lock terminal does not close, thus causing financial loss to the user. Therefore, it is necessary to verify the second to-be-verified hash value corresponding to the Mth on / off lock command.
[0076] Step S340: Obtain a second authentication hash value corresponding to the Mth lock opening and closing instruction.
[0077] The second authentication hash value is the N-M+1th hash value in the second hash chain.
[0078] Exemplarily, the second Hash chain is obtained by performing N iterative Hash operations on the second random number.
[0079] In one example, if M is equal to 1, obtaining the second authentication hash value corresponding to the first lock switch instruction can be executed as follows: before the key end receives the first lock switch instruction, receiving the Nth hash value in the second hash chain sent by the lock end, and using the Nth hash value as the second authentication hash value corresponding to the first lock switch instruction.
[0080] In another example, if M is greater than 1 and less than or equal to N, obtaining the first authentication hash value corresponding to the Mth switch lock instruction can be executed as follows: when the second hash value to be verified corresponding to the M-1th switch lock instruction is successfully verified, deleting the second authentication hash value corresponding to the M-1th switch lock instruction stored on the lock end; and storing the second hash value to be verified corresponding to the M-1th switch lock instruction as the second authentication hash value corresponding to the Mth switch lock instruction.
[0081] That is to say, when the second hash value to be verified is successfully verified, the key end deletes the second authentication hash value corresponding to the Mth switch lock instruction stored in the key end; and the second hash value to be verified corresponding to the Mth switch lock instruction is stored as the second authentication hash value corresponding to the M+1th switch lock instruction.
[0082] Step S350: Calculate the second hash value to be verified and verify whether the calculation result is consistent with the second authentication hash value.
[0083] Exemplarily, performing an operation on the second hash value to be verified and verifying whether the operation result is consistent with the second authentication hash value can be performed as follows: obtaining a hash function corresponding to the second hash chain; performing a hash operation on the second hash value to be verified using the hash function to obtain an operation result corresponding to the second hash value to be verified; if the operation result corresponding to the second hash value to be verified is equal to the second authentication hash value, then determining that the operation result is consistent with the second authentication hash value (i.e., the second hash value to be verified passes verification). If the operation result corresponding to the second hash value to be verified is not equal to the second authentication hash value, then determining that the operation result is inconsistent with the second authentication hash value (i.e., the second hash value to be verified does not pass verification).
[0084] The principle is the same as that of step S250 mentioned above. Since the hash operation is irreversible, the attacker cannot infer the second hash value to be verified corresponding to the M+1th switch lock instruction based on the second hash value to be verified corresponding to the Mth switch lock instruction. Therefore, even if the attacker intercepts and re-posts it, it cannot pass the verification.
[0085] Step S360: If the second hash value to be verified is the NMth hash value in the second hash chain and the operation result is the N-M+1th hash value in the second hash chain, the message indicating that the switch lock event included in the switch lock control message is successfully executed is uploaded to the chain.
[0086] If the second hash value to be verified is the NMth hash value in the second hash chain, a hash operation is performed on it again, and the operation result should be the N-M+1th hash value in the second hash chain. The operation result is consistent with the second hash value to be verified, which means that the second hash value to be verified has passed the verification and is sent by a legitimate key end.
[0087] The information verification method provided by the embodiment of the present disclosure uses the second authentication hash value corresponding to the Mth switch lock instruction to verify the second to-be-verified hash value in the verification success feedback message corresponding to the Mth switch lock instruction after the lock end executes the switch lock event included in the switch lock control message, so as to achieve the purpose of dual authentication of the lock end and the key end, thereby further improving the security of information authentication.
[0088] The following takes a Bluetooth lock and a mobile phone with Bluetooth communication function and a digital key APP as an example. Figure 4 Further examples are given.
[0089] In this embodiment, the working phases of the mobile phone and the Bluetooth lock are divided into an initialization phase and an actual use phase.
[0090] like Figure 4 As shown, in the initialization stage, for a mobile phone, the embodiment of the present disclosure involves the following steps.
[0091] Step S410: After the mobile phone and the Bluetooth lock establish Bluetooth communication, the hash function H is used to perform N hash iterations on the first random number X to obtain a first hash chain X1 = H(X), X2 = H(X1), X3 = H(X2), ..., X N =H(X N-1 ).
[0092] Step S420: X N =H(X N-1 ) is sent to the Bluetooth lock as the first authentication hash value corresponding to the first lock switch instruction.
[0093] The above step S420 can be called a step for initializing the digital key APP in the mobile phone.
[0094] Similarly, in the initialization phase, for the Bluetooth lock, the embodiment of the present disclosure involves the following steps.
[0095] Step S430: After the mobile phone and the Bluetooth lock establish Bluetooth communication, the hash function H is used to perform N hash iterations on the second random number Y to obtain a second hash chain Y1=H(Y), Y2=H(Y1), Y3=H(Y2), ..., Y N =H(Y N-1 ).
[0096] Step S440: Y N =H(Y N-1 ) is sent to the Bluetooth lock as the second authentication hash value corresponding to the first switch lock instruction.
[0097] In the actual use stage, for a mobile phone, the embodiment of the present disclosure involves the following steps.
[0098] Step S450: Send the first switch lock instruction Msg = (Bluetooth lock ID, time, first hash value to be verified X) to the Bluetooth lock. N-1 and unlock events).
[0099] The switch lock control message corresponding to the first switch lock instruction includes the first hash value X to be verified. N-1 and unlocking events.
[0100] In the actual use stage, for the Bluetooth lock, the embodiment of the present disclosure involves the following steps.
[0101] Step S460, receiving the first switch lock instruction Msg's = (Bluetooth lock ID, time, first hash value to be verified X N-1s and unlock events).
[0102] Step S470: Use the hash function H to calculate X N-1s Perform hash operation and get H(X N-1s ), compare H(X N-1s ) and the first authentication hash value X corresponding to the first switch lock instruction N =H(X N-1 ).
[0103] Step S480, in H(X N-1s ) and X N =H(X N-1 ) are equal, execute the unlocking event in the switch lock control message.
[0104] That is, H(X N-1s ) and X N =H(X N-1 ) are not equal, it is considered an illegal switch lock instruction, and the Bluetooth lock will not operate or issue an alarm message.
[0105] Step S490, delete X N , XN-1 The first authentication hash value corresponding to the second lock switch instruction is stored.
[0106] Step S4100: After executing the unlock event in the lock switch control message, determine the verification success feedback message Rmsg corresponding to the first lock switch instruction = (Bluetooth lock ID, time, second hash value Y to be verified) N-1 and the unlock event is successfully executed).
[0107] In the actual use stage, for a mobile phone, the embodiment of the present disclosure involves the following steps.
[0108] Step S4110: Receive the verification success feedback message Rmsg's corresponding to the first switch lock instruction = (Bluetooth lock ID, time, second hash value to be verified Y N-1s and the unlock event is successfully executed).
[0109] Step S4120: Use the hash function H to calculate Y N-1s Perform hash operation and get H(Y N-1s ), compare H(Y N-1s ) and the second authentication hash value Y corresponding to the first switch lock instruction N- =H(Y N-1 ).
[0110] Step S4130, in H(Y N-1s ) and Y N =H(Y N-1 ) are equal, the message that the unlocking event is successfully executed will be uploaded to the chain.
[0111] That is, H(Y N-1s ) and Y N =H(YX N-1 ) are not equal, it is considered to be an illegal verification success feedback message, and the key end displays an alarm message.
[0112] The subsequent M-th switch lock instruction replaces 1 in the above steps S450-S4130 with M, that is, it is similar to S450-S4130 and will not be repeated here.
[0113] In the disclosed embodiment, the Bluetooth lock and the mobile phone only need to perform simple hash operations, without the need for complex cryptographic operations such as large number modular multiplication and modular inverse operations. Therefore, there is no need to add additional computing power modules. In other words, even when computing power is limited, dual switch lock authentication can be achieved, thereby achieving the purpose of ensuring reliable authentication of the switch lock.
[0114] Combined with the above Figures 2 to 4 , describes the method embodiment of the present disclosure in detail, and the following is combined with Figure 5 and Figure 6, describes the device embodiment of the present disclosure in detail. In addition, it should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so that parts not described in detail can refer to the previous method embodiment.
[0115] Figure 5 The figure shows a schematic diagram of the structure of an information verification device provided by an embodiment of the present disclosure. The information verification device is applied to a lock end, such as Figure 5 As shown, the information verification device 500 provided in an embodiment of the present disclosure includes a receiving module 510, an acquisition module 520, a verification module 530, and an execution module 540. In the embodiment of the present disclosure, the receiving module 510 is configured to receive a lock switch control message corresponding to the Mth lock switch instruction. The lock switch control message includes a lock switch event and a first hash value to be verified, where M is a positive integer. The acquisition module 520 is configured to obtain a first authentication hash value corresponding to the Mth lock switch instruction. The first authentication hash value is the N-M+1th hash value in a first hash chain. The first hash chain is obtained by performing N hash iterations on a first random number, where N is a positive integer greater than or equal to 2. The verification module 530 is configured to perform an operation on the first hash value to be verified and verify whether the operation result is consistent with the first authentication hash value. The execution module 540 is configured to execute the lock switch event included in the lock switch control message if the first hash value to be verified is the NMth hash value in the first hash chain and the operation result is the N-M+1th hash value in the first hash chain.
[0116] In some embodiments, the information verification device 500 mentioned in the embodiments of the present disclosure further includes a determination module and a sending module. Specifically, the determination module is configured to determine a verification success feedback message corresponding to the Mth switch lock instruction, wherein the verification success feedback message includes a second hash value to be verified, and the second hash value to be verified is the NMth hash value in the second hash chain, and the second hash chain is obtained by performing N hash iterations on the second random number. The sending module is configured to send a verification success feedback message to the key end, so that the key end verifies the second hash value to be verified based on the second authentication hash value, wherein the second authentication hash value is the N-M+1th hash value in the second hash chain.
[0117] In some embodiments, the determination module is further configured to obtain a second random number; perform N hash iteration operations on the second random number to obtain a second hash chain; and the sending module is further configured to send the Nth hash value in the second hash chain to the key end, so that the key end stores the Nth hash value as the second authentication hash value corresponding to the first lock switch instruction.
[0118] In some embodiments, the acquisition module 520 is further configured to delete the first authentication hash value corresponding to the Mth switch lock instruction stored on the lock end; and store the first to-be-verified hash value corresponding to the Mth switch lock instruction as the first authentication hash value corresponding to the M+1th switch lock instruction.
[0119] In some embodiments, the acquisition module 520 is further configured to receive the Nth hash value in the first hash chain sent by the key end; and use the Nth hash value as the first authentication hash value corresponding to the first lock opening and closing instruction.
[0120] In some embodiments, the verification module 530 is configured to obtain a hash function corresponding to the first hash chain; use the hash function to perform a hash operation on the first hash value to be verified to obtain an operation result corresponding to the first hash value to be verified; if the operation result corresponding to the first hash value to be verified is equal to the first authentication hash value, then it is determined that the operation result is consistent with the first authentication hash value; if the operation result corresponding to the first hash value to be verified is not equal to the first authentication hash value, then it is determined that the operation result is inconsistent with the first authentication hash value.
[0121] Figure 6 The figure shows a schematic diagram of the structure of an information verification device provided by another embodiment of the present disclosure. The information verification device is applied to the key end. Figure 6 As shown, the information verification device 600 provided by the embodiment of the present disclosure includes a determination module 610 and a sending module 620.
[0122] In an embodiment of the present disclosure, a determination module 610 is configured to determine a lock switch control message corresponding to the Mth lock switch instruction, wherein the lock switch control message includes a lock switch event and a first hash value to be verified, where the first hash value to be verified is the NMth hash value in a first hash chain, where the first hash chain is obtained by performing N iterative hash operations on a first random number, where M is a positive integer and N is a positive integer greater than or equal to 2. A sending module 620 is configured to send the lock switch control message to the lock terminal, so that the lock terminal verifies the first hash value to be verified based on a first authentication hash value corresponding to the Mth lock switch instruction, where the first authentication hash value is the N-M+1th hash value in the first hash chain.
[0123] In some embodiments, the information verification device 600 mentioned in the embodiment of the present disclosure further includes a receiving module, an acquisition module, a verification module, and an execution module. In the embodiment of the present disclosure, the receiving module is configured to receive a verification success feedback message corresponding to the Mth switch lock instruction, and the verification success feedback message includes a second hash value to be verified, where M is a positive integer. The acquisition module is configured to obtain a second authentication hash value corresponding to the Mth switch lock instruction, where the second authentication hash value is the N-M+1th hash value in the second hash chain, and the second hash chain is obtained by performing N hash iteration operations on the second random number. The verification module is configured to operate on the second hash value to be verified and verify whether the operation result is consistent with the second authentication hash value. The execution module is configured to, if the second hash value to be verified is the NMth hash value in the second hash chain and the operation result is the N-M+1th hash value in the second hash chain, then the message that the switch lock event included in the switch lock control message is successfully executed is chained.
[0124] In some embodiments, the determination module 610 is further configured to obtain a first random number; perform N hash iteration operations on the first random number to obtain a first hash chain; and the sending module 620 is further configured to send the Nth hash value in the first hash chain to the lock end, so that the lock end stores the Nth hash value as the first authentication hash value corresponding to the first lock switch instruction.
[0125] In some embodiments, the acquisition module is further configured to delete the second authentication hash value corresponding to the Mth switch lock instruction stored on the key end; and store the second to-be-verified hash value corresponding to the Mth switch lock instruction as the second authentication hash value corresponding to the M+1th switch lock instruction.
[0126] In some embodiments, the acquisition module is further configured to receive the Nth hash value in the second hash chain sent by the lock end; and use the Nth hash value as the second authentication hash value corresponding to the first lock switch instruction.
[0127] In some embodiments, the verification module is further configured to obtain a hash function corresponding to the second hash chain; use the hash function to perform a hash operation on the second hash value to be verified to obtain an operation result corresponding to the second hash value to be verified; if the operation result corresponding to the second hash value to be verified is equal to the second authentication hash value, then it is determined that the operation result is consistent with the second authentication hash value; if the operation result corresponding to the second hash value to be verified is not equal to the second authentication hash value, then it is determined that the operation result is inconsistent with the second authentication hash value.
[0128] Figure 7 Shown is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. Figure 7The electronic device 700 shown (which may be a computer device) includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, the processor 702, and the communication interface 703 are connected to each other via the bus 704.
[0129] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 701 may store programs. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to perform the various steps of the information verification method of the embodiment of the present disclosure.
[0130] The processor 702 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functions required to be performed by the units in the information verification device of the embodiment of the present disclosure.
[0131] The processor 702 may also be an integrated circuit chip with signal processing capabilities. During implementation, the various steps of the information verification method disclosed herein may be performed by hardware integrated logic circuits or software instructions in the processor 702. The aforementioned processor 702 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present disclosure may be directly implemented as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or the like. The storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701 and combines its hardware to complete the functions required to be performed by the units included in the information verification device of the embodiment of the present disclosure, or executes the information verification method of the method embodiment of the present disclosure.
[0132] The communication interface 703 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the electronic device 700 and other devices or a communication network.
[0133] The bus 704 may include a path for transmitting information between various components of the electronic device 700 (eg, the memory 701 , the processor 702 , and the communication interface 703 ).
[0134] It should be noted that although Figure 7 The electronic device 700 shown only shows a memory, a processor, and a communication interface. However, in the specific implementation process, those skilled in the art should understand that the electronic device 700 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the electronic device 700 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the electronic device 700 may also include only the devices necessary to implement the embodiments of the present disclosure, and does not necessarily include Figure 7 All devices shown in .
[0135] In addition to the above-mentioned methods, apparatuses and devices, embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the various steps of the information verification method provided by various embodiments of the present disclosure.
[0136] The computer program product may be written in any combination of one or more programming languages to implement the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0137] In addition, the embodiments of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor is caused to perform the various steps of information verification provided by various embodiments of the present disclosure.
[0138] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0139] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0140] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0141] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0142] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0143] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a similar region segmentation unit, each unit may exist physically separately, or two or more units may be integrated into one unit.
[0144] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0145] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. An information verification method, applied to a lock terminal, comprising: Receive a lock switch control message corresponding to the Mth lock switch instruction, wherein the lock switch control message includes a lock switch event and a first hash value to be verified, where M is a positive integer; Obtaining a first authentication hash value corresponding to the Mth on / off lock instruction, where the first authentication hash value is the N-M+1th hash value in a first hash chain, where the first hash chain is obtained by performing N iterative hash operations on the first random number, where N is a positive integer greater than or equal to 2; Performing an operation on the first to-be-verified hash value to verify whether the operation result is consistent with the first authentication hash value; If the first hash value to be verified is the NMth hash value in the first hash chain, and the operation result is the N-M+1th hash value in the first hash chain, executing the switch lock event included in the switch lock control message; Determining a verification success feedback message corresponding to the Mth on / off lock instruction, where the verification success feedback message includes a second hash value to be verified, where the second hash value to be verified is the NMth hash value in a second hash chain, where the second hash chain is obtained by performing N hash iterations on the second random number; The verification success feedback message is sent to the key end so that the key end verifies the second hash value to be verified based on the second authentication hash value corresponding to the Mth lock opening and closing instruction, wherein the second authentication hash value is the N-M+1th hash value in the second hash chain.
2. The method according to claim 1, further comprising: Obtaining the second random number; Performing N hash iterations on the second random number to obtain the second hash chain; The Nth hash value in the second hash chain is sent to the key end, so that the key end stores the Nth hash value as the second authentication hash value corresponding to the first lock opening and closing instruction.
3. The method according to claim 1 or 2, further comprising: Deleting the first authentication hash value corresponding to the M-th lock opening and closing instruction stored in the lock end; The first to-be-verified hash value corresponding to the M-th lock-on / off instruction is stored as the first authentication hash value corresponding to the M+1-th lock-on / off instruction.
4. The method according to claim 1 or 2, wherein the step of operating the first hash value to be verified and verifying whether the operation result is consistent with the first authentication hash value comprises: Obtaining a hash function corresponding to the first hash chain; Performing a hash operation on the first hash value to be verified using the hash function to obtain a calculation result corresponding to the first hash value to be verified; If the operation result corresponding to the first to-be-verified hash value is equal to the first authentication hash value, determining that the operation result is consistent with the first authentication hash value; If the operation result corresponding to the first to-be-verified hash value is not equal to the first authentication hash value, it is determined that the operation result is inconsistent with the first authentication hash value.
5. The method according to claim 1 or 2, further comprising: Receive the Nth hash value in the first hash chain sent by the key end; The Nth hash value is used as the first authentication hash value corresponding to the first lock switch instruction.
6. An information verification method, applied to a key end, comprising: Determining a lock switch control message corresponding to the Mth lock switch instruction, wherein the lock switch control message includes a lock switch event and a first hash value to be verified, where the first hash value to be verified is the NMth hash value on a first hash chain, where the first hash chain is obtained by performing N hash iterations on a first random number, where M is a positive integer and N is a positive integer greater than or equal to 2; Sending the lock opening and closing control message to the lock terminal, so that the lock terminal verifies the first hash value to be verified based on the first authentication hash value corresponding to the M-th lock opening and closing instruction, wherein the first authentication hash value is the N-M+1th hash value in the first hash chain; Receive a verification success feedback message corresponding to the Mth lock opening and closing instruction, wherein the verification success feedback message includes a second hash value to be verified; Obtaining a second authentication hash value corresponding to the Mth on / off lock instruction, where the second authentication hash value is the N-M+1th hash value in a second hash chain, where the second hash chain is obtained by performing N hash iterations on the second random number; Performing an operation on the second to-be-verified hash value to verify whether the operation result is consistent with the second authentication hash value; If the second hash value to be verified is the NMth hash value in the second hash chain, and the operation result is the N-M+1th hash value in the second hash chain, the message indicating that the switch lock event included in the switch lock control message is successfully executed is uploaded to the chain.
7. The method according to claim 6, further comprising: Obtaining the first random number; Performing N hash iterations on the first random number to obtain the first hash chain; The Nth hash value in the first hash chain is sent to the lock end, so that the lock end stores the Nth hash value as the first authentication hash value corresponding to the first lock opening and closing instruction.
8. The method according to claim 6 or 7, further comprising: Deleting the second authentication hash value corresponding to the M-th lock opening and closing instruction stored in the key end; The second to-be-verified hash value corresponding to the M-th lock-on / off instruction is stored as the second authentication hash value corresponding to the M+1-th lock-on / off instruction.
9. The method according to claim 6 or 7, wherein the step of operating the second hash value to be verified and verifying whether the operation result is consistent with the second authentication hash value comprises: Obtaining a hash function corresponding to the second hash chain; Performing a hash operation on the second hash value to be verified using the hash function to obtain a calculation result corresponding to the second hash value to be verified; If the operation result corresponding to the second to-be-verified hash value is equal to the second authentication hash value, determining that the operation result is consistent with the second authentication hash value; If the operation result corresponding to the second hash value to be verified is not equal to the second authentication hash value, it is determined that the operation result is inconsistent with the second authentication hash value.
10. The method according to claim 6 or 7, further comprising: Receive the Nth hash value in the second hash chain sent by the lock end; The Nth hash value is used as the second authentication hash value corresponding to the first lock switch instruction.
11. An information verification device, applied to a lock terminal, comprising: a receiving module configured to receive a lock switch control message corresponding to an M-th lock switch instruction, wherein the lock switch control message includes a lock switch event and a first hash value to be verified, where M is a positive integer; an acquisition module configured to acquire a first authentication hash value corresponding to the Mth on / off lock instruction, where the first authentication hash value is the N-M+1th hash value in a first hash chain, where the first hash chain is obtained by performing N hash iterations on a first random number, where N is a positive integer greater than or equal to 2; a verification module configured to perform an operation on the first to-be-verified hash value and verify whether the operation result is consistent with the first authentication hash value; an execution module configured to execute the switch lock event included in the switch lock control message if the first hash value to be verified is the NMth hash value in the first hash chain and the operation result is the N-M+1th hash value in the first hash chain; Determining a verification success feedback message corresponding to the Mth on / off lock instruction, where the verification success feedback message includes a second hash value to be verified, where the second hash value to be verified is the NMth hash value in a second hash chain, where the second hash chain is obtained by performing N hash iterations on the second random number; The verification success feedback message is sent to the key end so that the key end verifies the second hash value to be verified based on the second authentication hash value corresponding to the Mth lock opening and closing instruction, wherein the second authentication hash value is the N-M+1th hash value in the second hash chain.
12. An information verification device, applied to a key end, comprising: a determination module configured to determine a lock switch control message corresponding to an M-th lock switch instruction, wherein the lock switch control message includes a lock switch event and a first hash value to be verified, the first hash value to be verified being the NM-th hash value on a first hash chain, the first hash chain being obtained by performing N hash iterations on a first random number, where M is a positive integer and N is a positive integer greater than or equal to 2; a sending module configured to send the lock opening and closing control message to the lock terminal, so that the lock terminal verifies the first hash value to be verified based on a first authentication hash value corresponding to the Mth lock opening and closing instruction, wherein the first authentication hash value is the N-M+1th hash value in the first hash chain; Receive a verification success feedback message corresponding to the Mth lock opening and closing instruction, wherein the verification success feedback message includes a second hash value to be verified; Obtaining a second authentication hash value corresponding to the Mth on / off lock instruction, where the second authentication hash value is the N-M+1th hash value in a second hash chain, where the second hash chain is obtained by performing N hash iterations on the second random number; Performing an operation on the second to-be-verified hash value to verify whether the operation result is consistent with the second authentication hash value; If the second hash value to be verified is the NMth hash value in the second hash chain, and the operation result is the N-M+1th hash value in the second hash chain, the message indicating that the switch lock event included in the switch lock control message is successfully executed is uploaded to the chain.
13. An electronic device comprising: processor; as well as A memory, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the processor is caused to perform the method according to any one of claims 1 to 10.
14. A computer-readable storage medium having computer program instructions stored thereon, wherein when the computer program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Unlocking verification method based on block chain and unlocking system
CN108564692A
Verification method and device based on block chain node network
CN110223070A