Data processing method and device, equipment and medium

The data security is ensured in data transmission through elliptic curve encryption algorithm and hash function, which solves the problem of leakage during data transmission, and realizes efficient data encryption and complementary calculations.

CN119051964AActive Publication Date: 2024-11-29CCB FINTECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411271616.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-11-29
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

During the data transmission process, how to ensure the security of data and prevent inter-agency business data leakage.

Method used

The elliptic curve encryption algorithm generates public and private keys, encrypts and decrypts data, and uses hash functions and modulo operations during the encrypted data transmission to ensure the security and integrity of the data, thereby realizing the privacy complementary calculation of data. .

Benefits of technology

It effectively ensures the security of data transmission, ensures the integrity of data during transmission, facilitates subsequent complementary calculations, and improves data security and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119051964A_ABST
    Figure CN119051964A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information security, in particular to a data processing method and device, equipment and a medium, and is used for solving the problem of security of data transmission of two parties. In the method, a first device receives a second public key sent by a second device, and encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting a first data set based on a first private key of the first device; the second public key is generated based on a second private key of the second device and the first base point; the first device receives a second encrypted data set sent by the second device, and encrypts the second encrypted data set based on the first private key to obtain a second target data set; and performing complementary set processing on the first target data set and the second target data set to obtain a data complementary set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security, and specifically to a data processing method, device, equipment and medium. Background Art

[0002] With the rapid development of the economy, in order to meet the growing business needs, different institutions usually need to transfer data to obtain complete business data. For example, when two institutions have partial data of the same business at the same time, when one of them performs the corresponding business, it may be necessary for the other party to transfer the data of the business it has saved to itself, in order to obtain the complete data of the business and meet subsequent business requirements. When transmitting data, data security is particularly important. Therefore, in order to prevent the leakage of business data of each institution, the two institutions need a method to ensure the security of data transmission when transmitting data. Summary of the invention

[0003] The embodiments of the present application provide a data processing method, apparatus, device and medium for solving the data security problem when two organizations perform data transmission.

[0004] In a first aspect, the present application provides a data processing method, which is applied to a first device, and the method includes:

[0005] Receive a second public key sent by a second device, and encrypt the first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0006] receiving a second encrypted data set sent by the second device, and encrypting the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target service;

[0007] The first target data set and the second target data set are processed by complementation to obtain a data complement.

[0008] In a possible embodiment, the first encrypted data set is determined based on the following method:

[0009] Based on the first private key and the order of the first base point, each first data in the first data set is encrypted to obtain a first encrypted data set.

[0010] In a possible implementation manner, the encrypting each first data in the first data set based on the first private key and the order of the first base point includes:

[0011] Performing a modulo operation on the first private key and the order of the first base point;

[0012] Each first data is encrypted based on the result of the modulo operation to obtain first encrypted data corresponding to each first data.

[0013] In a possible implementation manner, the encrypting each first data in the first data set based on the first private key and the order of the first base point includes:

[0014] Generate a negotiated key based on the second public key and the first private key, and calculate a hash value of the negotiated key based on a hash function;

[0015] Using the hash value of the negotiated key as a salt value, respectively calculate the hash value of each first data based on a hash function;

[0016] Based on the first private key and the order of the first base point, the hash values ​​of the first data are encrypted respectively.

[0017] In a possible implementation manner, the first data set includes at least one first data; the first data set is determined based on the following method:

[0018] Receive a first initial data set corresponding to the target business, wherein the first initial data set includes at least one first initial data, each first initial data includes a plurality of sub-data corresponding to each primary key; each primary key corresponds to a different attribute parameter of the first initial data;

[0019] For each first initial data, the sub-data in the first initial data are concatenated according to the preset arrangement order of the primary keys to obtain the first data corresponding to the first initial data.

[0020] In a second aspect, the present application provides a data processing apparatus, applied to a first device, the apparatus comprising:

[0021] A first receiving module is used to receive a second public key sent by a second device, and encrypt a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0022] a second receiving module, configured to receive a second encrypted data set sent by the second device, and encrypt the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target service;

[0023] The complement processing module is used to perform complement processing on the first target data set and the second target data set to obtain a data complement.

[0024] In a possible implementation, the device further includes a first set determination module, configured to determine the first encrypted data set based on the following method:

[0025] Based on the first private key and the order of the first base point, each first data in the first data set is encrypted to obtain a first encrypted data set.

[0026] In a possible implementation manner, the first set determination module is specifically configured to:

[0027] Performing a modulo operation on the first private key and the order of the first base point;

