Data verification method and device, equipment and medium

By mapping the hash value of the data to be verified to points on the elliptic curve and generating encrypted data using random numbers, the problem of difficult data security during the data verification process is solved, and data security verification is achieved.

CN119862602APending Publication Date: 2025-04-22CCB FINTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411913459.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In the prior art, the data verification process cannot guarantee the security of the data, and there is a risk of data repulsion.

Method used

The first encrypted data is generated by determining the string corresponding to the data to be verified and mapping the hash value of the string to a point on the elliptic curve based on the preset encryption algorithm. If itself is a verification device, the second encrypted data is determined based on the random number generated by itself, the random number sent by the other party and the first encrypted data, and compared it with the other party's encrypted data to determine that the verification of the data to be verified is passed.

Benefits of technology

Through this method, the problem of obtaining the data to be verified by exhaustive hash values ​​is avoided, and data security during the data verification process is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862602A_ABST
    Figure CN119862602A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a data verification method and device, equipment and a medium. A character string corresponding to the to-be-verified data is determined, first encrypted data corresponding to the character string is determined based on a preset encryption algorithm, the first encrypted data is data obtained by mapping a hash value of the character string to a point on an elliptic curve, and other devices cannot obtain the to-be-verified data based on the first encrypted data; determining second encrypted data according to a self-generated first random number, a second random number sent by a data providing device of the to-be-verified data and the first encrypted data; and if the third encrypted data sent by the data providing equipment is received, judging whether the second encrypted data is consistent with the third encrypted data or not, and if so, determining that the to-be-verified data passes verification, thereby avoiding the problem that the to-be-verified data can be obtained in a mode of exhaustion of a hash value, and improving the verification efficiency of the to-be-verified data. And the security of the to-be-verified data in the data verification process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data verification method, device, equipment and medium. Background Art

[0002] At present, various regulatory agencies need to collect various types of data from enterprises for the development of regulatory work. For example, the Financial Regulatory Bureau needs to collect financial business data from various commercial banks, the State-owned Assets Supervision and Administration Commission of the State Council needs to collect operating data from various central enterprises, and the Cyberspace Administration of China needs to collect data from various Internet platforms. After collecting relevant data, regulatory agencies often encounter problems such as inaccurate data and human tampering. They need to monitor and analyze data quality and ensure the authenticity and consistency of data through real-time inspection, multi-source verification and other means.

[0003] In actual scenarios, the regulatory agency's equipment generally samples data within a certain range and conducts real-time verification with the data from the corresponding agency's production environment to verify whether the data previously reported by the agency has problems with accuracy, completeness, timeliness, etc., to prevent dishonest behavior of the agency's real data and the regulatory reported data being "two skins".

[0004] In the related technologies, the most direct idea and method for the privacy verification of numerical data is that both parties calculate the hash value of the data to be verified, and then determine the verification result based on whether the hash value matches. However, in actual scenarios, for some data, such as numerical data and English letters, the range of possible values ​​is limited. Therefore, there is a possibility of exhaustively enumerating the hash value of the data, so that the data can be reversed based on the hash value of the data to be verified, and the security of the data cannot be guaranteed.

[0005] Therefore, how to ensure the security of data during the data verification process becomes an urgent problem to be solved. Summary of the invention

[0006] The present application provides a data verification method, device, equipment and medium to solve the problem that the data verification process in the prior art cannot ensure the security of data.

[0007] The present application provides a data verification method, the method comprising:

[0008] Determine the character string corresponding to the data to be verified;

[0009] Determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve;

[0010] If the device itself is a verification device, the device determines the second encrypted data according to the first random number generated by the device itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data;

[0011] If the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification.

[0012] Furthermore, before determining the character string corresponding to the data to be verified, the method further includes:

[0013] The data to be verified is encrypted using the first random number to obtain fourth encrypted data, and the data to be verified is updated using the fourth encrypted data.

[0014] Furthermore, the method comprises:

[0015] Sending the first random number to a data providing device;

[0016] Before determining the character string corresponding to the data to be verified, the method further includes:

[0017] The receiving device provides a second random number sent by the data providing device, uses the second random number to encrypt the data to be verified to obtain fifth encrypted data, and uses the fifth encrypted data to update the data to be verified.

[0018] Further, after determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the method further includes:

[0019] Obtain the shared data of all parties involved in data verification;

[0020] The shared data is merged with the second encrypted data to obtain sixth encrypted data, a hash value of the sixth encrypted data is determined, and the second encrypted data is updated using the hash value.

[0021] Furthermore, the method further comprises:

[0022] If the device itself is a data providing device, the second encrypted data is sent to the verification device.

[0023] Furthermore, before determining the character string corresponding to the data to be verified, the method further includes:

[0024] generating a third random number;

[0025] The data to be verified is encrypted using the third random number to obtain seventh encrypted data, and the data to be verified is updated using the seventh encrypted data.

[0026] Further, after generating the third random number, the method includes:

[0027] Sending the third random number to a verification device;

[0028] Before determining the character string corresponding to the data to be verified, the method further includes:

[0029] Receive a fourth random number sent by the verification device, use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0030] Furthermore, if the data to be verified is decimal data, before determining the character string corresponding to the data to be verified, the method further includes:

[0031] An approximate value of the data to be verified is determined, and the data to be verified is updated using the approximate value.

[0032] Furthermore, before determining the character string corresponding to the data to be verified, the method further includes:

[0033] The original data to be verified is obtained, and the original data to be verified is standardized to obtain the data to be verified.

[0034] The present application provides a data verification device, the device comprising:

[0035] A determination module, used to determine the character string corresponding to the data to be verified;

[0036] an encryption module, configured to determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve; if the device itself is a verification device, determine second encrypted data based on a first random number generated by itself, a second random number sent by a data providing device for the data to be verified, and the first encrypted data;

[0037] The verification module is used to determine whether the second encrypted data is consistent with the third encrypted data if the third encrypted data sent by the data providing device is received, and if so, determine that the data to be verified has passed the verification.

[0038] Furthermore, the encryption module is further used to use the first random number to encrypt the data to be verified to obtain fourth encrypted data, and use the fourth encrypted data to update the data to be verified.

[0039] Furthermore, the device also includes:

[0040] A sending module, used for sending the first random number to a data providing device;

[0041] A receiving module, used for receiving a second random number sent by a data providing device;

[0042] The encryption module is further used to use the second random number to encrypt the data to be verified to obtain fifth encrypted data, and use the fifth encrypted data to update the data to be verified.

