WO2020181822A1 - 加密数据一致性校验方法、装置、计算机设备及存储介质 - Google Patents

加密数据一致性校验方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020181822A1
WO2020181822A1 PCT/CN2019/118457 CN2019118457W WO2020181822A1 WO 2020181822 A1 WO2020181822 A1 WO 2020181822A1 CN 2019118457 W CN2019118457 W CN 2019118457W WO 2020181822 A1 WO2020181822 A1 WO 2020181822A1
Authority
WO
WIPO (PCT)
Prior art keywords
encrypted data
sets
public key
hash value
verifying
Prior art date
Application number
PCT/CN2019/118457
Other languages
English (en)
French (fr)
Inventor
谢丹力
张文明
贾牧
陆一帆
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020181822A1 publication Critical patent/WO2020181822A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6272Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database by registering files or documents with a third party

Definitions

  • This application relates to the technical field of data verification, and in particular to a method, device, computer equipment, and computer-readable storage medium for verifying the consistency of encrypted data.
  • the embodiments of the present application provide a method, device, computer equipment, and computer-readable storage medium for verifying the consistency of encrypted data, which can solve the problem of low efficiency of verifying the consistency of encrypted data in the traditional technology.
  • an embodiment of the present application provides a method for verifying the consistency of encrypted data.
  • the method includes: obtaining two sets of encrypted data separately described using a preset curve; according to the respective curve descriptions of the two sets of encrypted data, Obtain the private key and the public key for verifying the two sets of encrypted data according to preset rules; generate two sets of hash values of the encrypted data based on the two sets of encrypted data; use the private key to verify the It is desirable to sign and use the public key to verify the hash value; determine whether the public key verifies the hash value or not; if the public key verifies the hash value If passed, it is determined that the two sets of encrypted data are consistent; if the public key fails to verify the hash value, it is determined that the two sets of encrypted data are inconsistent.
  • an embodiment of the present application also provides a device for verifying the consistency of encrypted data, wherein the device includes: a first acquiring unit configured to acquire two sets of encrypted data separately described using a preset curve; and second The obtaining unit is used to obtain the private key and the public key for verifying the two groups of encrypted data according to the respective curve descriptions of the two groups of encrypted data; The data generates two sets of hash values of the encrypted data; a verification unit for signing the hash value using the private key and verifying the hash value using the public key; judging unit , Used to determine whether the public key has passed the verification of the hash value; the determining unit is used to determine whether the two sets of encrypted data are consistent if the public key has passed the verification of the hash value, if The public key fails to verify the hash value, and it is determined that the two sets of encrypted data are inconsistent.
  • an embodiment of the present application also provides a computer device, which includes a memory and a processor, the memory is stored with a computer program, and the processor implements the encrypted data consistency check when the computer program is executed. ⁇ Test methods.
  • an embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the encrypted data Consistency verification method.
  • FIG. 1 is a schematic diagram of an application scenario of a method for verifying consistency of encrypted data provided by an embodiment of the application;
  • FIG. 2 is a schematic flowchart of a method for verifying consistency of encrypted data provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of another process of the method for verifying the consistency of encrypted data provided by an embodiment of the application;
  • FIG. 4 is a schematic block diagram of an encrypted data consistency verification device provided by an embodiment of the application.
  • FIG. 5 is another schematic block diagram of an encrypted data consistency verification device provided by an embodiment of the application.
  • Fig. 6 is a schematic block diagram of a computer device provided by an embodiment of the application.
  • FIG. 1 is a schematic diagram of an application scenario of a method for verifying consistency of encrypted data provided by an embodiment of the application.
  • the application scenarios include: (1) Blockchain.
  • the embodiment of the application is based on the consistency check of the encrypted data of the blockchain.
  • the blockchain includes multiple nodes, and each node corresponds to an organization (ORG) in the blockchain. Since each node belongs to an organization, each node stores all the data on the blockchain, that is, every A node not only stores the data of its own organization, but also the data of other nodes in the blockchain. There is no difference between the nodes, but the corresponding institutions are different, and the names are different, for example, bank 1 node corresponds to bank 1, bank 2 node corresponds to bank 2, and so on. (2) Each node.
  • Each node in the block corresponds to each unit and belongs to the main object in the blockchain.
  • bank 1 node corresponds to bank 1
  • bank 2 node corresponds to bank 2
  • enterprise 1 node corresponds to enterprise 1
  • enterprise 2 node corresponds to enterprise 2.
  • Each entity puts its own data on the chain to realize data sharing in the blockchain.
  • Bank node 1 obtains two sets of encrypted data separately described using a preset curve, of which, one set The encrypted data is the loan amount of bank 1 to enterprise 1, and the other group of data is enterprise 1’s order for the core enterprise that makes loans to bank 1.
  • Bank node 1 describes the respective curves of the two groups of encrypted data according to the preset
  • the rules obtain the private key and the public key for verifying the two sets of encrypted data, generate two sets of hash values of the encrypted data based on the two sets of encrypted data, and use the private key to perform the hash value Sign and use the public key to verify the hash value, and determine whether the public key verifies the hash value; if the public key verifies the hash value, it is determined The two sets of encrypted data are consistent. If the public key fails to verify the hash value, it is determined that the two sets of encrypted data are inconsistent.
  • FIG. 2 is a schematic flowchart of a method for verifying the consistency of encrypted data provided by an embodiment of the application.
  • This encrypted data consistency verification method can be applied to each node in FIG. 1 to complete all or part of the functions of the encrypted data consistency verification method.
  • FIG. 2 is a schematic flowchart of a method for verifying consistency of encrypted data provided by an embodiment of the present application. As shown in Figure 2, the method includes the following steps S210-S270:
  • the embodiment of the present application provides a method for verifying whether two sets of encrypted data are consistent, which may also be referred to as a method for verifying whether two sets of encrypted data are equal.
  • a method for verifying whether two sets of encrypted data are equal For example, in actual business, to determine whether the data a and b in the two business lines on the blockchain are equal, obtain the encrypted data A containing a and the encrypted data B containing the data b, and judge by the encrypted data A and B Whether the data a and b are equal, so as to realize whether the data a and b are equal without decrypting the encrypted data A and B.
  • two business lines are included, one of which contains data a1, a2, and a3, and the other business line contains data b1, b2, and b3, obtain encrypted data containing a1, a2, and a3 A1 and the encrypted data B1 containing data b1, b2, and b3, by judging the encrypted data A1 and B1, determine whether the sum of data a1, a2, and a3 is equal to the sum of b1, b2, and b3, so as not to decrypt the encrypted data A1 and B1 It can be judged whether the sum of data a1, a2, and a3 is equal to the sum of b1, b2, and b3.
  • FIG. 3 is a schematic diagram of another flow chart of the method for verifying the consistency of encrypted data provided by an embodiment of the application. As shown in FIG. 3, the acquisition of two sets of encrypted data separately described by using a preset curve Before the steps, also include:
  • the Perdesen Commitment format in cryptography may be used to represent the encrypted data
  • the ECC elliptic curve may be used to describe the encrypted data.
  • the elliptic curve encryption method English is Elliptic Curve Cryptography, abbreviated as ECC.
  • Elliptic Curve Cryptography (ECC) is a public key encryption technology based on elliptic curve theory, which can be faster, smaller, and more effective when creating keys. ECC uses the properties of the elliptic curve equation to generate keys.
  • the current second-generation ID cards of Chinese residents use 256-bit elliptic curve passwords.
  • the P256 curve is also called the secp256r1 curve.
  • Elliptic curve encryption algorithm also includes P224 curve, P384 curve and P512 curve.
  • upstream manufacturers use orders from core companies to make loans, and after banks issue loans, they need to be on the blockchain Verify that the amount of the bank loan is consistent with the amount of the order. Since the data on the blockchain is encrypted data, the encrypted data of the upstream manufacturer's order is A, which contains the order amount a, and the encrypted data of the bank loan is B, which contains the loan amount as b. The encrypted data must be judged Whether a and b in A and B are equal data.
  • h is the private key
  • h is an integer smaller than n (n is the order of point G)
  • h is called private Private key
  • H is called public key
  • English Public Key
  • SM2 supports P-256, P-384, P-521 elliptic curves, and realizes the generation and verification of software authorization codes based on elliptic curve encryption algorithms.
  • S220 Acquire a private key and a public key for verifying the two groups of encrypted data according to the respective curve descriptions of the two groups of encrypted data according to a preset rule.
  • the preset rule means that the difference between the blind factors of the two sets of curves is used as the private key to provide a signature to the blockchain, and the difference between the two sets of curves is the public key to verify the data of the blockchain.
  • obtaining the private key and public key for verifying the two sets of encrypted data according to preset rules refers to subtracting the blind factors in the two sets of curves to obtain The private keys for verifying the two sets of encrypted data are subtracted from the two sets of curves to obtain the public keys for verifying the two sets of encrypted data.
  • a and B are encrypted data, respectively, a and b are data to be verified whether they are the same, G is the base point, and x1 and x2 are blind factors.
  • h is the private key
  • H and G are points on the elliptic curve Ep(a, b)
  • h is an integer smaller than n (n is the order of point G)
  • h is called private
  • H is called the public key (Public Key).
  • the blind factors in the two sets of encrypted data curves are subtracted to obtain the private keys for verifying the two sets of encrypted data, and the two sets of curves are subtracted to obtain the two sets of encrypted data.
  • the public key for verification is the secret key for verification.
  • S230 Generate two sets of hash values of the encrypted data based on the two sets of encrypted data.
  • generating the hash values of the two sets of encrypted data based on the two sets of encrypted data refers to merging the two sets of encrypted data to obtain the merged encrypted data, and hashing the merged encrypted data
  • the secondary node is the node in the blockchain that needs to verify whether the two sets of data are equal.
  • S240 Use the private key to sign the hash value and use the public key to verify the hash value; S250, determine whether the public key verifies the hash value or not; S260. If the public key passes the hash value verification, determine that the two sets of encrypted data are consistent; S270. If the public key fails the hash value verification, determine the two sets of encryption The data is inconsistent.
  • the private key is used to sign the hash value and the public key is used to verify the hash value, and it is determined whether the public key verifies the hash value, if The public key passes the hash value verification and determines that the two sets of encrypted data are consistent. If the public key fails the hash value verification, it is determined that the two sets of encrypted data are inconsistent.
  • a and B are encrypted data, respectively, a and b are data to be verified whether they are the same, G is the base point, and x1 and x2 are blind factors.
  • H is called the public key (public key).
  • the public key passes the hash value verification, it is determined that the two sets of encrypted data are consistent, which means that if the public key passes the hash value verification, it is determined that the two sets of The values in the encrypted data are equal, and if the public key fails to verify the hash value, it is determined that the two sets of encrypted data are inconsistent, which means that if the public key verifies the hash value If it fails, it is determined that the values in the two sets of encrypted data are not equal.
  • the public key passes the hash value verification, it is determined that the values in the two sets of encrypted data are equal, which means that if the public key passes the hash value verification, Determine that the sum of multiple values in one set of encrypted data is equal to the sum of multiple values in another set of encrypted data, and if the public key fails to verify the hash value, determine the two groups The value in the encrypted data is not equal, which means that if the public key fails to verify the hash value, it is determined that the sum of multiple values in one set of encrypted data is equal to that in another set of encrypted data. The sum of multiple values is not equal.
  • one of the two business lines contains data a1, a2, and a3, and the other business line contains data b1, b2, and b3, obtain encrypted data containing a1, a2, and a3 A1 and the encrypted data B1 containing data b1, b2, and b3, by judging the encrypted data A1 and B1, determine whether the sum of data a1, a2, and a3 is equal to the sum of b1, b2, and b3, so as not to decrypt the encrypted data A1 and B1 Then it can be judged whether the sum of data a1, a2, and a3 is equal to the sum of b1, b2, and b3.
  • the public key passes the hash value verification, determine the values a1, a2 in the two sets of encrypted data The sum of and a3 is equal to the sum of b1, b2, and b3. If the public key fails to verify the hash value, it is determined that the sum of the values a1, a2, and a3 in the two sets of encrypted data is The sum of b1, b2, and b3 is not equal.
  • a1, a2, and a3 and b1, b2, and b3 are data encrypted with the same key in the two service data lines, that is, a1, a2, and a3 are encrypted together with one key as a piece of data , B1, b2, and b3 are encrypted together with a key as a piece of data.
  • a1, a2, and a3 are the order amounts of three products in a product order contract
  • b1, b2, and b3 are the bank orders for the product
  • the contract corresponds to the loan amounts of a1, a2, and a3, and the bank needs to verify whether the sum of a1, a2, and a3 is equal to the sum of b1, b2, and b3.
  • each of the two sets of encrypted data includes a plurality of additively homomorphically encrypted data.
  • homomorphic encryption refers to such an encryption function that performs addition and multiplication operations on the plaintext and then encrypts it, and performs corresponding operations on the ciphertext after encryption, and the result is equivalent. Because of this good nature, people can entrust a third party to process data without revealing information.
  • An encryption function with homomorphic properties means that two plaintexts a and b satisfy Encryption function, where En is encryption operation, Dec is decryption operation, ⁇ , Corresponding to operations on the plaintext and ciphertext domains respectively.
  • the encryption is called additive homomorphism, also known as additive homomorphic encryption, or encrypted additive homomorphism. Encrypted addition homomorphism, if there is an effective algorithm or Yes, and do not leak x and y.
  • the verification method is based on a homomorphic encryption algorithm.
  • a and B that is, in addition to comparing two Judgment of whether two encrypted data are equal
  • each group of encrypted data only contains data encrypted with one key.
  • the method of verifying whether two encrypted data are equal can effectively solve the problem that the data is encrypted without decryption. It can verify whether two encrypted data are equal.
  • the encryption method of this method also supports homomorphic addition, that is, if there are multiple encrypted data in each group of encrypted data, suppose there are encrypted data in Perdesen Commitment format: A1, A2, A3...
  • each group of encrypted data contains multiple encrypted data A1, A2, A3... separately encrypted with different keys, or a group of data contains separate keys with different keys
  • Encrypted multiple encrypted data B1, B2, B3... you can also compare whether (A1+A2+A3+%) and (B1+B2+B3+%) are equal, that is, compare SUM(A1,A2) ,A3%) and SUM(B1,B2,B3%) are equal, where SUM means sum, the process is the same as comparing A and B, so I won’t repeat it here.
  • the two sets of encrypted data are converted into curve representations, the private key and public key are obtained according to the curve description according to preset rules, and the private key is used to sign the hash value of the encrypted data to Make the blockchain use the public key to verify the hash value. If the blockchain passes the verification, it is judged that the encrypted data is equal. If the verification fails, it is judged that the encrypted data is not equal, which can effectively solve the problem of data In the case of encryption, it is possible to verify whether the two encrypted data are equal without decryption, thereby improving the efficiency of the consistency verification of the encrypted data.
  • FIG. 4 is a schematic block diagram of an encrypted data consistency verification apparatus provided by an embodiment of the application.
  • an embodiment of the present application also provides an encrypted data consistency verification device.
  • the encrypted data consistency verification device includes a unit for executing the above encrypted data consistency verification method, and the device can be configured in computer equipment such as blockchain nodes.
  • the encrypted data consistency verification device 400 includes a first acquisition unit 401, a second acquisition unit 402, a generation unit 403, a signature verification unit 404, a judgment unit 405, and a judgment unit 406.
  • the first obtaining unit 401 is configured to obtain two sets of encrypted data respectively described using preset curves; the second obtaining unit 402 is configured to obtain pairs of two sets of encrypted data according to the respective curve descriptions of the two sets of encrypted data.
  • the judging unit 405 is configured to judge whether the public key verifies the hash value or not;
  • the unit 406 is configured to determine that the two sets of encrypted data are consistent if the public key passes the hash value verification, and if the public key fails the hash value verification, determine the two sets of The encrypted data is inconsistent.
  • FIG. 5 is another schematic block diagram of an encrypted data consistency verification apparatus provided by an embodiment of the application.
  • the encrypted data consistency verification device 400 further includes: an encryption unit 407, configured to describe the encrypted data using a preset curve and upload the encrypted data to the blockchain.
  • the second acquiring unit 402 includes: a first subtraction subunit 4021, configured to subtract the blind factors in the two sets of curves to obtain two pairs Set the private key for verifying the encrypted data; the second subtraction subunit 4022 is used to subtract the two sets of curves to obtain the public key for verifying the two sets of encrypted data.
  • the generating unit 403 includes: a merging subunit 4031 for merging the two sets of encrypted data to obtain merged encrypted data; an operation subunit 4032, configured to perform a hash operation on the merged encrypted data to obtain two sets of hash values of the encrypted data.
  • the determining unit 406 is configured to determine that the values in the two sets of encrypted data are equal if the public key verifies the hash value, and if the public key matches the hash value, If the signature verification fails, it is determined that the values in the two sets of encrypted data are not equal.
  • the determining unit 406 is configured to determine that the sum of multiple values in one set of encrypted data is compared with another set of encrypted data if the public key verifies the hash value. If the public key fails to verify the hash value, it is determined that the sum of the multiple values in one set of encrypted data and the multiple values in the other set of encrypted data And are not equal.
  • the two sets of encrypted data obtained by the first obtaining unit 401 each include a plurality of additive homomorphic encrypted data.
  • the preset curve used in the first obtaining unit 401 is an ECC elliptic curve.
  • each unit in the encrypted data consistency verification device is only used for illustration.
  • the encrypted data consistency verification device can be divided into different units as needed, or Each unit in the encrypted data consistency verification device adopts different connection sequences and methods to complete all or part of the functions of the encrypted data consistency verification device.
  • the apparatus for verifying the consistency of the encrypted data may be implemented in the form of a computer program, and the computer program may run on the computer device shown in FIG. 6.
  • FIG. 6 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 600 may be a computer device such as a desktop computer or a server, or may be a component or component in other devices.
  • the computer device 600 includes a processor 602, a memory, and a network interface 605 connected through a system bus 601, where the memory may include a non-volatile storage medium 603 and an internal memory 604.
  • the non-volatile storage medium 603 can store an operating system 6031 and a computer program 6032.
  • the processor 602 can execute a method for checking the consistency of the encrypted data.
  • the processor 602 is used to provide calculation and control capabilities to support the operation of the entire computer device 600.
  • the internal memory 604 provides an environment for the operation of the computer program 6032 in the non-volatile storage medium 603.
  • the processor 602 can execute the aforementioned encryption data consistency verification method.
  • the network interface 605 is used for network communication with other devices.
  • the structure shown in FIG. 6 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation to the computer device 600 to which the solution of the present application is applied.
  • the specific computer device 600 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the computer device may only include a memory and a processor.
  • the structures and functions of the memory and the processor are the same as those of the embodiment shown in FIG. 6, which will not be repeated here.
  • the processor 602 is configured to run a computer program 6032 stored in a memory, so as to implement the encrypted data consistency verification method described in the foregoing embodiments of the present application.
  • the processor 602 may be a central processing unit (Central Processing Unit, CPU), and the processor 602 may also be other general-purpose processors, digital signal processors (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • a person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by a computer program, and the computer program can be stored in a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the steps of the encryption data consistency verification method.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, and the computer-readable storage medium stores a computer program.
  • the processor executes the processes described in the above embodiments. Encrypted data consistency verification method steps.
  • the storage medium is a physical, non-transitory storage medium, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk or an optical disk, and other physical storage that can store computer programs. medium.
  • a physical, non-transitory storage medium such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk or an optical disk, and other physical storage that can store computer programs. medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

本申请实施例提供了一种加密数据一致性校验方法、装置、计算机设备及计算机可读存储介质。本申请实施例属于区块链技术中账本数据安全技术领域,在实现加密数据一致性校验时,通过将两组加密数据分别转化成曲线表示,根据曲线描述,按照预设规则获取私钥和公钥,使用所述私钥对所述加密数据的哈希值进行签名,以使区块链使用公钥对所述哈希值验签,若所述区块链验签通过,判断加密数据相等,若验签不通过,判断加密数据不相等。

Description

加密数据一致性校验方法、装置、计算机设备及存储介质
本申请要求于2019年3月12日提交中国专利局、申请号为201910184065.9、申请名称为“加密数据一致性校验方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据校验技术领域,尤其涉及一种加密数据一致性校验方法、装置、计算机设备及计算机可读存储介质。
背景技术
在区块链中,所有的数据都是加密存储,虽然数据加密存储实现了安全的数据共享,但数据加密存储带来了不便。在商业业务中,有大量需要比较两笔加密金额是否相等的场景,比如,在供应链金融中,上游的生产商可以使用核心企业的订单进行贷款,而银行放贷后,需要在区块链上验证银行放贷的金额和订单金额是一致的。传统技术中,银行需要将加密存储的上游生产商的订单数据及银行放贷的金额数据进行解密,然后验证银行放贷的金额和订单金额是否一致,由于涉及区块链数据的加密和解密致使放贷金额验证过程繁琐,导致放贷金额和订单金额一致性验证效率较低。
发明内容
本申请实施例提供了一种加密数据一致性校验方法、装置、计算机设备及计算机可读存储介质,能够解决传统技术中对加密数据一致性校验效率较低的问题。
第一方面,本申请实施例提供了一种加密数据一致性校验方法,所述方法包括:获取使用预设曲线分别描述的两组加密数据;根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;基于两组所述加密数据生成两组所述加密数据的哈希值;使用所述私钥对所述 哈希值进行签名并使用所述公钥对所述哈希值进行验签;判断所述公钥对所述哈希值进行验签是否通过;若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致;若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
第二方面,本申请实施例还提供了一种加密数据一致性校验装置,其中,所述装置包括:第一获取单元,用于获取使用预设曲线分别描述的两组加密数据;第二获取单元,用于根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;生成单元,用于基于两组所述加密数据生成两组所述加密数据的哈希值;验签单元,用于使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;判断单元,用于判断所述公钥对所述哈希值进行验签是否通过;判定单元,用于若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
第三方面,本申请实施例还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现所述加密数据一致性校验方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行所述加密数据一致性校验方法。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的加密数据一致性校验方法的应用场景示意图;
图2为本申请实施例提供的加密数据一致性校验方法的流程示意图;
图3为本申请实施例提供的加密数据一致性校验方法的另一流程示意图;
图4为本申请实施例提供的加密数据一致性校验装置的示意性框图;
图5为本申请实施例提供的加密数据一致性校验装置的另一示意性框图;以及
图6为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1为本申请实施例提供的加密数据一致性校验方法的应用场景示意图。所述应用场景包括:(1)区块链。本申请实施例是基于区块链的加密数据一致性校验。所述区块链中包括多个节点,每个节点对应区块链中的一个机构(ORG),由于每个节点属于一个机构,每个节点保存着区块链上所有的数据,也就是每个节点不但保存着自己机构的数据,也保存着区块链中其它节点的数据。节点之间没有区别,只是对应机构不一样,名字不一样,比如,银行1节点对应银行1,银行2节点对应银行2等。(2)各个节点。区块中的各个节点对应各家单位,属于区块链中的主体对象,比如,银行1节点对应银行1,银行2节点对应银行2,企业1节点对应企业1,企业2节点对应企业2。各个主体分别将自己的数据进行上链以实现在区块链中进行数据共享。
以银行1节点和企业1节点为例来说明本申请实施例中的方案,图1中的各个主体工作过程如下:银行节点1获取使用预设曲线分别描述的两组加密数据,其中,一组加密数据为银行1对企业1的放贷金额,另一组数据为企业1用来进行向银行1贷款的核心企业的订单,银行节点1根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥,基于两组所述加密数据生成两组所述加密数据的哈希值,使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签,判断所述公钥对所述哈希值进行验签是否通过;若所述公钥对所述哈希值验签通过,判定两组 所述加密数据一致,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
需要说明的是,图1中加密数据一致性校验方法的应用场景仅仅用于说明本申请技术方案,并不用于限定本申请技术方案,上述连接关系还可以有其他形式。
图2为本申请实施例提供的加密数据一致性校验方法的示意性流程图。该加密数据一致性校验方法可以应用于图1中的各个节点中,以完成加密数据一致性校验方法的全部或者部分功能。请参阅图2,图2是本申请实施例提供的加密数据一致性校验方法的流程示意图。如图2所示,该方法包括以下步骤S210-S270:
S210、获取使用预设曲线分别描述的两组加密数据。
具体地,本申请实施例提供一种验证两组加密数据是否一致的方法,也可以称为验证两组加密数据是否相等的方法。比如,在实际业务中,若要判断区块链上两条业务线中的数据a和b是否相等,获取包含a的加密数据A和包含数据b的加密数据B,通过加密数据A和B判断数据a和b是否相等,以实现不对加密数据A和B解密就能够判断数据a和b是否相等。在另一个实施例中,若包含两条业务线中,其中一条业务线包含数据a1、a2和a3,另一条业线中包含数据b1、b2和b3,获取包含a1、a2和a3的加密数据A1和包含数据b1、b2和b3的加密数据B1,通过判断加密数据A1和B1判断数据a1、a2和a3之和与b1、b2和b3之和是否相等,以实现不对加密数据A1和B1解密就能够判断数据a1、a2和a3之和与b1、b2和b3之和是否相等。在本申请实施例中,通过不对加密数据解密的情况下,判断两组加密数据是否一致,需要加密数据采用预设曲线来描述。因此,可以采用预设曲线来描述加密数据并将采用预设曲线描述的加密数据存储至区块链各个节点中。因此,请参阅图3,图3为本申请实施例提供的加密数据一致性校验方法的另一流程示意图,如图3所示,所述获取使用预设曲线分别描述的两组加密数据的步骤之前,还包括:
S200、使用预设曲线描述加密数据并将所述加密数据上传至区块链。
具体地,在本申请实施例中,可以采用密码学中的Perdesen(人名) Commitment格式表示加密数据,使用ECC椭圆曲线描述加密数据。其中,椭圆曲线加密法,英文为Elliptic Curve Cryptography,缩写为ECC。椭圆曲线加密法(ECC)是一种公钥加密技术,以椭圆曲线理论为基础,在创建密钥时可做到更快、更小,并且更有效。ECC利用椭圆曲线等式的性质来产生密钥。比如,目前中国居民二代身份证使用256位的椭圆曲线密码。其中,P256曲线,又称为secp256r1曲线。椭圆曲线加密算法中还包括P224曲线、P384曲线及P512曲线。使用ECC椭圆曲线描述加密数据并将所述加密数据上传至区块链,比如,在供应链金融中,上游的生产商使用核心企业的订单进行贷款,而银行放贷后,需要在区块链上验证银行放贷的金额和订单的金额是否一致。由于区块链上的数据都是加密数据,上游生产商订单的加密数据为A,其中包含有订单金额a,银行放贷的加密数据为B,其中包含有放贷的金额为b,要判断加密数据A和B中的a和b是否为相等数据。加密数据A和B都是密码学中的Perdesen Commitment格式,使用ECC椭圆曲线分别描述加密数据A和B如下:1)A=a*G+x1*H;2)B=b*G+x2*H。其中,A和B分别为加密数据,a和b分别为要验证是否相同的数据,G为基点(base point),x1和x2为盲因子。H点为H=h*G,h为私钥,其中H和G为椭圆曲线Ep(a,b)上的点,h为小于n(n是点G的阶)的整数,h称为私有密钥(privte key),H称为公开密钥,英文为Public Key。
在实际使用中,各种加密算法中支持椭圆曲线加密中的对应曲线,在计算机算法中直接调用相应曲线。比如,中国商用密码算法包括SM2、SM3及SM4。其中,SM2支持P-256、P-384、P-521椭圆曲线,实现基于椭圆曲线加密算法的软件授权码生成及校验。
S220、根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥。其中,预设规则是指以两组曲线的盲因子之差为私钥,对区块链提供签名,以两组曲线之差为公钥,对区块链的数据进行验签。
具体地,根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥,是指将两组曲线中的盲因子相减得到 对两组所述加密数据进行校验的私钥,将两组曲线相减得到对两组所述加密数据进行校验的公钥。比如,假设有加密数据A和B,这两个加密数据都是密码学中的Perdesen(人名)Commitment格式,使用ECC椭圆曲线,描述如下:1)A=a*G+x1*H;2)B=b*G+x2*H。其中,A和B分别为加密数据,a和b分别为要验证是否相同的数据,G为基点(base point),x1和x2为盲因子。H点为H=h*G,h为私钥,其中H和G为椭圆曲线Ep(a,b)上的点,h为小于n(n是点G的阶)的整数,h称为私有密钥(Privte Key),H称为公开密钥(Public Key)。
由于H=h*G满足离散对数难题的性质,即给定h和G,根据加法法则,计算H很容易,也就是已知h点求H是容易的,但是,给定H和G,求h就相对困难了,也就是从H点求h是困难的(仅能通过暴力破解)。而该h点是不公开的,即所有的业务参与方都不能得知私钥h是多少。同时,我们有一条以H点为基点的椭圆曲线S。计算:C=A-B=(x1-x2)*H,然后,以(x1-x2)为曲线S的私钥,对区块链提供签名,而C即是曲线S的公钥,用于验签,验签通过,则说明a和b相等。因为,C=A-B=(x1-x2)*H=(x1-x2)*h*G,由于A和B提前公布在区块链上而无法伪造,则C无法伪造;假设a-b不为0,则私钥为:[(a-b)+(x1-x2)*h],因为h不能知晓,所以该私钥无法通过计算得知,所以,只有a-b等于0的情况下,才可以提供相关签名。因此,本申请实施例中,将两组加密数据曲线中的盲因子相减得到对两组所述加密数据进行校验的私钥,将两组曲线相减得到对两组所述加密数据进行校验的公钥。
S230、基于两组所述加密数据生成两组所述加密数据的哈希值。
具体地,基于两组所述加密数据生成两组所述加密数据的哈希值,是指将两组所述加密数据合并得到合并后的加密数据,对所述合并后的加密数据进行哈希运算得到两组所述加密数据的哈希值。比如,仍以上述中的例子为例,假设有加密数据A和B,这两个加密数据都是密码学中的Perdesen(人名)Commitment格式,使用ECC椭圆曲线,描述如下:1)A=a*G+x1*H;2)B=b*G+x2*H。
对于交易的双方,是可以获知金额a、b以及盲因子x1和x2,现在需要向 区块链证明,这两个加密数据是否相等。二级节点也就是区块链中需要验证两组数据是否相等的节点,二级节点基于两组所述加密数据生成两组所述加密数据的哈希值的过程如下:(1)对P256曲线的参数进行替换,得到一条新的以H点为基点的P256曲线S;(2)在二级节点上计算:E(A)+E(B)=E(A+B),比如,message=hash(string(A)+string(B));同时,计算:(x1-x2),并以(x1-x2)为私钥,对message进行签名,得到签名码sig;(3)将sig签名码发送到区块链上。
区块链上的验证工作包括以下步骤:(1)区块链计算C=A-B,得到公钥C;(2)区块链计算message`=hash(string(A)+string(B)),用C对message`进行验签,如果验签通过,则说明A和B相等。
S240、使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;S250、判断所述公钥对所述哈希值进行验签是否通过;S260、若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致;S270、若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
具体地,使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签,判断所述公钥对所述哈希值进行验签是否通过,若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。比如,仍以上述两组加密数据A和B为例。假设有加密数据A和B,这两个加密数据都是密码学中的PerdesenCommitment格式,使用ECC椭圆曲线,描述如下:1)A=a*G+x1*H;2)B=b*G+x2*H。其中,A和B分别为加密数据,a和b分别为要验证是否相同的数据,G为基点(base point),x1和x2为盲因子。H点为H=h*G,h为私钥,其中H和G为椭圆曲线Ep(a,b)上的点,h为小于n(n是点G的阶)的整数,h称为私有密钥(privte key),H称为公开密钥(public key)。
由于H=h*G满足离散对数难题的性质,即,给定h和G,根据加法法则,计算H很容易,也就是已知h点求H是容易的,但是,给定H和G,求h就相对困难了,也就是从H点求h是困难的(仅能通过暴力破解)。而该h点是不公开的,即所有的业务参与方都不能得知私钥h是多少。同时,我们有一条以H点 为基点的椭圆曲线S。计算:C=A-B=(x1-x2)*H,然后,以(x1-x2)为曲线S的私钥,对区块链提供签名;而C即是曲线S的公钥,用于验签,验签通过,则说明a和b相等。原因是:C=A-B=(x1-x2)*H=(x1-x2)*h*G,因为A和B无法伪造(提前公布在链上),则C无法伪造;假设a-b不为0,则私钥为:[(a-b)+(x1-x2)*h],因为h不能知晓,所以该私钥无法通过计算得知;所以,只有a-b等于0的情况下,才可以提供相关签名。
进一步地,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致,是指若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等,所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致,是指若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等。比如,在实际业务中,若要判断区块链上两条业务线中的数据a和b是否相等,获取包含a的加密数据A和包含数据b的加密数据B,通过加密数据A和B判断数据a和b是否相等,以实现不对加密数据A和B解密就能够判断数据a和b是否相等,若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值a和b相等,所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值a和b不相等。
更进一步地,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等,是指若所述公钥对所述哈希值验签通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和相等,所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等,是指若所述公钥对所述哈希值验签未通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和不相等。比如,在一个实施例中,若两条业务线中,其中一条业务线包含数据a1、a2和a3,另一条业线中包含数据b1、b2和b3,获取包含a1、a2和a3的加密数据A1和包含数据b1、b2和b3的加密数据B1,通过判断加密数据A1和B1判断数据a1、a2和a3之和与b1、b2和b3之和是否相等,以实现不对加密数据A1和B1解密就能够判断数据a1、a2和a3之和与b1、b2和b3之和是否相等,若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值a1、a2和a3之和与b1、b2和b3之和相等,所述若所述 公钥对所述哈希值验签未通过,判定两组所述加密数据中的值a1、a2和a3之和与b1、b2和b3之和不相等。需要说明的是,a1、a2和a3与b1、b2和b3是两条业务数据线中分别采用同一密钥进行加密的数据,也就是a1、a2和a3采用一个密钥作为一条数据一起进行加密,b1、b2和b3采用一个密钥作为一条数据一起进行加密,比如,a1、a2和a3分别为一个产品订购合同中的三个产品的订购金额,b1、b2和b3为银行对该产品订购合同中分别对应于a1、a2和a3的贷款金额,银行需要验证a1、a2和a3之和与b1、b2和b3之和是否相等。
在一个实施例中,两组所述加密数据各自分别包括多个加法同态加密的数据。
其中,同态加密是指这样一种加密函数,对明文进行环上的加法和乘法运算再加密,与加密后对密文进行相应的运算,结果是等价的。由于这个良好的性质,人们可以委托第三方对数据进行处理而不泄露信息。具有同态性质的加密函数是指两个明文a、b满足
Figure PCTCN2019118457-appb-000001
的加密函数,其中En是加密运算,Dec是解密运算,⊙、
Figure PCTCN2019118457-appb-000002
分别对应明文和密文域上的运算。当
Figure PCTCN2019118457-appb-000003
代表加法时,称该加密为加同态,也称为加法同态加密,或者加密加法同态。加密加法同态,如果存在有效算法
Figure PCTCN2019118457-appb-000004
或者
Figure PCTCN2019118457-appb-000005
成立,并且不泄漏x和y。
具体地,本申请实施例提供的加密数据一致性校验方法,在加密情况下,该验证方法建立在同态加密算法的基础之上,除了可以比较A和B之外,也就是除了对两个加密数据是否相等判断,也就是每组加密数据中只包含采用一个密钥加密的数据,该验证两个加密数据是否相等的方法,可以有效的解决在数据被加密的情况下,不用解密就可以验证两个加密数据是否相等,该方法的加密方式还支持同态加法,即如果每组加密数据中存在多个加密数据,假设存在Perdesen Commitment格式的加密数据:A1,A2,A3...以及B1,B2,B3...,也就是每组加密数据中分别包含用不同密钥单独加密的多个加密数据A1,A2,A3...,或者一组数据中包含用不同密钥单独加密的多个加密数据B1,B2,B3...,也可以比较(A1+A2+A3+...)和(B1+B2+B3+...)是否相等,也就是比较SUM(A1,A2,A3...)和SUM(B1,B2,B3...)是否相等,其中,SUM 表示求和,过程与比较A和B相同,在此不再赘述。
在本发明中,通过将两组加密数据分别转化成曲线表示,根据曲线描述,按照预设规则获取私钥和公钥,使用所述私钥对所述加密数据的哈希值进行签名,以使区块链使用公钥对所述哈希值验签,若所述区块链验签通过,判断加密数据相等,若验签不通过,判断加密数据不相等,可以有效的解决在数据被加密的情况下,不用解密,就可以验证两个加密数据时否相等,从而提高加密数据一致性验证的效率,
需要说明的是,上述各个实施例所述的加密数据一致性校验方法,可以根据需要将不同实施例中包含的技术特征重新进行组合,以获取组合后的实施方案,但都在本申请要求的保护范围之内。
请参阅图4,图4为本申请实施例提供的加密数据一致性校验装置的示意性框图。对应于上述加密数据一致性校验方法,本申请实施例还提供一种加密数据一致性校验装置。如图4所示,该加密数据一致性校验装置包括用于执行上述加密数据一致性校验方法的单元,该装置可以被配置于区块链节点等计算机设备中。具体地,请参阅图4,该加密数据一致性校验装置400包括第一获取单元401、第二获取单元402、生成单元403、验签单元404、判断单元405及判定单元406。其中,第一获取单元401,用于获取使用预设曲线分别描述的两组加密数据;第二获取单元402,用于根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;生成单元403,用于基于两组所述加密数据生成两组所述加密数据的哈希值;验签单元404,用于使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;判断单元405,用于判断所述公钥对所述哈希值进行验签是否通过;判定单元406,用于若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
请参阅图5,图5为本申请实施例提供的加密数据一致性校验装置的另一个示意性框图。如图5所示,所述加密数据一致性校验装置400还包括:加密单元407,用于使用预设曲线描述加密数据并将所述加密数据上传至区块链。
请继续参阅图5,如图5所示,在该实施例中,所述第二获取单元402包括: 第一相减子单元4021,用于将两组曲线中的盲因子相减得到对两组所述加密数据进行校验的私钥;第二相减子单元4022,用于将两组曲线相减得到对两组所述加密数据进行校验的公钥。
请继续参阅图5,如图5所示,在该实施例中,所述生成单元403包括:合并子单元4031,用于将两组所述加密数据合并得到合并后的加密数据;运算子单元4032,用于对所述合并后的加密数据进行哈希运算得到两组所述加密数据的哈希值。
在一个实施例中,所述判定单元406,用于若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等。
在一个实施例中,所述判定单元406,用于若所述公钥对所述哈希值验签通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和相等,若所述公钥对所述哈希值验签未通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和不相等。
在一个实施例中,所述第一获取单元401中所获取的两组所述加密数据各自分别包括多个加法同态加密的数据。
在一个实施例中,其中,所述第一获取单元401中所采用的所述预设曲线为ECC椭圆曲线。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述加密数据一致性校验装置和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
同时,上述加密数据一致性校验装置中各个单元的划分和连接方式仅用于举例说明,在其他实施例中,可将加密数据一致性校验装置按照需要划分为不同的单元,也可将加密数据一致性校验装置中各单元采取不同的连接顺序和方式,以完成上述加密数据一致性校验装置的全部或部分功能。
上述加密数据一致性校验装置可以实现为一种计算机程序的形式,该计算机程序可以在如图6所示的计算机设备上运行。
请参阅图6,图6是本申请实施例提供的一种计算机设备的示意性框图。该 计算机设备600可以是台式机电脑或者服务器等计算机设备,也可以是其他设备中的组件或者部件。
参阅图6,该计算机设备600包括通过系统总线601连接的处理器602、存储器和网络接口605,其中,存储器可以包括非易失性存储介质603和内存储器604。
该非易失性存储介质603可存储操作系统6031和计算机程序6032。该计算机程序6032被执行时,可使得处理器602执行一种上述加密数据一致性校验方法。
该处理器602用于提供计算和控制能力,以支撑整个计算机设备600的运行。
该内存储器604为非易失性存储介质603中的计算机程序6032的运行提供环境,该计算机程序6032被处理器602执行时,可使得处理器602执行一种上述加密数据一致性校验方法。
该网络接口605用于与其它设备进行网络通信。本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备600的限定,具体的计算机设备600可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图6所示实施例一致,在此不再赘述。
其中,所述处理器602用于运行存储在存储器中的计算机程序6032,以实现本申请上述各个实施例所描述的加密数据一致性校验方法。
应当理解,在本申请实施例中,处理器602可以是中央处理单元(Central Processing Unit,CPU),该处理器602还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规 的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来完成,该计算机程序可存储于一计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述加密数据一致性校验方法的步骤。
因此,本申请还提供一种计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行以上各实施例中所描述的加密数据一致性校验方法的步骤。
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储计算机程序的实体存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上所述,仅为本申请的具体实施方式,但本申请明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种加密数据一致性校验方法,包括:
    获取使用预设曲线分别描述的两组加密数据;
    根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;
    基于两组所述加密数据生成两组所述加密数据的哈希值;
    使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;
    判断所述公钥对所述哈希值进行验签是否通过;
    若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致;
    若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
  2. 根据权利要求1所述加密数据一致性校验方法,其中,所述获取使用预设曲线分别描述的两组加密数据的步骤之前,还包括:
    使用预设曲线描述加密数据并将所述加密数据上传至区块链。
  3. 根据权利要求1所述加密数据一致性校验方法,其中,所述根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥的步骤包括:
    将两组曲线中的盲因子相减得到对两组所述加密数据进行校验的私钥;
    将两组曲线相减得到对两组所述加密数据进行校验的公钥。
  4. 根据权利要求1所述加密数据一致性校验方法,其中,所述基于两组所述加密数据生成两组所述加密数据的哈希值的步骤包括:
    将两组所述加密数据合并得到合并后的加密数据;
    对所述合并后的加密数据进行哈希运算得到两组所述加密数据的哈希值。
  5. 根据权利要求1所述加密数据一致性校验方法,其中,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致的步骤包括:
    若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等;
    所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致的步骤包括:
    若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等。
  6. 根据权利要求5所述加密数据一致性校验方法,其中,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等的步骤包括:
    若所述公钥对所述哈希值验签通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和相等;
    所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等的步骤包括:
    若所述公钥对所述哈希值验签未通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和不相等。
  7. 根据权利要求1所述加密数据一致性校验方法,其中,两组所述加密数据各自分别包括多个加法同态加密的数据。
  8. 根据权利要求1所述加密数据一致性校验方法,其中,所述预设曲线为ECC椭圆曲线。
  9. 一种加密数据一致性校验装置,其中,包括:
    第一获取单元,用于获取使用预设曲线分别描述的两组加密数据;
    第二获取单元,用于根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;
    生成单元,用于基于两组所述加密数据生成两组所述加密数据的哈希值;
    验签单元,用于使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;
    判断单元,用于判断所述公钥对所述哈希值进行验签是否通过;
    判定单元,用于若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致,若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
  10. 根据权利要求1所述加密数据一致性校验装置,其中,还包括:
    加密单元,用于使用预设曲线描述加密数据并将所述加密数据上传至区块链。
  11. 一种计算机设备,其中,所述计算机设备包括存储器以及与所述存储器 相连的处理器;所述存储器用于存储计算机程序;所述处理器运行所述存储器中存储的计算机程序时执行如下步骤:
    获取使用预设曲线分别描述的两组加密数据;
    根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;
    基于两组所述加密数据生成两组所述加密数据的哈希值;
    使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;
    判断所述公钥对所述哈希值进行验签是否通过;
    若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致;
    若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
  12. 根据权利要求11所述计算机设备,其中,所述获取使用预设曲线分别描述的两组加密数据的步骤之前,还包括:
    使用预设曲线描述加密数据并将所述加密数据上传至区块链。
  13. 根据权利要求11所述计算机设备,其中,所述根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥的步骤包括:
    将两组曲线中的盲因子相减得到对两组所述加密数据进行校验的私钥;
    将两组曲线相减得到对两组所述加密数据进行校验的公钥。
  14. 根据权利要求11所述计算机设备,其中,所述基于两组所述加密数据生成两组所述加密数据的哈希值的步骤包括:
    将两组所述加密数据合并得到合并后的加密数据;
    对所述合并后的加密数据进行哈希运算得到两组所述加密数据的哈希值。
  15. 根据权利要求11所述加密数据一致性校验方法,其中,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致的步骤包括:
    若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等;
    所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致的步骤包括:
    若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等。
  16. 根据权利要求15所述加密数据一致性校验方法,其中,所述若所述公钥对所述哈希值验签通过,判定两组所述加密数据中的值相等的步骤包括:
    若所述公钥对所述哈希值验签通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和相等;
    所述若所述公钥对所述哈希值验签未通过,判定两组所述加密数据中的值不相等的步骤包括:
    若所述公钥对所述哈希值验签未通过,判定一组所述加密数据中多个值之和与另一组所述加密数据中多个值之和不相等。
  17. 根据权利要求11所述加密数据一致性校验方法,其中,两组所述加密数据各自分别包括多个加法同态加密的数据。
  18. 根据权利要求11所述加密数据一致性校验方法,其中,所述预设曲线为ECC椭圆曲线。
  19. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如下操作:
    获取使用预设曲线分别描述的两组加密数据;
    根据两组所述加密数据的各自曲线描述,按照预设规则获取对两组所述加密数据进行校验的私钥和公钥;
    基于两组所述加密数据生成两组所述加密数据的哈希值;
    使用所述私钥对所述哈希值进行签名并使用所述公钥对所述哈希值进行验签;
    判断所述公钥对所述哈希值进行验签是否通过;
    若所述公钥对所述哈希值验签通过,判定两组所述加密数据一致;
    若所述公钥对所述哈希值验签未通过,判定两组所述加密数据不一致。
  20. 根据权利要求19所述存储介质,其中,所述获取使用预设曲线分别描述的两组加密数据的步骤之前,还包括:
    使用预设曲线描述加密数据并将所述加密数据上传至区块链。