[0028] Each first data is encrypted based on the result of the modulo operation to obtain first encrypted data corresponding to each first data.

[0029] In a possible implementation manner, the first set determination module is specifically configured to:

[0030] Generate a negotiated key based on the second public key and the first private key, and calculate a hash value of the negotiated key based on a hash function;

[0031] Using the hash value of the negotiated key as a salt value, respectively calculate the hash value of each first data based on a hash function;

[0032] Based on the first private key and the order of the first base point, the hash values ​​of the first data are encrypted respectively.

[0033] In a possible implementation manner, the first data set includes at least one first data; and the first set determination module is further configured to determine the first data set based on the following method:

[0034] Receive a first initial data set corresponding to the target business, wherein the first initial data set includes at least one first initial data, each first initial data includes a plurality of sub-data corresponding to each primary key; each primary key corresponds to a different attribute parameter of the first initial data;

[0035] For each first initial data, the sub-data in the first initial data are concatenated according to the preset arrangement order of the primary keys to obtain the first data corresponding to the first initial data.

[0036] In a third aspect, the present application provides a data processing method, which is applied to a second device, and the method includes:

[0037] Sending a second public key to a first device, so that the first device encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0038] Send a second encrypted data set to the first device, so that the first device encrypts the second encrypted data set based on the first private key to obtain a second target data set, and performs complement processing on the first target data set and the second target data set to obtain a data complement; the second encrypted data set is: the second data set is encrypted based on the second private key and the first base point; the first data set and the second data set correspond to the same target business.

[0039] In a possible implementation manner, the second encrypted data set is determined based on the following method:

[0040] Based on the second private key and the order of the first base point, encrypt each second data in the second data set to obtain an intermediate data set;

[0041] The intermediate data set is encrypted based on the first base point to obtain the second encrypted data set.

[0042] In a possible implementation manner, the encrypting each second data in the second data set based on the second private key and the order of the first base point includes:

[0043] Performing a modulo operation on the second private key and the order of the first base point;

[0044] Each second data is encrypted based on the result of the modulo operation to obtain intermediate data corresponding to each second data.

[0045] In a possible implementation manner, the encrypting each second data in the second data set based on the second private key and the order of the first base point includes:

[0046] Based on the first public key and the second private key, a negotiated key is generated, and a hash value of the negotiated key is calculated based on a hash function; the first public key is generated based on the first private key and the first base point;

[0047] Using the hash value of the negotiated key as the salt value, respectively calculate the hash value of each second data based on the hash function;

[0048] Based on the second private key and the order of the first base point, the hash values ​​of the second data are encrypted respectively.

[0049] In a fourth aspect, the present application provides a data processing apparatus, applied to a second device, the apparatus comprising:

[0050] The first sending module is used to send a second public key to the first device, so that the first device encrypts the first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and the first base point; the first base point is generated based on the elliptic curve encryption algorithm;

[0051] The second sending module is used to send a second encrypted data set to the above-mentioned first device, so that the above-mentioned first device encrypts the above-mentioned second encrypted data set based on the above-mentioned first private key to obtain a second target data set, and performs complement processing on the above-mentioned first target data set and the above-mentioned second target data set to obtain a data complement; the above-mentioned second encrypted data set is: based on the above-mentioned second private key and the above-mentioned first base point, the second data set is encrypted; the above-mentioned first data set and the above-mentioned second data set correspond to the same target business.

[0052] In a possible implementation, the device further includes a second set determination module, configured to determine the second encrypted data set based on the following method:

[0053] Based on the second private key and the order of the first base point, encrypt each second data in the second data set to obtain an intermediate data set;

[0054] The intermediate data set is encrypted based on the first base point to obtain the second encrypted data set.

[0055] In a possible implementation manner, the second set determination module is specifically configured to:

[0056] Performing a modulo operation on the second private key and the order of the first base point;

[0057] Each second data is encrypted based on the result of the modulo operation to obtain intermediate data corresponding to each second data.

[0058] In a possible implementation manner, the second set determination module is specifically configured to:

[0059] Based on the first public key and the second private key, a negotiated key is generated, and a hash value of the negotiated key is calculated based on a hash function; the first public key is generated based on the first private key and the first base point;

[0060] Using the hash value of the negotiated key as the salt value, respectively calculate the hash value of each second data based on the hash function;

[0061] Based on the second private key and the order of the first base point, the hash values ​​of the second data are encrypted respectively.

[0062] In a fifth aspect, the present application provides a data processing method, the method comprising:

[0063] The first data set is encrypted based on the first private key of the first device to obtain a first encrypted data set, and the first encrypted data set is encrypted based on the second public key of the second device to obtain a first target data set; the second public key is generated based on the second private key of the second device and the first base point; the first base point is generated based on the elliptic curve encryption algorithm;

