Data verification method and device, electronic equipment and storage medium
By obtaining and verifying the hash value of the sender's credential information and generating verification identification information, combined with sending the data to be transmitted, the problem of cumbersome data verification in the existing technology is solved, the security and efficiency of data transmission are achieved, and the authenticity of the data is ensured. sex and integrity.
Patent Information
- Application Number
- CN202410687840.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-17
AI Technical Summary
Existing technologies have problems with cumbersome calculations when verifying data integrity and authenticity, lack of universality and generalizability, and are difficult to prevent malicious actors from sending false information without authorization.
By obtaining the target hash value of the sending end's credential information, its legitimacy is determined, and verification identification information is generated based on the shared group key, which is combined with the data to be transmitted and sent. The receiving end verifies the true integrity of the data based on the target data.
It improves the security and efficiency of data transmission, avoids malicious actors from sending false information, ensures the authenticity and integrity of data, and reduces the difficulty of verification without the need for special verification tools.
Smart Images

Figure CN118659900A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data encryption technology, and in particular to a data verification method, device, electronic equipment and storage medium. Background Art
[0002] Against the backdrop of rapid developments in the transportation sector, vehicle to pedestrian (V2P) technology has emerged as a key solution to mitigate pedestrian accidents and create a safer and more efficient transportation ecosystem by facilitating connectivity between vehicles and pedestrians.
[0003] Vulnerable road user awareness messages (VAM) are messages used to improve road safety, especially for vulnerable road users (such as pedestrians, cyclists, etc.). These messages usually contain information about the location, direction of movement, speed, etc. of vulnerable road users in a specific area. Vehicles can receive these VAMs through V2P technology, so that drivers can know the situation of vulnerable road users around them in advance, so that vehicles can make wise decisions and improve road safety.
[0004] However, when exchanging vulnerable road user awareness messages (VAMs) with vehicles on the road, there may be problems such as attackers pretending to be legitimate vehicles or pedestrians to send false information or access the network without authorization, as well as incomplete and unauthentic data. Therefore, it is necessary to verify the integrity and authenticity of the data to prevent malicious actors from modifying / tampering with the data. At present, the verification schemes for the authenticity of encrypted data of encryption devices require special supporting tools or extremely complex operation steps, and the verification schemes are not universal and scalable. Therefore, a convenient and secure method is needed to verify the data to ensure the integrity and authenticity of the data. Summary of the invention
[0005] The present invention provides a data verification method, device, electronic device and storage medium to solve the problem of cumbersome calculation in the process of verifying the integrity and authenticity of data and improve the efficiency of verifying data.
[0006] According to one aspect of the present invention, there is provided a data verification method, which is applied to a sending end and includes:
[0007] Obtaining sender credential information and determining a target hash value of the sender credential information;
[0008] Determine a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number;
[0009] When it is determined that the sender's credential information is legitimate, verification identification information is generated based on the shared group key and the data to be transmitted;
[0010] The verification identification information and the data to be transmitted are combined as target data, and the target data is sent to a receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
[0011] According to another aspect of the present invention, there is provided a data verification method, which is applied to a receiving end and comprises:
[0012] Obtain target data transmitted by the sender, and extract verification identification information and data to be transmitted from the target data;
[0013] Obtaining a shared group key, and generating verification data according to the shared group key and the data to be transmitted;
[0014] The authenticity and integrity of the data to be transmitted are verified according to the target data and the verification data.
[0015] According to another aspect of the present invention, there is provided a data verification device, which is applied to a sending end and includes:
[0016] A hash value determination module, used to obtain the sender credential information and determine the target hash value of the sender credential information;
[0017] A legitimacy judgment module, used to determine a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number;
[0018] A request generation module, used to generate verification identification information according to the shared group key and the data to be transmitted when it is determined that the sender credential information is legal;
[0019] The data sending module is used to combine the verification identification information and the data to be transmitted as target data, and send the target data to a receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
[0020] According to another aspect of the present invention, there is provided a data verification device, which is applied to a receiving end and comprises:
[0021] A data receiving module is used to obtain target data transmitted by a sending end, and extract verification identification information and data to be transmitted from the target data;
[0022] A data generation module, used to obtain a shared group key and generate verification data according to the shared group key and data to be transmitted;
[0023] A data verification module is used to verify the authenticity and integrity of the data to be transmitted based on the target data and the verification data.
[0024] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0025] at least one processor; and
[0026] a memory communicatively connected to the at least one processor; wherein,
[0027] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data verification method described in any embodiment of the present invention.
[0028] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data verification method described in any embodiment of the present invention when executed.
[0029] The technical solution of the embodiment of the present invention obtains the sender's credential information, determines the target hash value of the sender's credential information, determines the preset association number corresponding to the target hash value, determines the legitimacy of the sender's credential information according to the preset association number, realizes the verification of the sender's credential information, avoids malicious actors from sending false information through the sender without authorization, and improves the security of data transmission; when it is determined that the sender's credential information is legal, generates verification identification information according to the shared group key and the data to be transmitted, combines the verification identification information and the data to be transmitted as target data, and sends the target data to the receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data, so as to ensure that the data to be transmitted has not been tampered with, and ensures the authenticity and integrity of the data to be transmitted. At the same time, there is no need to apply special verification tools for verification, which reduces the difficulty of verifying the data to be transmitted and improves the efficiency of verifying the data to be transmitted.
[0030] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 is a flow chart of a data verification method provided according to Embodiment 1 of the present invention;
[0033] Figure 2 is a flow chart of another data verification method provided according to the second embodiment of the present invention;
[0034] Figure 3 is a flow chart of another data verification method provided according to Embodiment 3 of the present invention;
[0035] Figure 4 is a flow chart of another data verification method provided according to Embodiment 4 of the present invention;
[0036] Figure 5 is a structural schematic diagram of a data verification device provided according to Embodiment 6 of the present invention;
[0037] Figure 6 is a structural diagram of a data verification device provided according to Embodiment 7 of the present invention;
[0038] Figure 7 It is a schematic diagram of the structure of an electronic device for implementing the data verification method of an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Embodiment 1
[0042] Figure 1 This is a flow chart of a data verification method provided according to the first embodiment of the present invention, which is applied to the sending end. This embodiment can be used for pedestrians and vehicles to exchange data information in a trusted manner to avoid collisions on the road. The method can be executed by a data verification device, which can be implemented in the form of hardware and / or software, and the data verification device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0043] S110. Obtain sender credential information and determine a target hash value of the sender credential information.
[0044] Among them, the sender's credential information can be understood as data information that proves the identity of the sender. In one embodiment, the sender's credential information can include the sender's unique identification information and verification password and other information. Exemplarily, the sender's unique identification information can be considered as information that can clearly refer to the sender, such as the sender's device identification code (Identity document, ID), device serial number, and user ID. The verification password can be preset verification information associated with the sender's unique identification information. In the actual operation process, the sender can be a smart device on the pedestrian side, such as a smart watch, wearable device, and smart phone. The target hash value is also the target hash value, which is a fixed-length value calculated by a characteristic hash algorithm on the sender's credential information. Exemplarily, the target hash value can be determined by a secure hash algorithm (Secure Hash Algorithm, SHA) and the like.
[0045] In an embodiment, the sender's unique identification information such as the sender's device ID, device serial number or user ID can be collected as the sender's credential information; or, the sender's unique identification information can be extracted, and a pre-set verification password can be extracted as the sender's credential information. Then, the target hash value of the sender's credential information is determined by a hash algorithm such as SHA. In an embodiment, the sender can also customize a character combination as the unique identification information.
[0046] S120. Determine a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number.
[0047] Among them, the sender registration information can be understood as information for establishing an association relationship between the user and the receiver, which can be pre-stored data information. There is a corresponding relationship between the sender registration information and the target hash value. In one embodiment, before performing data verification, the first XOR result of the target hash value and the preset association number can be determined, and the first XOR result is used as the sender registration information. The preset association number can be understood as a value used to confuse the target hash value, which can be used to avoid the leakage of the target hash value and improve the privacy of the sender credential information. The preset association number can be a pre-set random number.
[0048] In an embodiment, the sender registration information associated with the target hash value can be determined, and the preset association number corresponding to the target hash value can be determined according to the target hash value and the sender registration information. Exemplarily, the target hash value and the sender registration information can be XORed to obtain the preset association number; or, the sender registration information can be stored in association with the preset association number, and the preset association number corresponding to the sender registration information can be directly extracted. Then the legitimacy of the sender credential information is determined according to the preset association number. In the actual operation process, the sender registration information can obtain the same shared group key as the receiving end, and the preset association number and the key hash value of the shared group key can be determined. When it is determined that the preset association number and the key hash value of the shared group key are the same as the pre-stored hash value, the sender credential information is determined to be legal; when it is determined that the key hash value is not the same as the hash value, the sender credential information is determined to be illegal. Alternatively, it can be determined whether the preset association number is the same as the pre-stored value. When the values are determined to be the same, the sender credential information is determined to be legal.
[0049] S130: When it is determined that the sender credential information is legal, generate verification identification information according to the shared group key and the data to be transmitted.
[0050] The shared group key can be understood as a key shared by a specific group or community to ensure the security of communication or data interaction between members of the group. In actual operation, the sender and the receiver can be pre-determined to establish an association relationship, and the sender and the receiver components can be shared to generate a shared group key. When the sender and the receiver need to perform encrypted communication or access protected resources, this shared group key can be used for encryption and decryption operations.
[0051] The data to be transmitted can be understood as data that needs to be transmitted. In actual operation, the data to be transmitted may include data that needs to be shared and a timestamp of the current time. In one embodiment, the data to be transmitted may include, but is not limited to, vulnerable road user awareness messages (VAMs), such as the location, direction of movement, speed, and other information of vulnerable road users in a specific area, so that the vehicle receives the VAM, thereby allowing the driver to know the situation of the vulnerable road users around in advance, so as to respond in time and avoid the occurrence of collision accidents. The verification identification information can be considered as a verification identification used to verify the authenticity and integrity of the data to be transmitted.
[0052] In an embodiment, when it is determined that the sender's credential information is legal, the pre-established shared group key can be extracted to determine the hash value of the data to be transmitted and the shared group key, and the hash value can be used as verification identification information; alternatively, the data to be transmitted can be encrypted by the shared group key, and the encrypted data to be transmitted can be used as verification identification information.
[0053] S140: Combining the verification identification information and the data to be transmitted as target data, and sending the target data to a receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
[0054] The target data can be understood as data transmitted to the receiving end, and the receiving end can place the target data to verify the authenticity and integrity of the data to be transmitted. The target data can include verification identification information and the data to be transmitted.
[0055] In an embodiment, the verification identification information and the data to be transmitted can be combined to generate a data packet, and the data packet can be used as the target data; or the verification identification information can be used as the identification of the data to be transmitted as the target data, and the target data can be transmitted to the receiving end. In the actual operation process, the target data can be transmitted to the receiving end through vehicle to X (V2X) wireless communication technology, so that the receiving end verifies the authenticity and integrity of the data to be transmitted based on the target data.
[0056] The embodiment of the present invention obtains the sender's credential information, determines the target hash value of the sender's credential information, determines the preset association number corresponding to the target hash value, determines the legitimacy of the sender's credential information according to the preset association number, and implements verification of the sender's credential information, thereby preventing malicious actors from sending false information through the sender without authorization, and improving the security of data transmission; when it is determined that the sender's credential information is legal, generates verification identification information according to the shared group key and the data to be transmitted, combines the verification identification information and the data to be transmitted as target data, and sends the target data to the receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data, so as to ensure that the data to be transmitted has not been tampered with, and ensure the authenticity and integrity of the data to be transmitted. At the same time, there is no need to apply a special verification tool for verification, which reduces the difficulty of verifying the data to be transmitted and improves the efficiency of verifying the data to be transmitted.
[0057] In one embodiment, before obtaining the sender credential information and determining the target hash value of the sender credential information, the method further includes:
[0058] Determine a registration hash value of the sender credential information, determine a first XOR result of the registration hash value and a preset association number, and use the first XOR result as the sender registration information;
[0059] Obtain the cloud key of the cloud server, and encrypt the sender registration information with the cloud key, so that the cloud server establishes an association relationship between the sender and the receiver through the sender credential information, and establishes a shared group key based on the association relationship and sends it to the sender; wherein the shared group key is a hash value of the preset group password number and the preset association relationship code;
[0060] Receive the shared group key sent by the cloud server, determine the first hash value of the shared group key and the preset association number, and store the shared group key, the first hash value and the sender registration information.
[0061] Among them, the registration hash value can be understood as the hash value determined by the hash algorithm of the sender's credential information. The cloud key can be understood as the key used to encrypt and decrypt data on the cloud server. The preset group password number is the group password number selected by the cloud server, and the preset association relationship code is the unique number corresponding to the association relationship determined by the cloud server according to the association relationship between the sender and the receiver. In one embodiment, the preset group password number and the preset association relationship code are only known to the cloud server. Exemplarily, the preset association relationship code is a unique number (selected by the cloud server - for example, a 128-byte unique number), and the preset group password number is a group secret number (randomly generated 256 bytes) selected by the cloud server. Among them, the cloud server can be considered as a registration agency.
[0062] In an embodiment, the sender credential information can be extracted to determine the hash value of the sender credential information as the registration hash value, and then the registration hash value is XORed with the preset association number to obtain the first XOR result, and the first XOR result is used as the sender registration information. The cloud key of the cloud server is obtained, and the sender registration information is encrypted by the cloud key. The cloud server can decrypt the sender registration information, and establish an association relationship between the sender and the receiver through the sender credential information, and establish a shared group key based on the association relationship and send it to the sender. The sender can receive the shared group key sent by the cloud server, determine the first hash value of the shared group key and the preset association number, and store the shared group key, the first hash value and the sender registration information. In the actual operation process, the shared group key, the first hash value and the sender registration information can be stored in a secure memory to ensure the security of the credential data such as the shared group key, the first hash value and the sender registration information. In one embodiment, the receiver can register in the same way to establish an association relationship with the sender.
[0063] In this embodiment, the association relationship between the sender and the receiver is established, that is, the sender is authorized to participate in V2P communication, which prevents unauthorized malicious actors from impersonating the sender to send false information and ensures the security of data transmission. At the same time, the sender registration information is encrypted by the cloud key to prevent the information leakage of the sender and ensure the security of the sender registration information.
[0064] Embodiment 2
[0065] Figure 2 1 is a flowchart of another data verification method provided according to Embodiment 2 of the present invention. This embodiment is further optimized and expanded based on the above embodiment and can be combined with various optional technical solutions in the above embodiment. Figure 2 As shown, the method includes:
[0066] S210. Obtain sender credential information and determine a target hash value of the sender credential information.
[0067] S220, extracting the sending end registration information associated with the target hash value, and performing an XOR operation on the target hash value and the sending end registration information to obtain a preset association number.
[0068] In an embodiment, pre-stored sender registration information may be obtained, an XOR result value of the target hash value and the sender registration information may be determined, and the XOR result value may be used as an association number.
[0069] S230: Extract a pre-stored shared group key and a first hash value of the shared group key and a preset association number.
[0070] In an embodiment, the shared group key and the first hash value of the shared group key and the preset association number can be pre-stored in a storage module and a cloud server, and the pre-stored shared group key and the first hash value of the shared group key and the preset association number can be extracted from the storage module; or, the cloud server can be requested to cause the cloud server to send the pre-stored shared group key and the first hash value of the shared group key and the preset association number.
[0071] S240: Determine a preset association number and a key hash value of the shared group key.
[0072] In an embodiment, a hash algorithm such as SHA512 may be used to determine a hash value of a preset association number and a shared group key, and the hash value is used as a key hash value.
[0073] S250: When it is determined that the key hash value is the same as the first hash value, determine that the sender credential information is legal.
[0074] In an embodiment, when it is determined that the key hash value is the same as the first hash value, the sender can be considered to be a real sender, that is, the obtained sender credential information is the same as the pre-stored sender credential information, and the sender credential information is considered to be legal.
[0075] S260: When it is determined that the key hash value is different from the first hash value, determine that the sender credential information is illegal.
[0076] In an embodiment, when it is determined that the key hash value is different from the first hash value, it can be considered that the sender is not a real sender, that is, the obtained sender credential information is different from the pre-stored sender credential information, and the sender credential information is considered to be illegal. In an embodiment, when it is determined that the sender credential information is illegal, the sending of the data to be transmitted can be blocked to avoid sending malicious information to the receiving end for unnecessary data verification.
[0077] S270: When it is determined that the sender credential information is legal, determine the first data to be transmitted, determine the current time as the timestamp of the first data, and combine the first data and the timestamp as the data to be transmitted.
[0078] The first data may be information to be transmitted immediately, and is useful data that needs to be transmitted to the receiving end. In one embodiment, the first data may include but is not limited to roadside data, user location information and other data.
[0079] In an embodiment, when it is determined that the sender credential information is legal, the data information to be transmitted can be collected as the first data, and at the same time, the current time is determined as the timestamp of the first data, and the first data and the timestamp are combined as the data to be transmitted.
[0080] S280: Determine the hash value of the data to be transmitted and the shared group key, and use the hash value as verification identification information.
[0081] In an embodiment, a hash algorithm such as SHA512 may be used to determine the hash value of the data to be transmitted and the shared group key, and the hash value is used as the key hash value.
[0082] S290, combining the verification identification information and the data to be transmitted as target data, and sending the target data to the receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
[0083] According to an embodiment of the present invention, by acquiring sender credential information, a target hash value of the sender credential information is determined, sender registration information associated with the target hash value is extracted, the target hash value is XORed with the sender registration information to obtain a preset association number, a pre-stored shared group key and a first hash value associated with the shared group key and the preset association number are extracted, a key hash value of the preset association number and the shared group key is determined, and the legitimacy of the sender credential information is determined according to the key hash value and the first hash value, thereby implementing authentication of the sender and improving the security of data transmission; when it is determined that the sender credential information is legal, first data to be transmitted is determined, and the current time is determined as the timestamp of the first data, the first data and the timestamp are combined as the data to be transmitted, the hash value of the data to be transmitted and the shared group key is determined, the hash value is used as verification identification information, and the verification identification information and the data to be transmitted are combined as the target data, so that the receiving end can verify the data to be transmitted according to the target data, thereby obtaining true and complete data to be transmitted.
[0084] Embodiment 3
[0085] Figure 3 is a flowchart of another data verification method provided according to the third embodiment of the present invention, which is applied to the receiving end, such as Figure 3 As shown, the method includes:
[0086] S310, obtaining target data transmitted by the sending end, and extracting verification identification information and data to be transmitted in the target data.
[0087] In an embodiment, target data sent by a sending end may be received, and verification identification information and data to be transmitted in the target data may be identified.
[0088] S320: Obtain a shared group key, and generate verification data according to the shared group key and the data to be transmitted.
[0089] In an embodiment, the shared group key can be issued by the cloud server according to the association relationship, and a pre-stored shared group key can be extracted, or the cloud server can be requested to re-issue the shared group key. The verification data corresponding to the data to be transmitted is determined by the shared group key. In the actual operation process, the shared group key and the hash value of the data to be transmitted can be determined in the same way as the sending end, and the hash value can be used as the verification data.
[0090] S330: Verify the authenticity and integrity of the data to be transmitted based on the target data and the verification data.
[0091] In an embodiment, after the verification data is determined, the verification data can be compared with the verification identification information in the target data. When it is determined that the verification identification information is the same as the verification information, it can be considered that the data to be transmitted has not been tampered with, and the data to be transmitted is determined to be true and complete; when it is determined that the verification identification information is not the same as the verification information, it can be considered that the received data to be transmitted is inconsistent with the data to be transmitted sent by the sender, and the data to be transmitted is determined to be untrue or incomplete.
[0092] The embodiments of the present invention obtain the target data transmitted by the sending end, extract the verification identification information and the data to be transmitted in the target data, obtain the shared group key, generate verification data according to the shared group key and the data to be transmitted, and then verify the authenticity and integrity of the data to be transmitted according to the target data and the verification data. Under the premise of accurate verification and data security and privacy, lightweight computing is achieved, and the data to be transmitted is conveniently verified, thereby improving the efficiency of verifying the data to be transmitted.
[0093] In one embodiment, before obtaining the shared group key, the method further includes:
[0094] Extract the timestamp in the data to be transmitted and determine the current timestamp at the current moment;
[0095] When the difference between the determined timestamp and the current timestamp is less than or equal to the preset time interval, the timeliness of the target data is determined to be timely, and the authenticity and integrity of the data to be transmitted are further verified;
[0096] When the difference between the determined timestamp and the current timestamp is greater than a preset time interval, the timeliness of the target data is determined to be untimely, and verification of the data to be transmitted is not performed.
[0097] The preset time interval can be understood as a preset time interval critical value, which can be used to determine the timeliness of the target data.
[0098] In an embodiment, after receiving the target data, the timestamp contained in the data to be transmitted can be determined, and the current time can be determined as the current timestamp. The interval time between the timestamp and the current timestamp is determined. When the difference between the timestamp and the current timestamp is determined to be less than or equal to the preset time interval, the timeliness of the target data can be considered to be timely; when the difference between the timestamp and the current timestamp is determined to be greater than the preset time interval, the timeliness of the target data can be considered to be untimely. When the timeliness is determined to be timely, continue to verify the authenticity and integrity of the data to be transmitted. When the timeliness of the target data is determined to be untimely, the data to be transmitted may not be verified, so as to avoid wasting resources on the receiving end and not increase the pressure of data verification on the receiving end.
[0099] Embodiment 4
[0100] Figure 4 is a flowchart of another data verification method provided according to the fourth embodiment of the present invention, which is applied to the receiving end, such as Figure 4 As shown, the method includes:
[0101] S410, obtaining target data transmitted by the sending end, and extracting verification identification information and data to be transmitted in the target data.
[0102] S420: Determine the association relationship with the sending end in the cloud server, extract the shared group key corresponding to the association relationship, and determine the shared group key and the hash value of the data to be transmitted as verification data.
[0103] In an embodiment, the credential information of the receiving end can be determined in advance, and an association relationship with the sending end can be established through the cloud server, and the cloud server can issue a corresponding shared group key according to the association relationship. In the actual operation process, the association relationship with the sending end can be determined in the cloud server, the shared group key corresponding to the association relationship can be determined, and the hash value of the shared group key and the data to be transmitted can be determined, and the hash value can be used as verification data.
[0104] S430: When it is determined that the verification identification information and the verification data are verified to be the same, it is determined that the information to be transmitted is authentic and complete.
[0105] In an embodiment, when it is determined that the verification identification information and the verification data are verified to be identical, it can be determined that the received data to be transmitted is identical to the information to be transmitted sent by the sender, and the information to be transmitted is considered to be authentic and complete.
[0106] S440: When it is determined that the verification identification information and the verification data are not identical, the information to be transmitted is determined to be untrue and / or incomplete.
[0107] In an embodiment, when it is determined that the verification identification information and the verification data are not identical, it can be determined that the received data to be transmitted is not identical to the information to be transmitted sent by the sender, and the information to be transmitted is considered to be untrue or incomplete.
[0108] In an embodiment of the present invention, target data transmitted by a sender is obtained, verification identification information and data to be transmitted are extracted from the target data, and an association relationship with the sender is determined in a cloud server, a shared group key corresponding to the association relationship is extracted, and a hash value of the shared group key and the data to be transmitted is determined as verification data. By determining the relationship between the verification identification information and the verification data, it is determined that the information to be transmitted is authentic and complete, thereby accurately verifying the information to be transmitted.
[0109] Embodiment 5
[0110] In one embodiment, this embodiment is based on the above embodiment, taking a cloud server as a registration agency, a pedestrian user as a sender, and a vehicle as a receiver as an example to further illustrate a data verification method.
[0111] Step 1: The sender determines the sender's unique identification information and verification password as the sender's credential information, and determines the target hash value of the sender's credential information. Taking the unique identification information as A and the verification password as B as an example, the target hash value is X=h(A||B).
[0112] Step 2: The sender extracts the pre-stored sender registration information, and performs XOR on the sender registration information and the target hash value to obtain a preset association number. For example, the sender registration information is X and the preset association number is C, C = X⊕h(A||B).
[0113] Step 3: The sender obtains the shared group key and determines the first hash value of the shared group key and the preset association number. Taking the shared group key as Y and the first hash value as Z' as an example, the first hash value is Z'=h(Y||C). Extract the first hash value Z of the pre-stored shared group key and the preset association number. When it is determined that Z'=Z, the sender's credential information is determined to be legal.
[0114] Step 4: The sender determines the first data to be transmitted and the timestamp of the current moment, and uses the hash value of the first data, the timestamp and the shared group key Y as the verification identification information. Taking the timestamp as T, the first data as Info, and the verification identification information as MSG as an example, the verification identification information MSG=h(Y||T||Info) is determined.
[0115] Step 5: The sending end combines the verification identification information, the first data and the timestamp as target data and sends the target data to the receiving end. The target data is {MSG, Info, T}.
[0116] Step 6: When the receiving end determines that the difference between the timestamp and the current timestamp is less than or equal to the preset time interval, the timeliness of the target data is determined to be timely, and the authenticity and integrity of the data to be transmitted are continued to be verified.
[0117] Step 7: The receiving end obtains the shared group key Y, and determines the hash value of the shared group key Y, the first data and the timestamp as the verification data MSG'=h(Y||T||Info), where Y=h(GSN||W).
[0118] Step 8: When the receiving end determines that the verification identification information and the verification data are verified to be the same, the information to be transmitted is determined to be true and complete; when the verification identification information and the verification data are determined to be different, the information to be transmitted is determined to be untrue and / or incomplete.
[0119] In one embodiment, before performing data verification, the method further includes user registration at the sending end, wherein the user registration method includes:
[0120] Step A: The sender determines the unique identification information and verification password of the sender as the sender credential information, determines the target hash value of the sender credential information, and XORs the target hash value with the preset association number to obtain a first XOR result as the sender registration information. X=h(A||B)⊕C, where X is the sender registration information, A is the unique identification information A, B is the verification password, and C is the preset association number.
[0121] Step B: The sender obtains the cloud key of the cloud server (registration agency), encrypts the sender registration information according to the cloud key, and sends it to the cloud server (registration agency).
[0122] Step C: The cloud server (registration agency) decrypts the registration information of the sender, establishes an association relationship between the sender and the receiver, selects a preset group password number and a preset association relationship code for the association relationship, and uses the hash value of the preset group password number and the preset association relationship code as the shared group key Y, the shared group key Y = h(GSN||W), where GSN is the preset group password number and W is the preset association relationship code.
[0123] Step D: The cloud server (registration authority) sends the shared group key Y to the sender.
[0124] Step E: The sender stores the sender registration information X and the shared group key Y in a secure memory.
[0125] Embodiment 6
[0126] Figure 5 1 is a schematic diagram of the structure of a data verification device provided according to Embodiment 6 of the present invention, which is applied to the sending end. Figure 5As shown, the data verification device includes: a hash value determination module 51, a legality judgment module 52, a request generation module 53 and a data sending module 54.
[0127] The hash value determination module 51 is used to obtain the sender's credential information and determine the target hash value of the sender's credential information.
[0128] The legitimacy judgment module 52 is used to determine the preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number.
[0129] The request generation module 53 is used to generate verification identification information according to the shared group key and the data to be transmitted when it is determined that the sender credential information is legal.
[0130] The data sending module 54 is used to combine the verification identification information and the data to be transmitted as target data, and send the target data to the receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
[0131] In the embodiment of the present invention, the sender's credential information is obtained through a hash value determination module, a target hash value of the sender's credential information is determined, and a preset association number corresponding to the target hash value is determined. The legitimacy judgment module determines the legitimacy of the sender's credential information according to the preset association number, thereby verifying the sender's credential information, preventing malicious actors from sending false information through the sender without authorization, and improving the security of data transmission. When the request generation module determines that the sender's credential information is legal, the verification identification information is generated according to the shared group key and the data to be transmitted. The data sending module combines the verification identification information and the data to be transmitted as target data, and sends the target data to the receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data, so as to ensure that the data to be transmitted has not been tampered with, and the authenticity and integrity of the data to be transmitted are guaranteed. At the same time, there is no need to apply a special verification tool for verification, which reduces the difficulty of verifying the data to be transmitted and improves the efficiency of verifying the data to be transmitted.
[0132] In one embodiment, the data verification device further includes:
[0133] A registration information determination module, used to determine a registration hash value of the sender credential information, determine a first XOR result of the registration hash value and a preset association number, and use the first XOR result as the sender registration information;
[0134] The group key determination module is used to obtain the cloud key of the cloud server, encrypt the sender registration information by the cloud key, so that the cloud server establishes an association relationship between the sender and the receiver through the sender credential information, and establishes a shared group key based on the association relationship and sends it to the sender; wherein the shared group key is a hash value of a preset group password number and a preset association relationship code;
[0135] The data storage module is used to receive the shared group key sent by the cloud server, determine the first hash value of the shared group key and the preset association number, and store the shared group key, the first hash value and the sender registration information.
[0136] In one embodiment, the legality determination module 52 includes:
[0137] A first data determination unit, configured to extract the sender registration information associated with the target hash value, and perform an XOR operation on the target hash value and the sender registration information to obtain a preset association number;
[0138] A first hash determination unit, configured to extract a pre-stored shared group key and a first hash value of the shared group key and a preset association number;
[0139] a key hash determination unit, configured to determine a key hash value of a preset association number and a shared group key;
[0140] A first legitimacy judgment unit, configured to determine that the sender credential information is legal when it is determined that the key hash value is the same as the first hash value;
[0141] The second legitimacy judgment unit is used to determine that the sender credential information is illegal when it is determined that the key hash value is different from the first hash value.
[0142] In one embodiment, the request generation module 53 includes:
[0143] a transmission data determination unit, configured to determine first data to be transmitted, determine a current time as a timestamp of the first data, and combine the first data and the timestamp as the data to be transmitted;
[0144] The verification information determination unit is used to determine the hash value of the data to be transmitted and the shared group key, and use the hash value as the verification identification information.
[0145] The data verification device provided in the embodiment of the present invention can execute the data verification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0146] Embodiment 7
[0147] Figure 61 is a schematic diagram of the structure of a data verification device provided according to Embodiment 7 of the present invention, which is applied to a receiving end. Figure 6 As shown, the data verification device includes: a data receiving module 61, a data generating module 62 and a data verification module 63.
[0148] The data receiving module 61 is used to obtain the target data transmitted by the sending end, and extract the verification identification information and the data to be transmitted in the target data.
[0149] The data generation module 62 is used to obtain a shared group key and generate verification data according to the shared group key and the data to be transmitted.
[0150] The data verification module 63 is used to verify the authenticity and integrity of the data to be transmitted based on the target data and the verification data.
[0151] In the embodiment of the present invention, the target data transmitted by the sending end is obtained through the data receiving module, the verification identification information and the data to be transmitted in the target data are extracted, the data generating module obtains the shared group key, and the verification data is generated according to the shared group key and the data to be transmitted. The data verification module verifies the authenticity and integrity of the data to be transmitted according to the target data and the verification data, thereby realizing lightweight computing, conveniently verifying the data to be transmitted, and improving the efficiency of verifying the data to be transmitted under the premise of accurate verification and data security and privacy.
[0152] In one embodiment, the data verification device further includes:
[0153] A timestamp determination module, used to extract the timestamp in the data to be transmitted and determine the current timestamp at the current moment;
[0154] A first timeliness determination module, configured to determine that the timeliness of the target data is timely when the difference between the determined timestamp and the current timestamp is less than or equal to a preset time interval, and continue to verify the authenticity and integrity of the data to be transmitted;
[0155] The second timeliness determination module is used to determine that the timeliness of the target data is not timely and not verify the data to be transmitted when the difference between the determined timestamp and the current timestamp is greater than a preset time interval.
[0156] In one embodiment, the data generation module 62 includes:
[0157] The verification data generation unit is used to determine the association relationship with the sending end in the cloud server, extract the shared group key corresponding to the association relationship, and determine the shared group key and the hash value of the data to be transmitted as the verification data.
[0158] In one embodiment, the data verification module 63 includes:
[0159] A first verification unit, used to determine that the information to be transmitted is authentic and complete when it is determined that the verification identification information and the verification data are verified to be the same;
[0160] The second verification unit is used to determine that the information to be transmitted is untrue and / or incomplete when it is determined that the verification identification information and the verification data are not verified to be the same.
[0161] The data verification device provided in the embodiment of the present invention can execute the data verification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0162] Embodiment 8
[0163] Figure 7 Schematic diagram of the structure of an electronic device for implementing the data verification method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0164] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0165] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0166] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a data verification method.
[0167] In some embodiments, the data verification method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data verification method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data verification method in any other appropriate manner (e.g., by means of firmware).
[0168] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0169] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0170] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.
[0171] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0172] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0173] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0174] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0175] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data verification method, characterized in that: Applied to the sending end, including: Obtaining sender credential information and determining a target hash value of the sender credential information; Determine a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number; When it is determined that the sender's credential information is legitimate, verification identification information is generated based on the shared group key and the data to be transmitted; The verification identification information and the data to be transmitted are combined as target data, and the target data is sent to a receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
2. The method according to claim 1, characterized in that Before obtaining the sender credential information and determining the target hash value of the sender credential information, the method further includes: Determine a registration hash value of the sender credential information, determine a first XOR result of the registration hash value and the preset association number, and use the first XOR result as the sender registration information; Obtain a cloud key of the cloud server, and encrypt the sender registration information by using the cloud key, so that the cloud server establishes an association relationship between the sender and the receiver through the sender credential information, and establishes the shared group key according to the association relationship and sends it to the sender; wherein the shared group key is a hash value of a preset group password number and a preset association relationship code; The shared group key sent by the cloud server is received, a first hash value of the shared group key and the preset association number is determined, and the shared group key, the first hash value and the sender registration information are stored.
3. The method according to claim 1, characterized in that The determining a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determining the legitimacy of the sender credential information according to the preset association number, includes: Extracting the sender registration information associated with the target Hash value, and performing an XOR operation on the target Hash value and the sender registration information to obtain the preset association number; Extracting a pre-stored shared group key and a first hash value of the shared group key and the preset association number; Determining a key hash value of the preset association number and the shared group key; When it is determined that the key hash value is the same as the first hash value, determining that the sender credential information is legal; When it is determined that the key hash value is different from the first hash value, the sender credential information is determined to be illegal.
4. The method according to claim 1, characterized in that: The generating verification identification information according to the shared group key and the data to be transmitted includes: Determine first data to be transmitted, determine the current time as a timestamp of the first data, and combine the first data and the timestamp as the data to be transmitted; Determine a hash value of the data to be transmitted and the shared group key, and use the hash value as verification identification information.
5. A data verification method, characterized in that: Applied to the receiving end, including: Obtain target data transmitted by the sender, and extract verification identification information and data to be transmitted from the target data; Obtaining a shared group key, and generating verification data according to the shared group key and the data to be transmitted; The authenticity and integrity of the data to be transmitted are verified according to the target data and the verification data.
6. The method according to claim 5, characterized in that Before obtaining the shared group key, the method further includes: Extracting the timestamp in the data to be transmitted, and determining the current timestamp at the current moment; When it is determined that the difference between the timestamp and the current timestamp is less than or equal to the preset time interval, the timeliness of the target data is determined to be timely, and the authenticity and integrity of the data to be transmitted are further verified; When it is determined that the difference between the timestamp and the current timestamp is greater than a preset time interval, the timeliness of the target data is determined to be untimely, and verification of the data to be transmitted is not performed.
7. The method according to claim 5, characterized in that The obtaining of the shared group key and generating verification data according to the shared group key and the data to be transmitted includes: In the cloud server, an association relationship with the sending end is determined, the shared group key corresponding to the association relationship is extracted, and a hash value of the shared group key and the data to be transmitted is determined as verification data.
8. The method according to claim 5, characterized in that The verifying the authenticity and integrity of the data to be transmitted according to the target data and the verification data includes: When it is determined that the verification identification information and the verification data are verified to be identical, determining that the information to be transmitted is authentic and complete; When it is determined that the verification identification information and the verification data are not identical, it is determined that the information to be transmitted is untrue and / or incomplete.
9. A data verification device, characterized in that: Applied to the sending end, including: A hash value determination module, used to obtain the sender credential information and determine the target hash value of the sender credential information; A legitimacy judgment module, used to determine a preset association number corresponding to the target hash value according to the target hash value and the sender registration information, and determine the legitimacy of the sender credential information according to the preset association number; A request generation module, used to generate verification identification information according to the shared group key and the data to be transmitted when it is determined that the sender credential information is legal; The data sending module is used to combine the verification identification information and the data to be transmitted as target data, and send the target data to a receiving end, so that the receiving end verifies the authenticity and integrity of the data to be transmitted according to the target data.
10. A data verification device, characterized in that: Applied to the receiving end, including: A data receiving module is used to obtain target data transmitted by a sending end, and extract verification identification information and data to be transmitted from the target data; A data generation module, used to obtain a shared group key and generate verification data according to the shared group key and data to be transmitted; A data verification module is used to verify the authenticity and integrity of the data to be transmitted based on the target data and the verification data.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the data verification method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data verification method according to any one of claims 1 to 8 when executed.