PCT/CN2019/118457 2019-03-12 2019-11-14 加密数据一致性校验方法、装置、计算机设备及存储介质 WO2020181822A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910184065.9A CN110069939A (zh) 2019-03-12 2019-03-12 加密数据一致性校验方法、装置、计算机设备及存储介质
CN201910184065.9 2019-03-12

Publications (1)

Publication Number Publication Date
WO2020181822A1 true WO2020181822A1 (zh) 2020-09-17

Family

ID=67366228

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118457 WO2020181822A1 (zh) 2019-03-12 2019-11-14 加密数据一致性校验方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN110069939A (zh)
WO (1) WO2020181822A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069939A (zh) * 2019-03-12 2019-07-30 平安科技(深圳)有限公司 加密数据一致性校验方法、装置、计算机设备及存储介质
CN110781140B (zh) * 2019-09-06 2023-08-18 平安科技(深圳)有限公司 区块链中数据签名的方法、装置、计算机设备及存储介质
CN110557401B (zh) * 2019-09-17 2022-01-11 百度在线网络技术(北京)有限公司 基于区块链的品牌事务处理方法、装置、设备和介质
CN111552736A (zh) * 2020-03-30 2020-08-18 深圳壹账通智能科技有限公司 加密数据对等关系比对方法、装置及存储介质
CN112035573A (zh) * 2020-08-26 2020-12-04 深圳壹账通智能科技有限公司 基于区块链网络的数据处理方法、设备、节点及存储介质
CN112184440A (zh) * 2020-09-29 2021-01-05 平安科技(深圳)有限公司 数据处理方法、装置、节点设备及存储介质
CN112100688A (zh) * 2020-09-29 2020-12-18 深圳壹账通智能科技有限公司 数据验证方法、装置、设备以及存储介质
CN112184441B (zh) * 2020-09-29 2024-01-19 平安科技(深圳)有限公司 数据处理方法、装置、节点设备及存储介质
CN112651835B (zh) * 2020-12-30 2023-05-23 成都佳华物链云科技有限公司 联盟链的交易方法、装置、电子设备及存储介质
CN113779599A (zh) * 2021-08-31 2021-12-10 深圳市众诚品业科技有限公司 交谈信息保护方法、服务器、终端及存储介质
CN114726541B (zh) * 2022-04-08 2023-12-22 平安国际智慧城市科技股份有限公司 电子证照读取方法、装置、设备及存储介质
CN115221245B (zh) * 2022-07-14 2023-07-14 广州纳指数据智能科技有限公司 智能数据采集同步方法、系统及设备
CN116229334B (zh) * 2023-05-09 2023-07-14 厦门农芯数字科技有限公司 基于区块链的猪场跨摄像头事件管理方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140105382A1 (en) * 2010-11-29 2014-04-17 Beijing Z & W Technology Consullting Co., Ltd. Data Encryption and Decryption Method and Apparatus
US20160330017A1 (en) * 2015-05-08 2016-11-10 Electronics And Telecommunications Research Institute Method and system for additive homomorphic encryption scheme with operation error detection functionality
CN106850566A (zh) * 2016-12-29 2017-06-13 北京奇艺世纪科技有限公司 一种数据一致性校验的方法及装置
CN107707358A (zh) * 2017-10-30 2018-02-16 武汉大学 一种ec‑kcdsa数字签名生成方法及系统
CN109274503A (zh) * 2018-11-05 2019-01-25 北京仁信证科技有限公司 分布式协同签名方法及分布式协同签名装置、软盾系统
CN110069939A (zh) * 2019-03-12 2019-07-30 平安科技(深圳)有限公司 加密数据一致性校验方法、装置、计算机设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105359455A (zh) * 2013-07-12 2016-02-24 皇家飞利浦有限公司 电子签名系统
CN107666388B (zh) * 2016-07-28 2019-11-01 郑珂威 基于完全同态加密方法的区块链信息加密方法
CN108540459B (zh) * 2018-03-22 2021-03-30 北京京东尚科信息技术有限公司 数据储存方法、装置、系统、电子设备及计算机可读介质
CN109102286B (zh) * 2018-08-02 2023-04-07 平安科技(深圳)有限公司 跨账本交易方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140105382A1 (en) * 2010-11-29 2014-04-17 Beijing Z & W Technology Consullting Co., Ltd. Data Encryption and Decryption Method and Apparatus
US20160330017A1 (en) * 2015-05-08 2016-11-10 Electronics And Telecommunications Research Institute Method and system for additive homomorphic encryption scheme with operation error detection functionality
CN106850566A (zh) * 2016-12-29 2017-06-13 北京奇艺世纪科技有限公司 一种数据一致性校验的方法及装置
CN107707358A (zh) * 2017-10-30 2018-02-16 武汉大学 一种ec‑kcdsa数字签名生成方法及系统
CN109274503A (zh) * 2018-11-05 2019-01-25 北京仁信证科技有限公司 分布式协同签名方法及分布式协同签名装置、软盾系统
CN110069939A (zh) * 2019-03-12 2019-07-30 平安科技(深圳)有限公司 加密数据一致性校验方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN110069939A (zh) 2019-07-30