[0043] Furthermore, the encryption module is also used to obtain the common data of all parties involved in data verification; merge the common data with the second encrypted data to obtain sixth encrypted data, determine a hash value of the sixth encrypted data, and use the hash value to update the second encrypted data.

[0044] Furthermore, the device also includes:

[0045] The sending module is used to send the second encrypted data to the verification device if it is a data providing device.

[0046] Furthermore, the device also includes:

[0047] A generating module, used for generating a third random number;

[0048] The encryption module is further used to use the third random number to encrypt the data to be verified to obtain seventh encrypted data, and use the seventh encrypted data to update the data to be verified.

[0049] Furthermore, the device also includes:

[0050] A sending module, used to send the third random number to a verification device;

[0051] A receiving module, used to receive a fourth random number sent by the verification device;

[0052] The encryption module is further used to use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0053] Furthermore, if the data to be verified is decimal data, the device further includes:

[0054] The determination module is used to determine an approximate value of the data to be verified, and use the approximate value to update the data to be verified.

[0055] Furthermore, the device also includes:

[0056] The acquisition module is used to acquire original data to be verified, and perform standardization processing on the original data to be verified to obtain the data to be verified.

[0057] An embodiment of the present application also provides an electronic device, which includes a processor, and the processor is used to implement the steps of any of the above-mentioned data verification methods when executing a computer program stored in a memory.

[0058] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, which implements the steps of any of the data verification methods described above when executed by a processor.

[0059] An embodiment of the present application also provides a computer program product, which includes: a computer program code, when the computer program code is executed on a computer, the computer executes the steps of any of the above-mentioned data verification methods.

[0060] Because in the embodiment of the present application, during the data verification process, the character string corresponding to the data to be verified is determined, and the first encrypted data corresponding to the character string is determined based on a preset encryption algorithm, wherein the first encrypted data is the data obtained by mapping the hash value of the character string to a point on the elliptic curve, so that other devices cannot obtain the data to be verified based on the first encrypted data. If it is a verification device itself, the second encrypted data is determined according to the first random number generated by itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data; if the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification, thereby avoiding the problem of being able to obtain the data to be verified by exhaustively enumerating hash values, and ensuring the security of the data to be verified during the data verification process. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0062] Figure 1 A schematic diagram of a data verification process provided in an embodiment of the present application;

[0063] Figure 2 A schematic diagram of a process of using random numbers for encryption by a verification device provided in an embodiment of the present application;

[0064] Figure 3A schematic diagram of a process of using random numbers to encrypt a data providing device provided in an embodiment of the present application;

[0065] Figure 4 A schematic diagram of a data verification interaction process provided in an embodiment of the present application;

[0066] Figure 5 A schematic diagram of the structure of a data verification device provided in an embodiment of the present application;

[0067] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0069] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0070] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0071] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0072] In order to ensure computing efficiency and performance, data verification needs to support the completion of verification calculation tasks for more than 10 million pieces of data to be verified within a time requirement of minutes, and be able to protect the original data of all parties from being leaked. In related technologies, methods for data verification generally include: directly calculating hash values, rounding off and then calculating hash values, obfuscated circuit technology routes, homomorphic encryption technology routes, secret sharing technology routes, and other solutions.

[0073] For the scheme of directly calculating hash, although this scheme has the highest performance, it has forward security risks. That is, after the hash of the original data is calculated, it is sent to the other party. Although it is difficult for the other party to directly inverse the hash, it is more sensitive to the errors of floating-point numbers in electronic devices, which can easily reduce the accuracy of system calculations.

[0074] For the scheme of rounding first and then calculating the hash, although the calculation accuracy is improved, the decimal places are removed by rounding, which causes the loss of valid digits of the data, which may easily lead to insufficient valid digits of the data, increase the possibility of inferring the data through the hash value, and reduce the security of the data to be verified.

[0075] For the solution using the obfuscation circuit technology route, this solution relies on both parties to calculate and transmit the obfuscated truth table for each bit of data. The communication volume is extremely large and cannot meet the performance requirements of the business. There are very few implementation cases in related fields.

[0076] For the solution using homomorphic encryption technology, the organization needs to encrypt the full amount of data and send it to the other party's electronic device. This involves the potential risk of ciphertext leaving the domain. Once the key is attacked, all data will be recovered. In addition, computing performance and communication volume cannot meet business requirements.

[0077] For the solution using the secret sharing technology route, in the current latest technology, for the equality verification calculation task, a=b needs to be decomposed into a≥b and a≤b, which requires two operations to be performed, and additional steps such as multiplication triple generation and multiplication secret sharing are required, which brings a large amount of computing performance loss and is not conducive to the promotion and application of this technology.

[0078] After analyzing and summarizing the advantages and disadvantages of the current technical route, this application provides a data verification method, device, equipment and medium. In the embodiment of the present application, the character string corresponding to the data to be verified is determined; the first encrypted data corresponding to the character string is determined based on a preset encryption algorithm, wherein the first encrypted data is the data obtained by mapping the hash value of the character string to a point on the elliptic curve; if it is a verification device itself, the second encrypted data is determined based on the first random number generated by itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data; if the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data, and if so, it is determined that the verification of the data to be verified has passed.

[0079] Embodiment 1:

[0080] Figure 1 A schematic diagram of a data verification process provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the process includes the following steps:

[0081] S101: Determine the character string corresponding to the data to be verified.

[0082] A data verification method provided in an embodiment of the present application is applied to an electronic device, which may be a server, a PC, a smart terminal, etc.

[0083] For the security of data, all enterprises and departments have data security and privacy protection management requirements of "no data leaving the domain", and explore a feasible data verification method, which can not only ensure the efficient operation of data verification, but also effectively protect the data security of all parties from being leaked. In order to solve this problem, in the embodiment of the present application, the data to be verified can be obtained, and the character string corresponding to the data to be verified can be determined.

[0084] The data to be verified may be numerical data, which may include integer, floating point, long floating point, etc. For example, the common data that the regulatory authorities require institutions to report usually include balance, amount, age, quantity of goods, etc. These data are also the key areas where tampering and inaccurate information occur.

[0085] For example, when determining the string corresponding to the data to be verified, the floating point number can be converted into a string based on the str() function. How to convert the data to be verified into a string is a prior art, and the present embodiment of the application will not elaborate on this process.

[0086] S102: Determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve.