[0064] Based on the second private key and the first base point, the second data set is encrypted to obtain a second encrypted data set, and the second encrypted data set is encrypted based on the first private key to obtain a second target data set; the first data set and the second data set correspond to the same target business;

[0065] The first target data set and the second target data set are processed by complementation to obtain a data complement.

[0066] In a sixth aspect, the present application provides an electronic device, including:

[0067] A memory for storing program instructions;

[0068] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0069] In a seventh aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0070] In an eighth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0071] Through the technical solutions in one or more of the above embodiments of the embodiments of the present application, the present application has at least the following technical effects:

[0072] In the above method, the second device generates a second public key based on the first base point and the second private key, and sends the second public key to the first device, thereby ensuring the security of the second private key. After encrypting the second data set through the second private key and the first base point, a second encrypted data set is obtained, and the second encrypted data set is sent to the first device, thereby ensuring the transmission security of the second data set. The first device encrypts the first encrypted data set based on the second public key to obtain a first target data set, and encrypts the second encrypted data set based on the first private key to obtain a second target data set, thereby ensuring that the first data set and the second data set are encrypted by the same encryption method, thereby facilitating subsequent complement calculations.

[0073] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0075] Figure 2 A flowchart of a data processing method applied to a first device provided in an embodiment of the present application;

[0076] Figure 3 A structural diagram of a data processing device applied to a first device provided in an embodiment of the present application;

[0077] Figure 4A flowchart of a data processing method applied to a second device provided in an embodiment of the present application;

[0078] Figure 5 A structural diagram of a data processing device applied to a second device provided in an embodiment of the present application;

[0079] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] 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.

[0081] 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.

[0082] 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.

[0083] 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.

[0084] For ease of understanding, the following is an explanation of the technologies involved in this application:

[0085] (1) Private Complementary Set Computation: Assume that A and B are two sets, then the complement of A in B is a set whose elements belong to B but not to A. Privacy complement calculation means that when two parties hold sets A and B respectively, the complement of both sets is calculated through cryptographic protocols and other methods, without leaking the intersection and other data belonging to the party.

[0086] (2) Elliptic Curve: It is a mathematical object consisting of 2 =x 3 +ax+b; elliptic curves are widely used in fields such as cryptography, such as network security, electronic signatures, etc. Compared with traditional encryption algorithms, elliptic curve encryption algorithms have the following advantages: using a smaller key length to achieve the same security level; and can perform efficient operations.

[0087] (3) Elliptic Curve Cryptography (ECC): It is a public key encryption algorithm based on elliptic curve mathematics. It uses the computational difficulty of elliptic discrete logarithms on the Abel additive group formed by rational points on the elliptic curve to achieve encryption and decryption operations. The Elliptic Curve Discrete Logarithm Problem (ECDLP) is the security foundation of the elliptic curve cryptography algorithm. Simply put, given two points P and Q on the elliptic curve, finding an integer k such that P = kQ is a very difficult problem. Therefore, by using the difficulty of the elliptic curve discrete logarithm problem, secure encryption and decryption can be achieved.

[0088] The process of the elliptic curve encryption algorithm mainly includes the following steps:

[0089] Encryption: The sender selects a random number r, calculates the ciphertext C1=M+rK (M is the plaintext) and C2=rG, and then sends the ciphertext C1 and C2 together to the receiver.

[0090] Decryption: After receiving the ciphertext C1, C2, the receiver calculates M′=C1-kC2=M+rK-krG=M+rK-rK=M, where k is the receiver's private key. Therefore, only when the receiver has the private key k can M be decrypted.

[0091] Hash to Curve: It means to calculate the hash value of any number or string and then map it to a point on the elliptic curve. The Hash to Curve operator is usually referred to as Hash. G or H G .

[0092] (4) Elliptic Curve Key Discussion (ECDH): It is a key negotiation protocol based on the elliptic curve encryption algorithm, which defines how keys are generated and exchanged between communicating parties.

[0093] The ECDH protocol process is as follows:

[0094] Party A and Party B use the same elliptic curve to generate their own private and public keys. A's private key is k A , the public key is K A =k A G. B's private key is k B , the public key is K B =k B G, note that A and B need to use the same main parameters, that is, choose the same base point G on the same finite field of the same curve.

[0095] A and B exchange their public keys K through an insecure channel A and K B , the middleman can obtain K A and K B , but if the discrete logarithm problem cannot be solved, k cannot be obtained A and k B .

