A method, device and storage medium for realizing high-frequency privacy query on a blockchain
By utilizing the DH encryption algorithm and private key management in the blockchain network, the low performance and query permission binding issues of high-frequency privacy intersection schemes are resolved, achieving an efficient and secure privacy query process. It supports dynamic data management and key updates, making it suitable for privacy queries in the financial field.
Patent Information
- Application Number
- CN202310063740.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-11
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-01-11
AI Technical Summary
Existing privacy-preserving intersection schemes based on DH technology suffer from low performance and high network overhead during high-frequency queries in blockchain networks. Furthermore, query permissions are deeply tied to existing data, making it impossible to complete the query process without data.
Both the querying party and the queried party generate compliant business private keys, encrypt the data using the DH encryption algorithm, and upload the encrypted dataset to the blockchain network. The querying party encrypts the query results using the private key, restricts the query scope, supports dynamic appending and deletion of ciphertext, and updates the key to control timeliness.
It enables efficient high-frequency privacy queries, limits the scope of information accessed by the queryer, supports physical separation of the queryer and data owner, meets financial regulatory requirements, reduces the risk of information leakage, and optimizes on-chain data management.
Smart Images

Figure CN116032647B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and in particular to a method, apparatus, and storage medium for realizing high-frequency privacy queries on a blockchain. Background Technology
[0002] Currently, there are privacy-preserving intersection schemes based on various cryptographic techniques, among which the intersection scheme based on Dexterity (DH) technology has the best communication performance. A classic two-way DH privacy-preserving intersection scheme is as follows: Figure 1 As shown, both parties encrypt all data and send it to each other; 2. Party X encrypts the received ciphertext again and sends it to Party Y; 3. Party Y obtains the corresponding data based on the ciphertext collision.
[0003] The existing solutions utilize blockchain networks to complete the process, but none apply it to privacy-preserving query processes to protect the data of the queried party. Furthermore, each intersection request requires multiple transmissions and receptions of encrypted full data, significantly increasing network load. This results in low performance and high network overhead in high-frequency query scenarios. On the other hand, in the current process, the query party's query permissions are deeply tied to existing data; other nodes cannot complete the query process without data. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus and storage medium for realizing high-frequency privacy intersection on a blockchain, thereby solving the aforementioned problems existing in the prior art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] The first objective of this invention is to provide a method for achieving high-frequency privacy-preserving intersection on a blockchain, comprising the following steps:
[0007] S1, the querying party I and the queried party encrypt the original data and upload it to the blockchain network:
[0008] S11, the querying party I and the queried party generate business private keys of the required length in a secure manner, wherein the private key of the querying party I is key1 and the private key of the queried party is key2.
[0009] S12, the querying party I uses the encryption algorithm that satisfies the DH encryption characteristics agreed upon with the querying party, and uses the private key key1 to encrypt the original data, and generates dataset 1 in the manner of index and ciphertext;
[0010] S13, Query party I sends the generated dataset 1 to the queried party;
[0011] S14, the queried party uses private key2 to encrypt all the ciphertext again, and generates dataset 2 according to the index and ciphertext.
[0012] S15, the queried party sends dataset 2 to the blockchain network, and after node consensus, it is stored in the blockchain network; the queried party I will notify through the blockchain network to confirm that the secret data has been uploaded to the chain;
[0013] S2, Inquiry party II conducts privacy inquiry service:
[0014] S21, the querying party II sends the request for the business data to be queried to the querying party in a confidential manner;
[0015] S22, the party being queried prepares the associated business data based on the received query information, i.e. the business data to be queried;
[0016] S23, the queried party uses private key key2 to encrypt the business data associated in step S22, obtains dataset 3, and sends it to the queried party II;
[0017] S24, Query party II uses private key key1 to encrypt each ciphertext in dataset 3 to obtain dataset 4;
[0018] S25, Query party II obtains dataset 2 from the blockchain network, compares dataset 4 with dataset 2 stored in the blockchain network, and records the indexes corresponding to the ciphertexts that have intersection.
[0019] S26. Based on the index records recorded in step S25, query party II can obtain the final query result based on the original dataset 1.
[0020] Preferably, step S12 specifically includes:
[0021] a) Prepare the raw data, including {element1, element2, ...};
[0022] b) Based on the contents of the set, create an index table for each element of the set. The indexes only need to be one-to-one and non-repeating.
[0023] c) Use the DH encryption algorithm to encrypt each index value with the private key to obtain a new index table, i.e., dataset 1.
[0024] Preferably, the DH algorithm is as follows:
[0025] i) Use a secure hash algorithm to map index values to elliptic curves;
[0026] ii) Calculate the secret value s1 = key1 * h1, where h1 is a point on the elliptic curve and s1 is obtained by multiplying the private key;
[0027] As mentioned above, the same index value will map to the same point on the same elliptic curve. At the same time, for any point h, k1*k2*h = k2*k1*h, which satisfies the encrypted exchange property.
[0028] Preferably, the method further includes:
[0029] S3, The querying party expands the original dataset.
[0030] S31, Query I prepares incremental data and completes the index numbering of the incremental data to obtain dataset N0;
[0031] S32, Query party I encrypts the incremental data with private key key1 to obtain the newly added dataset N1;
[0032] S33, send dataset N1 to the queried party;
[0033] S34, the queried party encrypts the data in dataset N1 with private key key2 and retains the received index information to obtain dataset N2;
[0034] S35, send an append data request to the blockchain network to append N2 to the existing dataset 2.
[0035] Preferably, it also includes:
[0036] S4. Query party III deletes part of the original dataset;
[0037] This process only requires the querying party to send the index information and deletion request together to the blockchain network, and then delete the ciphertext corresponding to the index information.
[0038] Preferably, the process further includes:
[0039] S5, Key Update
[0040] The key update process only requires repeating step S1, where the querying party uses the new key key3 and the queried party uses the new key key4 to proceed with the subsequent process, and the original ciphertext in the blockchain network is replaced with the ciphertext encrypted with key3 and key4.
[0041] Preferably, in steps S1 and S2, query party I and query party II can be the same user or different users. If they are different users, then query party II in step S2 does not need the original data, but only needs to query the relevant information from query party I in the final stage of S2.
[0042] Another object of the present invention is to provide an apparatus for realizing high-frequency privacy intersection on a blockchain, the apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it performs the method for realizing high-frequency privacy intersection on a blockchain as described in the first object.
[0043] The final objective of this invention is to provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the method for implementing high-frequency privacy intersection on a blockchain as described in the first objective.
[0044] The beneficial effects of this invention are:
[0045] This invention provides a method, apparatus, and storage medium for high-frequency privacy intersection on a blockchain. The content that the querying party previously needed to encrypt and send is now stored on the blockchain, eliminating the need to send the full encrypted data each time a privacy intersection is performed. Privacy intersection technology is used to limit the scope of information accessed by the querying party; the querying party cannot obtain data outside their original data set, which is particularly beneficial in the financial sector by restricting access to information from unrelated parties, thus meeting financial regulations. The original data owner and the querying party can be physically separated, enabling lightweight deployment. With proper deployment, the querying party can complete the business process even on mobile devices. During the process, all content interacting through the blockchain is encrypted with the respective private keys, ensuring that the corresponding content can be publicly sent without leaking the original text. On-chain ciphertext can be dynamically appended and deleted without requiring the full data for each update. Through the key update process, the timeliness of ciphertext use can be effectively controlled, significantly reducing the chance of information leakage. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of a classic two-way Deutsche Welle privacy intersection scheme in existing technology;
[0047] Figure 2 This is a schematic diagram of the query party's secret data being uploaded to the blockchain, as provided in Example 1;
[0048] Figure 3 This is a schematic diagram of the privacy query process provided in Example 1. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0050] Example 1
[0051] This embodiment provides a method for implementing high-frequency privacy intersection on a blockchain, including the following steps:
[0052] S1, the querying party I and the queried party encrypt the original data and upload it to the blockchain network, such as... Figure 2 As shown:
[0053] S11, the querying party I and the queried party generate business private keys of the required length in a secure manner, wherein the querying party's private key is key1 and the queried party's private key is key2.
[0054] S12, the querying party I uses the encryption algorithm that satisfies the DH encryption characteristics agreed upon with the querying party, and uses the private key key1 to encrypt the original data, and generates dataset 1 in the manner of index and ciphertext;
[0055] a) Prepare the raw data, for example, the raw data is {Company 1 information, Company 2 information, ...}
[0056] b) Based on the content of the set, create an index table for each element in the set. The indexing method only needs to ensure a one-to-one correspondence without repetition. One feasible approach is to create the index based on the position of the set elements, thus obtaining the original dataset.
[0057] index Index value 0 Company 1 Information 1 Company 2 Information …… ……
[0058] c) Use the DH encryption algorithm to encrypt each index value with the private key to obtain a new index table, i.e., dataset 1.
[0059] index Cipher 0 Ciphertext 1 1 Ciphertext 2 …… ……
[0060] The DH encryption algorithm used in this embodiment is described as follows:
[0061] i) Use a secure hash algorithm to map the index value to an elliptic curve, for example, h1 = H (company 1 information), where H means that the value is first hashed and then the hash value is mapped to a point on the elliptic curve.
[0062] ii) Calculate the secret value s1 = key1 * h1, where h1 is a point on the elliptic curve and s1 is obtained by multiplying the private key.
[0063] As described above, the same index value will map to the same point on the elliptic curve. Furthermore, for any point h, k1*k2*h = k2*k1*h, which satisfies the encrypted exchange property.
[0064] After encryption, for example, ciphertext 1 = key1 * H (company 1 information)
[0065] S13, Query party I sends the generated dataset 1 to the queried party;
[0066] S14, the queried party uses private key2 to re-encrypt all ciphertexts, generating dataset 2 according to the index and ciphertext; the encryption method in this process is the same as in 1.2, but the new ciphertext must be at the original index. For example, ciphertext 1* is obtained by encrypting ciphertext 1.
[0067]
[0068]
[0069] S15, the queried party sends dataset 2 to the blockchain network, and after node consensus, it is stored in the blockchain network; the queried party I will notify through the blockchain network to confirm that the secret data has been uploaded to the chain;
[0070] S2, Inquiry party II conducts privacy inquiry services, such as Figure 3 As shown:
[0071] S21, the querying party II sends the request for the business data to be queried to the querying party in a confidential manner;
[0072] It is feasible to obfuscate the data to be queried using salting technology, and the query message can be made public;
[0073] It is feasible to use the TLS encrypted transmission protocol for secure communication, and the query content is encrypted and not disclosed.
[0074] S22, the party being queried prepares the associated business data based on the received query information, i.e. the business data to be queried;
[0075] S23, the queried party uses private key2 to encrypt the business data associated in step S22 to obtain dataset 3. The encryption method is the same as in S12. The dataset in this process does not require index information, allowing the sender to freely arrange the data in dataset 3 and send it to the queried party II.
[0076] S24, Query party II uses private key key1 to encrypt each ciphertext in dataset 3 to obtain dataset 4; the encryption method is the same as the encryption method in step S12.
[0077] S25, Query party II obtains dataset 2 from the blockchain network, compares dataset 4 with dataset 2 stored in the blockchain network, and records the indexes corresponding to the ciphertexts that have intersection, as shown in the table below;
[0078]
[0079] S26. Based on the index records recorded in step S25, query party II can obtain the final query result based on the original dataset 1.
[0080] Throughout the process, the querying party cannot access data outside the original dataset, thus limiting the scope of the query results. Furthermore, if multiple queries are made for different business data, the querying party II does not need to transmit the full dataset.
[0081] On the other hand, the query request can include one or more companies. Since the protocol is optimized and there is no need to send all of its own data, multiple companies can be queried one by one.
[0082] The method also includes:
[0083] S3, Query side I expands the original dataset stream
[0084] S31, Query I prepares incremental data and completes the index numbering of the incremental data to obtain dataset N0;
[0085] S32, Query party I encrypts the incremental data with private key key1 to obtain the newly added dataset N1;
[0086] S33, send dataset N1 to the queried party;
[0087] S34, the queried party encrypts the data in dataset N1 with private key key2 and retains the received index information to obtain dataset N2;
[0088] S35, send an append data request to the blockchain network to append N2 to the existing dataset 2.
[0089] This method also includes:
[0090] S4. Query Component III's process of deleting part of the original dataset.
[0091] This process only requires query party III to send the index information and deletion request together to the blockchain network, and then delete the ciphertext corresponding to the index information.
[0092] Since a fixed company always corresponds to a fixed ciphertext, if it is queried multiple times, although the ciphertext cannot be directly deciphered, some information about the company can be analyzed. Therefore, updating the key can effectively keep the ciphertext fresh and secure.
[0093] Queries III and Queries II have the same scope; both are unspecified queries.
[0094] This method also includes:
[0095] S5, Key Update
[0096] The key update process only requires repeating step S1, that is, the querying party I uses the new key key3, and the queried party uses the new key key4 to carry out the subsequent process, and replaces the original ciphertext in the blockchain network with the ciphertext encrypted by key3 and key4.
[0097] In steps S1 and S2, query party I and query party II can be the same user, such as the tax bureau; or they can be different users, such as ICBC and its branches. If they are different users, then query party II in step S2 does not need the original data, but only needs to query the relevant information from query party I in the final stage of S2.
[0098] By adopting the above-disclosed technical solution of this invention, the following beneficial effects are obtained:
[0099] This invention stores the encrypted content that the querying party previously needed to send on the blockchain; it uses privacy intersection technology to limit the scope of information accessed by the querying party, preventing them from obtaining data outside their original data set; under the new scheme, the querying party and the original data owner can be physically deployed separately. The new scheme improves the on-chain data management mechanism, allowing for dynamic addition and deletion of information to dynamically maintain the dataset; the solution provided in this invention also improves the key update process and completes the ciphertext update, increasing system security.
[0100] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for achieving high-frequency privacy intersection on a blockchain, characterized in that, Includes the following steps: S1, the querying party and the queryee encrypt the original data and upload it to the blockchain network: S11, the querying party I and the queried party generate business private keys of the required length in a secure manner, wherein the querying party's private key is key1 and the queried party's private key is key2. S12, the querying party I uses the encryption algorithm that satisfies the DH encryption characteristics agreed upon with the querying party, and uses the private key key1 to encrypt the original data, and generates dataset 1 in the manner of index and ciphertext; S13, Query party I sends the generated dataset 1 to the queried party; S14, the queried party uses private key2 to encrypt all the ciphertext again, and generates dataset 2 according to the index and ciphertext. S15, the queried party sends dataset 2 to the blockchain network, and after node consensus, it is stored in the blockchain network; the queried party I will notify through the blockchain network to confirm that the secret data has been uploaded to the chain; S2, Inquiry party II conducts privacy inquiry service: S21, the querying party II sends the request for the business data to be queried to the querying party in a confidential manner; S22, the party being queried prepares the associated business data based on the received query information, i.e. the business data to be queried; S23, the queried party uses private key key2 to encrypt the business data associated in step S22, obtains dataset 3, and sends it to the queried party II; S24, Query party II uses private key key1 to encrypt each ciphertext in dataset 3 to obtain dataset 4; S25, Query party II obtains dataset 2 from the blockchain network, compares dataset 4 with dataset 2 stored in the blockchain network, and records the indexes corresponding to the ciphertexts that have intersection. S26, Based on the index records recorded in step S25, query party II can obtain the final query result based on the original dataset 1; Step S12 specifically includes: a) Prepare the raw data, including {element1, element2, ...}; b) Based on the contents of the set, create an index table for each element of the set. The indexes only need to be one-to-one and non-repeating. c) Use the DH encryption algorithm to encrypt each index value with the private key to obtain a new index table, i.e., dataset 1.
2. The method for achieving high-frequency privacy intersection on a blockchain according to claim 1, characterized in that, The DH algorithm is specifically as follows: i) Use a secure hash algorithm to map index values to elliptic curves; ii) Calculate the secret value s1 = key1 * h1, where h1 is a point on the elliptic curve, and s1 is obtained by multiplying the private key. As mentioned above, the same index value will be mapped to the same point on the elliptic curve. At the same time, for any point h, key1*key2*h = key2*key1*h, which satisfies the encrypted exchange property.
3. The method for achieving high-frequency privacy intersection on a blockchain according to claim 1, characterized in that, The method also includes: S3, Query side I expands the original dataset; S31, Query I prepares incremental data and completes the index numbering of the incremental data to obtain dataset N0; S32, Query party I encrypts the incremental data with private key key1 to obtain the newly added dataset N1; S33, send dataset N1 to the queried party; S34, the queried party encrypts the data in dataset N1 with private key key2 and retains the received index information to obtain dataset N2; S35, send an append data request to the blockchain network to append N2 to the existing dataset 2.
4. The method for achieving high-frequency privacy intersection on a blockchain according to claim 1, characterized in that, Also includes: S4. Query party III deletes part of the original dataset; This process only requires query party III to send the index information and deletion request together to the blockchain network, and then delete the ciphertext corresponding to the index information.
5. The method for achieving high-frequency privacy intersection on a blockchain according to claim 1, characterized in that, Also includes: S5, Key Update: The key update process only requires repeating step S1, that is, the querying party I uses the new key key3, and the queried party uses the new key key4 to carry out the subsequent process, and replaces the original ciphertext in the blockchain network with the ciphertext encrypted by key3 and key4.
6. The method for achieving high-frequency privacy intersection on a blockchain according to claim 1, characterized in that, In steps S1 and S2, query party I and query party II can be the same user or different users. If they are different users, then query party II in step S2 does not need the original data, but only needs to query the relevant information from query party I in the final stage of S2.
7. A device for realizing high-frequency privacy intersection on a blockchain, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the method for implementing high-frequency privacy intersection on a blockchain as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method for implementing high-frequency privacy intersection on a blockchain as described in any one of claims 1-6.