[0087] After obtaining the data to be verified and the interference data, the first encrypted data corresponding to the string can be determined based on the preset encryption algorithm. Among them, the first encrypted data is the data obtained by mapping the hash value of the string to a point on the elliptic curve. In order to ensure the smooth progress of subsequent data verification, in an embodiment of the present application, the parties involved in the data verification can negotiate in advance the preset encryption algorithm to be adopted, such as using the same elliptic curve and hash function. Exemplarily, the Curve25519 elliptic curve and the SHA-256 hash function can be used, but other elliptic curves or hash functions can also be selected according to the requirements of the parties.

[0088] Specifically, when determining the first encrypted data corresponding to the string based on the above-mentioned preset encryption algorithm, the string may be hashed to generate a hash value, and then the generated hash value may be mapped to a point on the elliptic curve. In the embodiment of the present application, the coordinates corresponding to the mapped point may be determined as the first encrypted data, or the value after the X-coordinate value and the Y-coordinate value of the coordinate corresponding to the point are calculated as the first encrypted data, wherein the calculation may be addition, subtraction, multiplication, averaging, etc. A person skilled in the art may configure the data format of the first encrypted data as needed.

[0089] It should be noted that if there are multiple data to be verified, the corresponding first encrypted data is determined for each data to be verified. After each first encrypted data is obtained, it can be saved in compressed form (Compressed form) or uncompressed form (Uncompressed form) based on the prior agreement of all parties.

[0090] S103: If the device itself is a verification device, the second encrypted data is determined according to the first random number generated by itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data.

[0091] During the data verification process, the participants include: data providing equipment and verification equipment, wherein in the data verification task, the data providing equipment is used to provide the verification equipment with the data to be verified and the related encrypted data of the data to be verified, and the verification equipment is used to verify whether the data to be verified of each party is consistent in the data verification task.

[0092] In an embodiment of the present application, in order to further ensure the security of the data to be verified during the data verification process, if the electronic device itself is a verification device, the electronic device itself can generate a first random number, and use the first random number to encrypt the first encrypted data again to obtain the second encrypted data. The generated first random number can be a positive integer or a decimal. Exemplarily, a random positive integer can be generated based on a random number generation function, that is, a Rand() function, and the random positive integer is the first random number. Exemplarily, the value range of the generated random positive integer can be 1 to 1×10 11 It should be noted that the technicians in this field can configure the range of random numbers as needed. Here, the interval [1,1×10 11 ] This is for illustration only and is not intended to be limiting.

[0093] It should be noted that if there are multiple data to be verified, when generating the first random number, a first random number may be generated for each data to be verified, or the same first random number may be used when encrypting each data to be verified. In other words, the number of generated first random numbers may be one or more, and when there are multiple first random numbers, the number of first random numbers is consistent with the number of data to be verified.

[0094] In order to ensure that the encrypted data of the same data by all parties is consistent, in an embodiment of the present application, the verification device can obtain the second random number sent by the data providing device of the data to be verified. And determine the second encrypted data based on the first random number generated by itself, the first encrypted data and the second random number. Exemplarily, when the first encrypted data is encrypted using the first random number and the second random number, the second encrypted data can be determined based on the dot multiplication calculation. In other words, the second encrypted data = first random number * second random number * first encrypted data. It should be noted that other types of calculation methods can also be used to determine the second encrypted data.

[0095] S104: If the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data, and if so, it is determined that the verification of the data to be verified is passed.

[0096] In the embodiment of the present application, the verification device can receive the third encrypted data sent by the data providing device, and the third encrypted data is the encrypted data determined by the data providing device according to the character string corresponding to the data to be verified and the preset encryption algorithm, and the data is encrypted based on the encrypted data using the random numbers of the data verification parties. In other words, the process of the data providing device determining the third encrypted data is consistent with the process of the verification device determining the second encrypted data.

[0097] If the electronic device itself is a verification device and receives the third encrypted data sent by the data providing device for verification data, it can determine whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification.

[0098] Specifically, when determining whether the second encrypted data is consistent with the third encrypted data, the electronic device can perform an XOR operation on the second encrypted data and the third encrypted data. If the second encrypted data ⊕ the third encrypted data == 0, it means that the second encrypted data is consistent with the third encrypted data; otherwise, the second encrypted data is inconsistent with the third encrypted data.

[0099] Because in the embodiment of the present application, during the data verification process, the character string corresponding to the data to be verified is determined, and the first encrypted data corresponding to the character string is determined based on a preset encryption algorithm, wherein the first encrypted data is the data obtained by mapping the hash value of the character string to a point on the elliptic curve, so that other devices cannot obtain the data to be verified based on the first encrypted data. If it is a verification device itself, the second encrypted data is determined according to the first random number generated by itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data; if the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification, thereby avoiding the problem of being able to obtain the data to be verified by exhaustively enumerating hash values, and ensuring the security of the data to be verified during the data verification process.

[0100] Embodiment 2:

[0101] In order to further ensure the security of the data to be verified, based on the above embodiment, in the embodiment of the present application, before determining the character string corresponding to the data to be verified, the method further includes:

[0102] The data to be verified is encrypted using the first random number to obtain fourth encrypted data, and the data to be verified is updated using the fourth encrypted data.

[0103] In order to further ensure the security of the data to be verified during the data verification process, before determining the character string corresponding to the data to be verified, the data to be verified can also be encrypted using a first random number to obtain fourth encrypted data, and the fourth encrypted data can be used to update the data to be verified.

[0104] When the first random number is used to encrypt the data to be verified, the sum of the data to be verified and the first random number may be determined as the fourth encrypted data, or the difference between the data to be verified and the first random number may be determined as the fourth encrypted data.

[0105] In order to ensure data synchronization, based on the above embodiments, in the embodiment of the present application, the method includes:

[0106] Sending the first random number to a data providing device;

[0107] Before determining the character string corresponding to the data to be verified, the method further includes:

[0108] The receiving device provides a second random number sent by the data providing device, uses the second random number to encrypt the data to be verified to obtain fifth encrypted data, and uses the fifth encrypted data to update the data to be verified.

[0109] In order to ensure that the devices of all parties involved in data verification use the same data for encryption, in an embodiment of the present application, the verification device can send the generated first random number to the data providing device, so that the data providing device can encrypt the data to be verified according to the received first random number, thereby ensuring data synchronization among all parties during the encryption process.

[0110] Before determining the character string corresponding to the data to be verified, the verification device may also receive a second random number sent by the data providing device, and use the second random number to encrypt the data to be verified to obtain fifth encrypted data, and use the fifth encrypted data to update the data to be verified. In other words, the verification device may use random numbers twice to encrypt the data to be verified, one time to encrypt the data to be verified using the first random number generated by itself, and one time to encrypt the data to be verified encrypted using the first random number using the second random number generated by the data providing device.