[0096] A uses its own private key and B's public key to calculate S A =k A K B , B uses its own private key and Alice's public key to calculate S B =k B K A , because S A =k A K B =k A (k B G)=k B (k A G)=k B K A =S B, so the S obtained by both parties is A ,S B are consistent, and the middleman only knows K A and K B and the common parameters of the ellipse, so S cannot be obtained.

[0097] Before introducing the data processing method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0098] With the rapid development of the economy, in order to meet the growing business needs, different institutions usually need to transfer data to obtain complete business data. For example, when two institutions have partial data of the same business at the same time, when one of them performs the corresponding business, it may be necessary for the other party to transfer the data of the business it has saved to itself, in order to obtain the complete data of the business and meet subsequent business requirements. When transmitting data, data security is particularly important. Therefore, in order to prevent the leakage of business data of each institution, the two institutions need a method to ensure the security of data transmission when transmitting data.

[0099] In view of the above problems, an embodiment of the present application provides a business processing method, which includes a first device and a second device, wherein the first device is a party that needs to perform privacy complement calculation on data of a certain business (i.e., target business), and the second device is a party that sends its own business data (i.e., second data set) to the first device so that the first device can perform complement calculation. The first device holds a first data set A of the target business, and the second device holds a second data set B of the target business, and the goal of the first device is to determine the complement of set A in set B.

[0100] In some embodiments, the first data set and the second data set have the same data structure, the first data set includes at least one first data, and the second data set includes at least one second data.

[0101] In some embodiments, when determining the first data set, the first device first receives a first initial data set corresponding to the target business, wherein the first initial data set includes at least one first initial data, and each first initial data includes multiple sub-data corresponding to each primary key; each primary key corresponds to a different attribute parameter of the first initial data; then, for each first initial data, the sub-data in the first initial data are spliced ​​according to a preset arrangement order of the primary keys to obtain the first data corresponding to the first initial data.

[0102] It should be noted that the specific content and arrangement order of the above-mentioned primary keys can be configured based on demand and are not limited in the embodiments of the present application.

[0103] In a specific implementation, the above-mentioned first initial data set can be a table structure, which includes multiple columns corresponding to each primary key, each column corresponds to a different attribute parameter. For example, when the first initial data set is information of multiple objects corresponding to a certain business, each first initial data can correspond to an object, and the columns can include ID (object identification) and AGE (object age), etc.

[0104] For example, when generating the first data set, firstly, the sub-data corresponding to each column is obtained from the first initial data set, and the sub-data corresponding to the ID column is recorded as: id1, id2, ..., id n , record the sub-data corresponding to the AGE column as: age1, age2, …, age n , where id i and age i represents the ID and AGE corresponding to the i-th first initial data, and n is the number of first initial data in the first initial data set. Then, feature concatenation is performed on the sub-data corresponding to each first initial data. Specifically, for each i-th first initial data, the corresponding id i and age i , concatenated in string format, and the space characters at the beginning and end need to be removed during the concatenation process to ensure accuracy.

[0105] In some embodiments, when the arrangement order of the primary keys is ID and AGE, the concatenation process may be: id i ||age i , the first data corresponding to the i-th first initial data can be obtained; wherein || is a concatenation symbol.

[0106] When the second device determines the second data set, the process is similar and will not be elaborated here. It should be noted that in order to ensure the accuracy of subsequent complement calculations, the initial data sets of the first device and the second device need to have the same data structure, and the first device and the second device need to use the same primary key arrangement order when splicing data.

[0107] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the embodiment of the present application provides a data processing method, and the processing process of the method is as follows:

[0108] Step S101, the second device sends a second public key to the first device;

[0109] In some embodiments, before the second device sends the second public key to the first device, it is also necessary to perform a key generation process, that is, to generate a second private key and a second public key corresponding to the second device. At the same time, the first device also needs to generate a first private key and a first public key corresponding to it.

[0110] In the embodiment of the present application, the first public key is generated based on the first private key of the first device and the first base point; the second public key is generated based on the second private key of the second device and the first base point; the first base point is generated based on the elliptic curve encryption algorithm.

[0111] In some embodiments, the first device and the second device can generate their respective public keys and private keys through elliptic curve key negotiation; in a specific implementation, the first device and the second device can select the same first base point G on the same finite field of the same curve based on the same main parameters, and use the same elliptic curve to generate their respective public keys and private keys, that is, the first private key k of the first device A. A , and the first public key is K A =k A G; the second private key of the second device B is k B , and the second public key is K B =k B G.