Similar Documents

Publication Publication Date Title
WO2020181822A1 (zh) 加密数据一致性校验方法、装置、计算机设备及存储介质
US11936774B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
WO2021238527A1 (zh) 数字签名生成方法、装置、计算机设备和存储介质
CN110971405B (zh) 多方协同的sm2签名、解密方法及其系统
CN107483212B (zh) 一种双方协作生成数字签名的方法
WO2021114819A1 (zh) 生成和执行智能合约交易的方法及装置
WO2021046668A1 (zh) 区块链系统及信息传输方法、系统、装置、计算机介质
JP2020502856A5 (zh)
CN113569294B (zh) 一种零知识证明方法及装置、电子设备、存储介质
US8452974B2 (en) Image processing apparatus, electronic signature generation system, electronic signature key generation method, image processing method, and program
US9219602B2 (en) Method and system for securely computing a base point in direct anonymous attestation
WO2021228239A1 (zh) 资产类型一致性证据生成、交易、交易验证方法及系统
CN111835526B (zh) 一种生成匿名凭证的方法及系统
WO2020253108A1 (zh) 信息隐匿方法、装置、设备及存储介质
US20160149708A1 (en) Electronic signature system
WO2022068354A1 (zh) 数据验证方法、装置、设备以及存储介质
US20230237437A1 (en) Apparatuses and methods for determining and processing dormant user data in a job resume immutable sequential listing
WO2020192236A1 (zh) 基于盲签名的交易方法及装置
WO2018105038A1 (ja) 通信装置及び分散型元帳システム
CN111917533A (zh) 具有减少泄漏的区间统计量的隐私保护基准分析
Shi et al. Threshold eddsa signature for blockchain-based decentralized finance applications
CN112184441A (zh) 数据处理方法、装置、节点设备及存储介质
WO2022110716A1 (zh) 冷启动推荐方法、装置、计算机设备及存储介质
CN117795901A (zh) 生成数字签名份额
CN111885056A (zh) 基于区块链的零知识证明方法、装置及电子设备

Legal Events

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

Ref document number: 19918961

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918961

Country of ref document: EP

Kind code of ref document: A1