[0111] The process of using random numbers for encryption is described below with reference to a specific embodiment. Figure 2 A schematic diagram of a process of encrypting using random numbers by a verification device provided in an embodiment of the present application, such as Figure 2 As shown, the encryption process includes the following steps:

[0112] S201: Generate a first random number r a1 , the data to be verified x1 and the first random number r a1 The difference is determined as the fourth encrypted data x2.

[0113] S202: Receive a second random number r sent by a data providing device b1 , the fourth encrypted data x2 and the second random number r b1 The difference is determined as the fifth encrypted data x3.

[0114] S203: Update the fifth encrypted data x3 as the data to be verified.

[0115] Figure 3A schematic diagram of a process of using random numbers to encrypt a data providing device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the encryption process includes the following steps:

[0116] S301: Generate a second random number r b1 , the data to be verified x1 and the second random number r b1 The difference is determined as the encrypted data x4.

[0117] S302: Receive the first random number r sent by the verification device a1 , the encrypted data x4 and the second random number r a1 The difference is determined as the encrypted data x5.

[0118] At this time, the encrypted data x5 is equal to the fifth encrypted data x3.

[0119] S303: Update the encrypted data x5 to the data to be verified.

[0120] Embodiment 3:

[0121] In order to further ensure the security of the data to be verified, based on the above embodiments, in the embodiment of the present application, after determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the method further includes:

[0122] Obtain the shared data of all parties involved in data verification;

[0123] The shared data is merged with the second encrypted data to obtain sixth encrypted data, a hash value of the sixth encrypted data is determined, and the second encrypted data is updated using the hash value.

[0124] In order to further ensure the security of the data to be verified, in an embodiment of the present application, after determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the common data of the parties to the data verification can be obtained, and the common data can be used to encrypt the data to be verified. The common data can be data pre-configured by the parties involved in the data verification. For example, the parties involved in the data verification include the regulator and the institution. The common data can be the project number corresponding to the data to be verified, or the public keys of both parties. The common data can be numerical data or text data. This common data can be constant. For example, if it is a public key, the common data corresponding to each data to be verified is the same. The common data can also be constantly changing. For example, the common data can be the generation time of the data to be verified, and the common data corresponding to different data to be verified is different.

[0125] After obtaining the shared data, the second encrypted data can be merged with the shared data to obtain the sixth encrypted data. When merging, the second encrypted data and the shared data can be spliced ​​in order to obtain the sixth encrypted data. For example, the data to be verified is "1234" and the shared data is "AA project", then the sixth encrypted data spliced ​​in order is "1234AA project". Of course, when merging, each character in the shared data can be interspersed with the characters in the second encrypted data according to a certain rule, as long as each participant is guaranteed to use the same fusion method for fusion.

[0126] In a possible implementation, if the acquired shared data is numerical data, when the second encrypted data and the shared data are merged, the sum, quotient, difference, product, etc. of the second encrypted data and the shared data can be determined as the sixth encrypted data. Of course, the sixth encrypted data can also be determined by operating the merged data using a certain encryption algorithm.

[0127] In order to facilitate data verification, after obtaining the sixth encrypted data, the hash value of the sixth encrypted data can be determined based on a hash function. A hash function is also called a hash function, which can convert an input of any length into a random number of a fixed length, and has security features such as pseudo-randomness, irreversibility, and anti-collision. Common hash functions include the third generation secure hash algorithm (Secure Hash Algorithm 3, SHA3), SHA256, SM3, etc.

[0128] After the hash value of the sixth encrypted data is obtained, the hash value may be used to update the second encrypted data.

[0129] Embodiment 4:

[0130] In order to ensure data synchronization, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0131] If the device itself is a data providing device, the second encrypted data is sent to the verification device.

[0132] In the embodiment of the present application, the electronic device can be used as a verification device, a data providing device, or both. If the electronic device itself is a data providing device, after determining the second encrypted data, the second encrypted data can be sent to the verification device, so that other verification devices can perform a comparison operation based on the received second encrypted data to determine whether the data is consistent.

[0133] In order to further ensure the security of the data to be verified, based on the above embodiment, in the embodiment of the present application, before determining the character string corresponding to the data to be verified, the method further includes:

[0134] generating a third random number;

[0135] The data to be verified is encrypted using the third random number to obtain seventh encrypted data, and the data to be verified is updated using the seventh encrypted data.

[0136] When the electronic device itself is a data providing device, before determining the character string corresponding to the data to be verified, a third random number can be generated, and the third random number can be used to encrypt the data to be verified to obtain seventh encrypted data, and the seventh encrypted data can be used to update the data to be verified.

[0137] The process of generating the third random number is similar to the process of generating the first random number. When generating the third random number, the process of generating the first random number described in the above embodiment can be referred to, and the embodiments of the present application will not be repeated here.

[0138] When the third random number is used to encrypt the data to be verified, the sum of the data to be verified and the third random number may be determined as the seventh encrypted data, or the difference between the data to be verified and the third random number may be determined as the seventh encrypted data.

[0139] In order to ensure data synchronization, based on the above embodiments, in the embodiment of the present application, after generating the third random number, the method includes:

[0140] Sending the third random number to a verification device;

[0141] Before determining the character string corresponding to the data to be verified, the method further includes:

[0142] Receive a fourth random number sent by the verification device, use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0143] In order to ensure that the devices of all parties involved in data verification use the same data for encryption, the data providing device can send the third random number to the verification device after generating the third random number, so that the verification device can encrypt the data to be verified according to the received third random number, thereby ensuring data synchronization among all parties during the encryption process.

[0144] Before determining the character string corresponding to the data to be verified, the data providing device may also receive the fourth random number sent by the verification device, and use the fourth random number to encrypt the data to be verified to obtain the eighth encrypted data, and use the eighth encrypted data to update the data to be verified. In other words, the data providing device may use random numbers twice to encrypt the data to be verified, once using the third random number generated by itself to encrypt the data to be verified, and once using the fourth random number generated by the verification device to encrypt the data to be verified encrypted using the third random number.

[0145] Embodiment 5:

[0146] In order to improve the accuracy of data verification, based on the above embodiment, in the embodiment of the present application, if the data to be verified is decimal data, before determining the character string corresponding to the data to be verified, the method further includes:

[0147] An approximate value of the data to be verified is determined, and the data to be verified is updated using the approximate value.