[0112] Then, the first device and the second device can use the ECDH key negotiation algorithm to send their public key to the other device. Specifically, the first device sends the first public key K A Send it to the second device, and the second device will send the second public key K B Sent to the first device.

[0113] At the same time, after the first device and the second device receive the public key sent by the other device, they can generate a negotiated key S based on their own private key and the received public key. Specifically, the first device can generate a negotiated key based on the first private key and the second public key, that is, key S = k A K B The second device can generate a negotiated key based on the second private key and the first public key, that is, S = k B K A .

[0114] Step S102: The first device encrypts the first data set based on the first private key of the first device to obtain a first encrypted data set;

[0115] In some embodiments, the first device may determine the first encrypted data set based on:

[0116] Based on the first private key and the order of the first base point, each first data in the first data set is encrypted to obtain a first encrypted data set.

[0117] In a specific implementation, a modulo operation may be first performed on the order of the first private key and the first base point; then, each first data may be encrypted based on the result of the modulo operation to obtain first encrypted data corresponding to each first data, and a first encrypted data set may be formed based on each first encrypted data.

[0118] In some embodiments, to further ensure the security of data transmission, when generating the first encrypted data set in the present application, the hash value of each first data can be first calculated based on the hash function, and then the hash value of each first data can be encrypted based on the first private key and the order of the first base point. That is, the first encrypted data in the embodiment of the present application is: kt_a i =hash_a i ·k A mod h; where kt_a i is the i-th first encrypted data in the first encrypted data set, hash_a i is the hash value of the i-th first data in the first data set, and h is the order of the first base point.

[0119] It should be noted that the above hash function is not limited in the embodiments of the present application. In some embodiments, the hash function may be Hash to Curve.

[0120] In a specific implementation, when the hash value of each first data is calculated based on a hash function, the hash value Hash(S) of the above-mentioned negotiated key S can be calculated based on the hash function, and the Hash(S) is used as a salt value to calculate the hash value of each first data based on the hash function.

[0121] Step S103, the first device encrypts the first encrypted data set based on the second public key of the second device to obtain a first target data set;

[0122] In some embodiments, the first device may encrypt each first encrypted data in the first encrypted data set based on the received second public key to obtain the first target data set.

[0123] Step S104: The second device encrypts the second data set based on the second private key and the first base point to obtain a second encrypted data set; the first data set and the second data set are data sets corresponding to the same target business.

[0124] In some embodiments, the second device may determine the second encrypted data set based on:

[0125] Based on the second private key and the order of the first base point, each second data in the second data set is encrypted to obtain an intermediate data set; based on the first base point, the intermediate data set is encrypted to obtain a second encrypted data set.

[0126] In a specific implementation, when generating an intermediate data set, a modulo operation can be first performed on the second private key and the order of the first base point; then, based on the result of the modulo operation, each second data is encrypted separately to obtain intermediate data corresponding to each second data, and an intermediate data set is formed based on each intermediate data.

[0127] In some embodiments, to further ensure the security of data transmission, when generating the intermediate encrypted data set in the present application, the hash value of each second data can be first calculated based on the hash function, and then the hash value of each second data can be encrypted based on the second private key and the order of the first base point. That is, the intermediate data in the embodiment of the present application is: kt_b i =hash_b i ·k B mod h; where kt_b i is the i-th intermediate data in the intermediate data set, hash_b i is the hash value of the i-th second data in the second data set, and h is the order of the first base point.

[0128] It should be noted that the above hash function is not limited in the embodiments of the present application. In some embodiments, the hash function may be Hash to Curve.

[0129] In a specific implementation, when the hash value of each second data is calculated based on the hash function, the hash value Hash(S) of the above-mentioned negotiated key S can be calculated based on the hash function, and the Hash(S) is used as the salt value to calculate the hash value of each second data based on the hash function.

[0130] Step S105, the second device sends a second encrypted data set to the first device;

[0131] In some embodiments, the process of encrypting the intermediate data set based on the first base point to obtain the second encrypted data set and sending the second encrypted data set to the first device can be achieved by performing ECDH key negotiation between the second device and the first device.

[0132] In a specific implementation, the first private key of the first device is used as the key of the first device, the intermediate data set of the second device is used as the key of the second device, ECDH key negotiation is performed between the first device and the second device, the first device sends the first public key to the second device, the second device encrypts each intermediate data in the intermediate data set based on the first base point to obtain a second encrypted data set, and sends the second encrypted data set to the first device.

[0133] Step S106, the first device encrypts the second encrypted data set based on the first private key to obtain a second target data set;

[0134] In some embodiments, the first device encrypts each second encrypted data in the second encrypted data set based on the first private key to obtain a second target data set.