[0148] Due to the different precision and encoding methods of different electronic devices, the same floating point number may have different significant figures after the decimal point on different electronic devices. For example, 0.1 may be 0.1112548847 on electronic device A, and 0.1111528 on electronic device B. In other words, the technician believes that both electronic devices process 0.1, but the significant figures after the decimal point are different when the electronic device processes the value. Then, the hash values ​​determined based on different values ​​must be different. However, the "difference" here is caused by the different precision and encoding methods of the electronic device. Therefore, in order to improve the accuracy of data verification, in the embodiment of the present application, if the data to be verified is decimal data, before determining the string corresponding to the data to be verified, the approximate value of the data to be verified can also be determined. For example, the floating point data to be verified is rounded to retain a fixed number of decimal places. For example, only 4 significant figures are retained after the decimal point. It should be noted that the number of decimal places can be configured by technicians in this field according to the actual scenario needs, and the embodiment of the present application does not limit this.

[0149] After obtaining the approximate value of the data to be verified, the approximate value can be used to update the data to be verified.

[0150] Embodiment 6:

[0151] In order to further improve the accuracy of data verification, based on the above embodiment, in the embodiment of the present application, before determining the character string corresponding to the data to be verified, the method further includes:

[0152] The original data to be verified is obtained, and the original data to be verified is standardized to obtain the data to be verified.

[0153] In order to ensure that the data to be verified by each electronic device participating in the data verification is consistent, in the embodiment of the present application, before determining the character string corresponding to the data to be verified, the original data to be verified can be obtained and the original data to be verified can be standardized, and the standardized original data to be verified can be used as the data to be verified. Among them, the standardization process can be the conversion of the data type or the conversion of the data encoding type, which is not limited in the embodiment of the present application.

[0154] Specifically, after obtaining the original data to be verified, both the verification device and the data providing device can convert the integer value into a floating point value, where each value is encoded according to the F64 or other encoding rules. It should be noted that those skilled in the art can configure the floating point encoding rules as needed, not limited to F64.

[0155] Embodiment 7:

[0156] This application is based on a privacy calculation numerical data equality verification calculation scheme based on cryptographic technologies such as random number generation, random number splitting and merging, approximate processing, Hash-to-Point, elliptic curve point multiplication, and hash calculation. The data verification process is described below in conjunction with a specific embodiment. In the embodiment of this application, the roles of the participants in data verification are first introduced, and then the operation process of data verification is introduced in detail.

[0157] It should be noted that the embodiments of this application only take the regulatory end and the institutional end as examples, and other institutions suitable for the verification scenario are also applicable to the data verification method provided in the embodiments of this application. In the embodiments of this application, the regulatory party is referred to as the regulatory end, and the regulated party is referred to as the institutional end.

[0158] Supervision: Industry regulatory authorities have the authority to collect business and operation-related data from commercial organizations under their jurisdiction for use in regulatory work.

[0159] Institutional side: Enterprises or relevant institutions in the corresponding fields are obliged to submit business data, operating data, detailed data, etc. to the regulatory authorities and accept supervision and management by the regulatory authorities.

[0160] Based on the basic architecture requirements of privacy computing, the regulatory side and the institutional side each deploy privacy computing nodes, such as electronic devices specifically used for privacy verification. In the embodiment of this application, the electronic devices deployed by the regulatory side are called verification devices, and the electronic devices deployed by the institutional side are called data providing devices. The electronic devices of both parties are connected to the network, calculate and exchange the intermediate results of privacy computing, and finally the calculation results are obtained by the result acquirer.

[0161] In an embodiment of the present application, the regulatory end needs to prepare the "reporting data" that has been collected and stored by itself, and the institutional end needs to prepare its "production data", where both the reporting data and the production data are in numerical format, and the sample order has achieved sample alignment through previous privacy intersection, sample alignment and other technologies.

[0162] The brief process of numerical verification includes major steps such as data reading and writing, random number generation, random number merging, approximate calculation, hash value calculation, and equality verification. Each process involves the regulatory end and the institutional end processing and calculating the data to be verified, and the intermediate results of the calculation process need to be communicated. Finally, the verification result is obtained by the result acquirer.

[0163] Figure 4 A schematic diagram of a data verification interaction process provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the devices involved in data verification include verification devices and data providing devices.