[0135] Step S107: The first device performs complement processing on the first target data set and the second target data set to obtain data complements.

[0136] In some embodiments, after the first device obtains the first target data set and the second target data set, it can perform complement matching calculations on the first target data set and the second target data set to obtain a data complement corresponding to the first device, where the data in the complement belongs to the first target data set but not to the second target data set.

[0137] After obtaining the data complement, since the data in the data complement are all encrypted data, each encrypted data can be decrypted based on the inverse process of the above encryption process to obtain the unencrypted original data. Since the decryption process is the inverse process of the above encryption process, it will not be repeated here.

[0138] After obtaining the original data corresponding to the data complement, each original data can be split separately based on the preset arrangement order of each primary key and the above-mentioned feature splicing rules to obtain the initial data corresponding to each original data (that is, including the sub-data corresponding to each primary key), and generate the corresponding output file based on the initial data corresponding to each original data.

[0139] In the above method, the second device generates a second public key based on the first base point and the second private key, and sends the second public key to the first device, thereby ensuring the security of the second private key. After encrypting the second data set through the second private key and the first base point, a second encrypted data set is obtained, and the second encrypted data set is sent to the first device, thereby ensuring the transmission security of the second data set. The first device encrypts the first encrypted data set based on the second public key to obtain the first target data set, and encrypts the second encrypted data set based on the first private key to obtain the second target data set, thereby ensuring that the first data set and the second data set are encrypted by the same encryption method, thereby facilitating the subsequent complement calculation. At the same time, in this process, since the elliptic curve encryption algorithm used does not require high computing power, the result can be obtained quickly.

[0140] In some embodiments, if the second device also has a need to determine a data complement set, after the first device generates a first encrypted data set, that is, after the above step S102 is executed, the first encrypted data set can be encrypted based on the first base point, and the encrypted set can be sent to the second device. This process can be achieved by performing ECDH key negotiation between the second device and the first device.

[0141] In a specific implementation, the first encrypted data set of the first device is used as the key of the first device, and the second private key of the second device is used as the key of the second device. ECDH key negotiation is performed between the first device and the second device. After the first device encrypts each first encrypted data in the first encrypted data set based on the first base point, the first device sends the encrypted set to the second device, and the second device sends the second public key to the first device.

[0142] After receiving the encrypted first encryption set, the second device encrypts it based on the second private key to obtain a third target data set, and encrypts the intermediate encryption set based on the first public key to obtain a fourth target data set. The fourth target data set and the third target data set are complemented to obtain a data complement corresponding to the second device.

[0143] The specific implementation method of the above process can be found in the first device and will not be repeated here.

[0144] Based on the same inventive concept, the present application embodiment provides a data processing method, which is applied to a first device, please refer to Figure 2 , the method comprising:

[0145] Step S201, receiving a second public key sent by a second device, and encrypting a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0146] Step S202, receiving a second encrypted data set sent by the second device, and encrypting the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target business;

[0147] Step S203, performing complement processing on the first target data set and the second target data set to obtain a data complement.

[0148] For the specific implementation process of the first device performing data processing, see Figure 1 The relevant description will not be repeated here.

[0149] Based on the same inventive concept, the present application embodiment provides a data processing device, which is applied to a first device. Please refer to Figure 3 , the device comprises:

[0150] The first receiving module 301 is used to receive the second public key sent by the second device, and encrypt the first encrypted data set based on the second public key to obtain the first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and the first base point; the first base point is generated based on the elliptic curve encryption algorithm;

[0151] The second receiving module 302 is used to receive a second encrypted data set sent by the second device, and encrypt the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target service;

[0152] The complement processing module 302 is used to perform complement processing on the first target data set and the second target data set to obtain a data complement.

[0153] In a possible implementation, the device further includes a first set determination module, configured to determine the first encrypted data set based on the following method:

[0154] Based on the first private key and the order of the first base point, each first data in the first data set is encrypted to obtain a first encrypted data set.

[0155] In a possible implementation manner, the first set determination module is specifically configured to:

[0156] Performing a modulo operation on the first private key and the order of the first base point;

[0157] Each first data is encrypted based on the result of the modulo operation to obtain first encrypted data corresponding to each first data.

[0158] In a possible implementation manner, the first set determination module is specifically configured to:

[0159] Generate a negotiated key based on the second public key and the first private key, and calculate a hash value of the negotiated key based on a hash function;

[0160] Using the hash value of the negotiated key as a salt value, respectively calculate the hash value of each first data based on a hash function;

[0161] Based on the first private key and the order of the first base point, the hash values ​​of the first data are encrypted respectively.