[0164] The data providing device sends the data to be verified S′ B ={b′1,b′2,…,b′ n The verification device stores the received data to be verified in the memory, which is recorded as S′. A ={a′1,a′2,…,a′ n}. Among them, the data to be verified are a′1, a′2,…, a′ n and the data to be verified b′1, b′2, …, b′ n The same data is just represented differently on different electronic devices. n and the data to be verified b′1, b′2, …, b′ n The data encoding format is the same and is standardized.

[0165] The verification equipment uses the rounding method to approximate S′ A ={a′1,a′2,…,a′ n} to obtain S A ={a1,a2,…,a n The data providing device rounds off the approximate value of S′. B ={b′1,b′2,…,b′ n} to obtain S B ={b1,b2,…,b n}.

[0166] The verification device generates the first random number for each data to be verified, and the first random number sequence obtained is recorded as Rand A = {ra1 ,…,r an}, where r a1 represents the first random number corresponding to the data to be verified a1, r an Indicates data to be verified a n The data providing device generates a second random number for each data to be verified, and obtains a second random number sequence, which is recorded as Rand B = {r b1 ,…,r bn}, where r b1 represents the second random number corresponding to the data to be verified b1, r bn Indicates data to be verified b n The corresponding second random number.

[0167] Each device performs random number splitting calculation. That is, the random number is used to encrypt the data to be verified to obtain encrypted data. The first random number sequence Rand calculated by the verification device A = {r a1 ,…,r an} and the data to be verified S saved by itself A ={a1,a2,…,a n}, perform the split operation to obtain the split data set SP A = {sp a1 ,…,sp an}. Among them, sp a1 , sp an Indicates encrypted data. a1 =a1-r a1 , sp an =a n -r an The data providing device calculates and obtains the second random number sequence Rand B = {r b1 ,…,r bn} and the data to be verified S saved by itself B ={b1,b2,…,b n}, perform the split operation to obtain the split data set SP B = {sp b1 ,…,sp bn}. Among them, sp b1 , sp bn Indicates encrypted data. b1 =b1-r b1 , sp bn =b n -r bn .

[0168] It should be noted that the split calculation here is a floating-point operation under the floating-point encoding rules, not a bit-by-bit operation after data bit expansion, that is, there is no additional step of expanding the data bits and calculating each bit.

[0169] The verification device will generate each first random number Rand A = {r a1 ,…,r an} is sent to the data providing device, and the data providing device generates each second random number Rand B = {r b1 ,…,r bn The original order of random numbers 1 to n is not changed during the sending process.

[0170] Data merging. The verification device receives the second random number Rand B = {r b1 ,…,r bn} and the resulting split data set SP A = {sp a1 ,…,sp an} is encrypted again to obtain MP A ={mp a1 ,…,mp an}, where mp a1 , mp an Indicates the encrypted data after merging. a1 =sp a1 -r b1 , mp an =sp an -r bn The data providing device receives the first random number Rand A = {r a1 ,…,r an} and the resulting split data set SP B = {sp b1 ,…,sp bn} is encrypted again to obtain MP B ={mp b1 ,…,mp bn}, where mp b1 , mp bn Indicates the encrypted data after merging. b1 =sp b1 -r a1 , mp bn =sp bn -r an .

[0171] It should be noted that the combined calculation here is also a floating-point operation under the floating-point encoding rules, and is not a bit-by-bit operation after data bit expansion. That is, there is no additional step of expanding the data bits and calculating each bit.

[0172] Convert to a string. Verify that the device has the merged data set MP calculated in the previous step. A ={mp a1 ,…,mp an}, convert the floating point number into a string by using a function similar to str() to get STR A ={str a1 ,…,str an The data provider calculates the combined data set MP obtained in the previous step. B ={mp b1 ,…,mp bn}, convert the floating point number into a string by using a function similar to str() to get STR B ={str b1 ,…,str bn}.

[0173] Elliptic curve point mapping. Verify that the device is calculating the string data set STR obtained in the previous step. A ={str a1 ,…,str an}, first perform hash calculation, then map to different points on the elliptic curve, use the standard HashtoPoint algorithm in the elliptic curve to get P A ={p a1 ,…,p an The calculation result is a point on the elliptic curve. Both parties can agree to use compressed form or uncompressed form. Using the same method, the data provider calculates the string data set STR obtained in the previous step. B ={str b1 ,…,str bn}, calculate and output the point on the elliptic curve corresponding to each string, and the result is in the compressed form or uncompressed form agreed by both parties, and obtain P B ={p b1 ,…,p bn}.

[0174] Point multiplication calculation. Verify that the device calculates the elliptic curve point data set P obtained in the previous step. A ={p a1 ,…,p an}, and perform point multiplication with the random positive integers generated by both parties to generate a new elliptic curve point. Similarly, the result is in compressed form (Compressed form) or uncompressed form (uncompressed form) agreed by both parties to obtain PP A ={pp a1 ,…,pp an Using the same method, the data provider calculates the ellipse point dataset P obtained in the previous step. B ={p b1 ,…,p bn}, calculate and output the point on the elliptic curve corresponding to each string, and the result is in the compressed form or uncompressed form agreed by both parties to obtain PP B ={pp b1 ,…,pp bn}.

[0175] Hash calculation. The verification device calculates the PP obtained in the previous step. A ={pp a1 ,…,pp an After each elliptic curve point in} is merged with the common data Salt, the hash value is calculated to obtain HP A ={hp a1 ,…,hp an}. Among them, hp a1 For bin a1 Hash value after fusion with Salt, hp an For bin an The hash value after merging with Salt. The data provider takes the PP calculated in the previous step B ={pp b1 ,…,pp bn After each elliptic curve point in} is merged with the common data Salt, the hash value is calculated to obtain HP B ={hp b1 ,…,hp bn}. Among them, hp b1 For bin b1 Hash value after fusion with Salt, hp bn For bin bn The hash value after merging with Salt.

[0176] The data provider calculates the HP B ={hp b1 ,…,hp bn}Sent to the verification device.

[0177] The verification device sends its own hash calculation result HP A ={hp a1,…,hp an} and received HP B ={hp b1 ,…,hp bn}, perform equal verification one by one and obtain the verification result.

[0178] Based on the above process, when the data to be verified a i With the data to be verified b i When they are equal, we can know that:

[0179] mp ai =sp ai -r bi =a i -r ai -r bi =b i -r ai -r bi =sp bi -r ai =mp bi , therefore, the result of Hash-to-Point p ai =p bi , the result of the dot product is pp ai =r ai ·r bi ·p ai =r ai ·r bi ·p bi =pp bi , then we know that hp ai =hp bi , on the contrary hp ai ≠hp bi .

[0180] Due to the irreversibility of hash functions, the difficulty of Hash to point, the difficulty of elliptic curve point multiplication, and the uniform randomness of random splitting by both parties, the two parties cannot infer the intermediate result mp through the hash value. ai and mp bi , and reduces the possibility of exhaustive hash values. The above security features can ensure the security and privacy of this solution and ensure business compliance to the greatest extent.

[0181] In a possible implementation, the communication between the two parties can use public key encryption, transport layer security protocol and its predecessor Secure Sockets Layer (SSL) network security encryption to encrypt the communication content before transmission, and the recipient can decrypt it after receiving it and complete other operations.

[0182] In addition, the original input data and verification result data of the electronic device can be stored on disk. When performing any calculation processing, it can be performed only in memory without storing on disk. After the calculation task is completed, it will be cleared from the memory to avoid security issues.

[0183] The embodiment of this application provides a privacy calculation numerical data equality verification calculation scheme based on cryptographic technologies such as random number generation, random number splitting and merging, approximate processing, Hash-to-Point, elliptic curve point multiplication, hash calculation, etc., which is simple in structure, high in performance, and strong in security. Compared with the technology of directly using hash functions for numerical processing and equality verification, this scheme does not have forward security risks, does not have the risk of collecting samples first and then deciphering, and is more secure.

[0184] It can support flexible configuration of data formats and approximate equality, and has strong functionality. It does not rely on complex cryptographic algorithms such as homomorphic encryption, obfuscated circuits, oblivious transmission, zero-knowledge proof, multiplication triples, and does not require operations such as bit-level XOR operations. It only requires conventional floating-point operations, which is efficient and concise. Compared with solutions that use complex cryptographic technologies such as oblivious transmission, obfuscated circuits, and homomorphic encryption, this solution is simple in design, high in performance, and has higher flexibility. Compared with traditional secret sharing technology, this solution has higher performance and does not introduce additional errors.

[0185] In addition, the data verification method provided in this application can support functions such as approximate data verification, difficulty in reverse inference, and high precision, which improves the scenario adaptability of the solution and is more conducive to the accuracy and security of the regulatory authorities' verification calculations of the authenticity of the regulatory data of the companies under their jurisdiction.

[0186] In summary, the data verification method provided in this application is a high-performance, high-security, and high-flexibility numerical data equality privacy verification solution. It has extremely high performance and privacy, can comply with regulatory policies to the greatest extent, and has high technical and application value.

[0187] Embodiment 8:

[0188] Based on the same inventive concept, the embodiment of the present application provides a data verification device. Figure 5 For a schematic diagram of a data verification device structure provided in an embodiment of the present application, please refer to Figure 5 , the device comprises:

[0189] Determination module 501, used to determine the character string corresponding to the data to be verified;

[0190] The encryption module 502 is used to determine the first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping the hash value of the string to a point on an elliptic curve; if the device itself is a verification device, the second encrypted data is determined according to the first random number generated by itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data;

[0191] The verification module 503 is used to determine whether the second encrypted data is consistent with the third encrypted data if the third encrypted data sent by the data providing device is received, and if so, determine that the data to be verified has passed the verification.

[0192] In a possible implementation, the encryption module 502 is further configured to use the first random number to encrypt the data to be verified to obtain fourth encrypted data, and use the fourth encrypted data to update the data to be verified.

[0193] In a possible implementation, the device further includes:

[0194] A sending module 504, configured to send the first random number to a data providing device;

[0195] A receiving module 505, configured to receive a second random number sent by a data providing device;

[0196] The encryption module 502 is further configured to use the second random number to encrypt the data to be verified to obtain fifth encrypted data, and use the fifth encrypted data to update the data to be verified.

[0197] In a possible implementation, the encryption module 502 is also used to obtain the common data of the data verification parties; merge the common data with the second encrypted data to obtain sixth encrypted data, determine the hash value of the sixth encrypted data, and use the hash value to update the second encrypted data.

[0198] In a possible implementation, the device further includes:

[0199] The sending module 504 is used to send the second encrypted data to the verification device if it is a data providing device.

[0200] In a possible implementation, the device further includes:

[0201] A generating module 506, configured to generate a third random number;

[0202] The encryption module 502 is further configured to use the third random number to encrypt the data to be verified to obtain seventh encrypted data, and use the seventh encrypted data to update the data to be verified.

[0203] In a possible implementation, the device further includes:

[0204] A sending module 504, configured to send the third random number to a verification device;

[0205] A receiving module 505, configured to receive a fourth random number sent by the verification device;

[0206] The encryption module 502 is further configured to use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0207] In a possible implementation manner, if the data to be verified is decimal data, the determination module 501 is further configured to determine an approximate value of the data to be verified, and use the approximate value to update the data to be verified.

[0208] In a possible implementation, the device further includes:

[0209] The acquisition module 507 is used to acquire original data to be verified and perform standardization processing on the original data to be verified to obtain the data to be verified.

[0210] Embodiment 9:

[0211] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which can implement the steps of the data verification method discussed above. Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, it includes: a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;

[0212] The memory 603 stores a computer program. When the program is executed by the processor 601, the processor 601 performs the following steps:

[0213] Determine the character string corresponding to the data to be verified;

[0214] Determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve;

[0215] If the device itself is a verification device, the second encrypted data is determined according to the first random number generated by the device itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data;

[0216] If the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification.

[0217] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0218] The data to be verified is encrypted using the first random number to obtain fourth encrypted data, and the data to be verified is updated using the fourth encrypted data.

[0219] In one possible implementation, the method includes:

[0220] Sending the first random number to a data providing device;

[0221] Before determining the character string corresponding to the data to be verified, the method further includes:

[0222] The receiving device provides a second random number sent by the data providing device, uses the second random number to encrypt the data to be verified to obtain fifth encrypted data, and uses the fifth encrypted data to update the data to be verified.

[0223] In a possible implementation manner, after determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the method further includes:

[0224] Obtain the shared data of all parties involved in data verification;

[0225] The shared data is merged with the second encrypted data to obtain sixth encrypted data, a hash value of the sixth encrypted data is determined, and the second encrypted data is updated using the hash value.

[0226] In a possible implementation, the method further includes:

[0227] If the device itself is a data providing device, the second encrypted data is sent to the verification device.

[0228] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0229] generating a third random number;

[0230] The data to be verified is encrypted using the third random number to obtain seventh encrypted data, and the data to be verified is updated using the seventh encrypted data.

[0231] In a possible implementation, after generating the third random number, the method includes:

[0232] Sending the third random number to a verification device;

[0233] Before determining the character string corresponding to the data to be verified, the method further includes:

[0234] Receive a fourth random number sent by the verification device, use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0235] In a possible implementation manner, if the data to be verified is decimal data, before determining the character string corresponding to the data to be verified, the method further includes:

[0236] An approximate value of the data to be verified is determined, and the data to be verified is updated using the approximate value.

[0237] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0238] The original data to be verified is obtained, and the original data to be verified is standardized to obtain the data to be verified.

[0239] Since the principle of solving the problem by the above electronic device is similar to the data verification method, the implementation of the above electronic device can refer to the embodiment of the method, and the repeated parts will not be repeated.

[0240] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 602 is used for communication between the above electronic device and other devices. The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0241] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0242] Embodiment 10:

[0243] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:

[0244] Determine the character string corresponding to the data to be verified;

[0245] Determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve;

[0246] If the device itself is a verification device, the second encrypted data is determined according to the first random number generated by the device itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data;

[0247] If the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification.

[0248] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0249] The data to be verified is encrypted using the first random number to obtain fourth encrypted data, and the data to be verified is updated using the fourth encrypted data.

[0250] In one possible implementation, the method includes:

[0251] Sending the first random number to a data providing device;

[0252] Before determining the character string corresponding to the data to be verified, the method further includes:

[0253] The receiving device provides a second random number sent by the data providing device, uses the second random number to encrypt the data to be verified to obtain fifth encrypted data, and uses the fifth encrypted data to update the data to be verified.

[0254] In a possible implementation manner, after determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the method further includes:

[0255] Obtain the shared data of all parties involved in data verification;

[0256] The shared data is merged with the second encrypted data to obtain sixth encrypted data, a hash value of the sixth encrypted data is determined, and the second encrypted data is updated using the hash value.

[0257] In a possible implementation, the method further includes:

[0258] If the device itself is a data providing device, the second encrypted data is sent to the verification device.

[0259] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0260] generating a third random number;

[0261] The data to be verified is encrypted using the third random number to obtain seventh encrypted data, and the data to be verified is updated using the seventh encrypted data.

[0262] In a possible implementation, after generating the third random number, the method includes:

[0263] Sending the third random number to a verification device;

[0264] Before determining the character string corresponding to the data to be verified, the method further includes:

[0265] Receive a fourth random number sent by the verification device, use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

[0266] In a possible implementation manner, if the data to be verified is decimal data, before determining the character string corresponding to the data to be verified, the method further includes:

[0267] An approximate value of the data to be verified is determined, and the data to be verified is updated using the approximate value.

[0268] In a possible implementation manner, before determining the character string corresponding to the data to be verified, the method further includes:

[0269] The original data to be verified is obtained, and the original data to be verified is standardized to obtain the data to be verified.

[0270] Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the data verification method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0271] Embodiment 11:

[0272] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the data verification methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the data verification method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0273] In an embodiment of the present application, during the data verification process, a character string corresponding to the data to be verified is determined, and first encrypted data corresponding to the character string is determined based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the character string to a point on an elliptic curve, so that other devices cannot obtain the data to be verified based on the first encrypted data. If it is a verification device itself, the second encrypted data is determined based on a first random number generated by itself, a second random number sent by a data provider of the data to be verified, and the first encrypted data; if the third encrypted data sent by the data provider is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification, thereby avoiding the problem of being able to obtain the data to be verified by exhaustively enumerating hash values, and ensuring the security of the data to be verified during the data verification process.

[0274] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0275] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0276] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0277] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of user-operated steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0278] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data verification method, characterized in that: The method comprises: Determine the character string corresponding to the data to be verified; Determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve; If the device itself is a verification device, the second encrypted data is determined according to the first random number generated by the device itself, the second random number sent by the data providing device of the data to be verified, and the first encrypted data; If the third encrypted data sent by the data providing device is received, it is determined whether the second encrypted data is consistent with the third encrypted data. If so, it is determined that the data to be verified has passed the verification.

2. The method according to claim 1, characterized in that: Before determining the character string corresponding to the data to be verified, the method further includes: The data to be verified is encrypted using the first random number to obtain fourth encrypted data, and the data to be verified is updated using the fourth encrypted data.

3. The method according to claim 2, characterized in that The method comprises: Sending the first random number to a data providing device; Before determining the character string corresponding to the data to be verified, the method further includes: The receiving device provides a second random number sent by the data providing device, uses the second random number to encrypt the data to be verified to obtain fifth encrypted data, and uses the fifth encrypted data to update the data to be verified.

4. The method according to claim 1, characterized in that After determining the second encrypted data and before receiving the third encrypted data sent by the data providing device, the method further includes: Obtain the shared data of all parties involved in data verification; The shared data is merged with the second encrypted data to obtain sixth encrypted data, a hash value of the sixth encrypted data is determined, and the second encrypted data is updated using the hash value.

5. The method according to claim 1, characterized in that: The method further comprises: If the device itself is a data providing device, the second encrypted data is sent to the verification device.

6. The method according to claim 5, characterized in that Before determining the character string corresponding to the data to be verified, the method further includes: generating a third random number; The data to be verified is encrypted using the third random number to obtain seventh encrypted data, and the data to be verified is updated using the seventh encrypted data.

7. The method according to claim 6, characterized in that After generating the third random number, the method includes: Sending the third random number to a verification device; Before determining the character string corresponding to the data to be verified, the method further includes: Receive a fourth random number sent by the verification device, use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

8. The method according to claim 1 or 5, characterized in that: If the data to be verified is decimal data, before determining the character string corresponding to the data to be verified, the method further includes: An approximate value of the data to be verified is determined, and the data to be verified is updated using the approximate value.

9. The method according to claim 1 or 5, characterized in that: Before determining the character string corresponding to the data to be verified, the method further includes: The original data to be verified is obtained, and the original data to be verified is standardized to obtain the data to be verified.

10. A data verification device, characterized in that: The device comprises: A determination module, used to determine the character string corresponding to the data to be verified; an encryption module, configured to determine first encrypted data corresponding to the string based on a preset encryption algorithm, wherein the first encrypted data is data obtained by mapping a hash value of the string to a point on an elliptic curve; if the device itself is a verification device, determine second encrypted data based on a first random number generated by itself, a second random number sent by a data providing device for the data to be verified, and the first encrypted data; The verification module is used to determine whether the second encrypted data is consistent with the third encrypted data if the third encrypted data sent by the data providing device is received, and if so, determine that the data to be verified has passed the verification.

11. The device according to claim 10, characterized in that The encryption module is further used to use the first random number to encrypt the data to be verified to obtain fourth encrypted data, and use the fourth encrypted data to update the data to be verified.

12. The device according to claim 11, characterized in that The device also includes: A sending module, used for sending the first random number to a data providing device; A receiving module, used for receiving a second random number sent by a data providing device; The encryption module is further used to use the second random number to encrypt the data to be verified to obtain fifth encrypted data, and use the fifth encrypted data to update the data to be verified.

13. The device according to claim 10, characterized in that The encryption module is also used to obtain the common data of all parties involved in data verification; merge the common data with the second encrypted data to obtain sixth encrypted data, determine the hash value of the sixth encrypted data, and use the hash value to update the second encrypted data.

14. The device according to claim 10, characterized in that The device also includes: The sending module is used to send the second encrypted data to the verification device if it is a data providing device.

15. The device according to claim 14, characterized in that The device also includes: A generating module, used for generating a third random number; The encryption module is further used to use the third random number to encrypt the data to be verified to obtain seventh encrypted data, and use the seventh encrypted data to update the data to be verified.

16. The device according to claim 15, characterized in that The device also includes: A sending module, used to send the third random number to a verification device; A receiving module, used to receive a fourth random number sent by the verification device; The encryption module is further used to use the fourth random number to encrypt the data to be verified to obtain eighth encrypted data, and use the eighth encrypted data to update the data to be verified.

17. The device according to claim 10 or 14, characterized in that If the data to be verified is decimal data, the device further includes: The determination module is used to determine an approximate value of the data to be verified, and use the approximate value to update the data to be verified.

18. The device according to claim 10 or 14, characterized in that The device also includes: The acquisition module is used to acquire original data to be verified, and perform standardization processing on the original data to be verified to obtain the data to be verified.

19. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to implement the steps of the data verification method as claimed in any one of claims 1 to 9 when executing a computer program stored in a memory.

20. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the data verification method as described in any one of claims 1 to 9.

21. A computer program product, characterized in that The computer program product comprises: a computer program code, which, when executed on a computer, enables the computer to execute the steps of the data verification method as claimed in any one of claims 1 to 9.