[0162] In a possible implementation manner, the first data set includes at least one first data; and the first set determination module is further configured to determine the first data set based on the following method:

[0163] Receive a first initial data set corresponding to the target business, wherein the first initial data set includes at least one first initial data, each first initial data includes a plurality of sub-data corresponding to each primary key; each primary key corresponds to a different attribute parameter of the first initial data;

[0164] For each first initial data, the sub-data in the first initial data are concatenated according to the preset arrangement order of the primary keys to obtain the first data corresponding to the first initial data.

[0165] Based on the same inventive concept, the present application embodiment provides a data processing method, which is applied to a second device. Please refer to Figure 4 , the method comprising:

[0166] Step S401, sending a second public key to a first device, so that the first device encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0167] Step S402, sending a second encrypted data set to the first device, so that the first device encrypts the second encrypted data set based on the first private key to obtain a second target data set, and performs complement processing on the first target data set and the second target data set to obtain a data complement; the second encrypted data set is: based on the second private key and the first base point, the second data set is encrypted; the first data set and the second data set correspond to the same target business.

[0168] For the specific implementation process of the second device performing data processing, see Figure 1 The relevant description will not be repeated here.

[0169] Based on the same inventive concept, the present application embodiment provides a data processing device, which is applied to the second device. Please refer to Figure 5 , the device comprises:

[0170] The first sending module 501 is used to send a second public key to a first device, so that the first device encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm;

[0171] The second sending module 502 is used to send a second encrypted data set to the above-mentioned first device, so that the above-mentioned first device encrypts the above-mentioned second encrypted data set based on the above-mentioned first private key to obtain a second target data set, and performs complement processing on the above-mentioned first target data set and the above-mentioned second target data set to obtain a data complement; the above-mentioned second encrypted data set is: based on the above-mentioned second private key and the above-mentioned first base point, the second data set is encrypted; the above-mentioned first data set and the above-mentioned second data set correspond to the same target business.

[0172] In a possible implementation, the device further includes a second set determination module, configured to determine the second encrypted data set based on the following method:

[0173] Based on the second private key and the order of the first base point, encrypt each second data in the second data set to obtain an intermediate data set;

[0174] The intermediate data set is encrypted based on the first base point to obtain the second encrypted data set.

[0175] In a possible implementation manner, the second set determination module is specifically configured to:

[0176] Performing a modulo operation on the second private key and the order of the first base point;

[0177] Each second data is encrypted based on the result of the modulo operation to obtain intermediate data corresponding to each second data.

[0178] In a possible implementation manner, the second set determination module is specifically configured to:

[0179] Based on the first public key and the second private key, a negotiated key is generated, and a hash value of the negotiated key is calculated based on a hash function; the first public key is generated based on the first private key and the first base point;

[0180] Using the hash value of the negotiated key as the salt value, respectively calculate the hash value of each second data based on the hash function;

[0181] Based on the second private key and the order of the first base point, the hash values ​​of the second data are encrypted respectively.

[0182] Based on the same inventive concept, the present application embodiment provides an electronic device, which can realize the functions of the data processing device discussed above. Please refer to Figure 6 The device includes at least one processor 601 and a memory 602 connected to the at least one processor. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 The processor 601 and the memory 602 may be connected via a bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0183] Among them, the processor 601 is the control center of the electronic device, which can use various interfaces and lines to connect various parts of the electronic device, and realize data processing by running or executing instructions stored in the memory 602 and calling data stored in the memory 602. Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes the issuance of instructions. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0184] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the data processing method embodiment can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0185] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0186] In the embodiment of the present application, the memory 602 stores a computer program, and when the program is executed by the processor 601, the processor 601 executes the steps described in the above data processing method.

[0187] Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code is run on a computer, the computer executes any of the data processing methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the data processing 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.

[0188] 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 processing methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the data processing 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.

[0189] 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.

[0190] 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.

[0191] 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.

[0192] 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.

[0193] 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 processing method, characterized in that: Applied to a first device, comprising: Receive a second public key sent by a second device, and encrypt a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm; receiving a second encrypted data set sent by the second device, and encrypting the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target service; The first target data set and the second target data set are subjected to complement processing to obtain a data complement.

2. The method according to claim 1, characterized in that The first encrypted data set is determined based on the following method: Based on the first private key and the order of the first base point, each first data in the first data set is encrypted to obtain a first encrypted data set.

3. The method according to claim 2, characterized in that The encrypting each first data in the first data set based on the first private key and the order of the first base point includes: Performing a modulo operation on the first private key and the order of the first base point; Each first data is encrypted based on the result of the modulo operation to obtain first encrypted data corresponding to each first data.

4. The method according to claim 2, characterized in that The encrypting each first data in the first data set based on the first private key and the order of the first base point includes: Generate a negotiated key based on the second public key and the first private key, and calculate a hash value of the negotiated key based on a hash function; Using the hash value of the negotiated key as a salt value, and calculating the hash value of each first data based on a hash function; Based on the first private key and the order of the first base point, the hash values ​​of the first data are encrypted respectively.

5. The method according to any one of claims 1 to 3, characterized in that: The first data set includes at least one first data; the first data set is determined based on the following method: Receive a first initial data set corresponding to the target business, wherein the first initial data set includes at least one first initial data, each first initial data includes a plurality of sub-data corresponding to each primary key; each primary key corresponds to a different attribute parameter of the first initial data; For each first initial data, the sub-data in the first initial data are concatenated according to the preset arrangement order of the primary keys to obtain the first data corresponding to the first initial data.

6. A data processing method, characterized in that: Applied to the second device, comprising: Sending a second public key to a first device, so that the first device encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm; A second encrypted data set is sent to the first device, so that the first device encrypts the second encrypted data set based on the first private key to obtain a second target data set, and performs complement processing on the first target data set and the second target data set to obtain a data complement; the second encrypted data set is obtained by encrypting the second data set based on the second private key and the first base point; the first data set and the second data set correspond to the same target business.

7. The method according to claim 6, characterized in that The second encrypted data set is determined based on the following method: Based on the second private key and the order of the first base point, encrypt each second data in the second data set to obtain an intermediate data set; The intermediate data set is encrypted based on the first base point to obtain the second encrypted data set.

8. The method according to claim 7, characterized in that The encrypting each second data in the second data set based on the second private key and the order of the first base point includes: Performing a modulo operation on the second private key and the order of the first base point; Each second data is encrypted based on the result of the modulo operation to obtain intermediate data corresponding to each second data.

9. The method according to claim 7, characterized in that The encrypting each second data in the second data set based on the second private key and the order of the first base point includes: Based on the first public key and the second private key, a negotiated key is generated, and a hash value of the negotiated key is calculated based on a hash function; the first public key is generated based on the first private key and the first base point; Using the hash value of the negotiated key as a salt value, and calculating the hash value of each second data based on a hash function; Based on the second private key and the order of the first base point, the hash values ​​of the second data are encrypted respectively.

10. A data processing method, characterized in that: The method comprises: The first data set is encrypted based on the first private key of the first device to obtain a first encrypted data set, and the first encrypted data set is encrypted based on the second public key of the second device to obtain a first target data set; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm; Based on the second private key and the first base point, encrypt the second data set to obtain a second encrypted data set, and encrypt the second encrypted data set based on the first private key to obtain a second target data set; the first data set and the second data set correspond to the same target business; The first target data set and the second target data set are subjected to complement processing to obtain a data complement.

11. A data processing device, characterized in that: Applied to a first device, comprising: A first receiving module is configured to receive a second public key sent by a second device, and encrypt a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm; a second receiving module, configured to receive a second encrypted data set sent by the second device, and encrypt the second encrypted data set based on the first private key to obtain a second target data set; the second encrypted data set is obtained by encrypting the second data set by the second device based on the second private key and the first base point; the first data set and the second data set correspond to the same target service; The complement processing module is used to perform complement processing on the first target data set and the second target data set to obtain a data complement.

12. A data processing device, characterized in that: Applied to the second device, comprising: A first sending module, configured to send a second public key to a first device, so that the first device encrypts a first encrypted data set based on the second public key to obtain a first target data set; the first encrypted data set is obtained by the first device encrypting the first data set based on the first private key of the first device; the second public key is generated based on the second private key of the second device and a first base point; the first base point is generated based on an elliptic curve encryption algorithm; The second sending module is used to send a second encrypted data set to the first device, so that the first device encrypts the second encrypted data set based on the first private key to obtain a second target data set, and performs complement processing on the first target data set and the second target data set to obtain a data complement; the second encrypted data set is: the second data set is encrypted based on the second private key and the first base point; the first data set and the second data set correspond to the same target business.

13. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-10 according to the obtained program instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 10.

15. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN112637836A

  • Secure transmission method and device for privacy data and financial privacy data

    CN115643113A

  • Key negotiation method and device, electronic equipment and computer readable storage medium

    CN115766006A

  • Block chain key generation method and device, equipment, medium and product

    CN118316601A

  • Processor with an elliptic curve cryptographic algorithm and a data processing method thereof

    US20230085569A1