A two-way hidden data query method and device

By using auxiliary information in query requests and feedback results to represent the unique identification of the information to be queried, the probability problem of privacy leakage in the prior art is solved, and the complete concealment effect of two-way hidden data query is achieved, and security and privacy are improved.

CN114091054BActive Publication Date: 2025-04-01WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111292880.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2025-04-01
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

The existing technology hidden query methods have the probability of privacy leakage, and the hidden effect of query parties and data parties is probabilistic, resulting in poor security and privacy.

Method used

By using the first auxiliary information in the query request to represent the first unique identifier of the information to be queried, instead of directly including it in the query request, and does not include the decryption key in the feedback result of the data party, but only contains the ciphertext and the decryption index corresponding to the plaintext, so as to achieve complete data concealment between the query party and the data party.

Benefits of technology

It realizes complete data concealment between the query party and the data party, improves security and privacy during the query process, and avoids the probability of information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114091054B_ABST
    Figure CN114091054B_ABST
Patent Text Reader

Abstract

The present invention discloses a two-way hidden data query method and device, comprising: the query party determines the query request based on the first unique identifier of the information to be queried, and sends it to the data party; the query request includes the first auxiliary information; the first auxiliary information is determined according to the first unique identifier; the feedback result sent by the data party is received; the feedback result includes each ciphertext in the data party and the decryption index corresponding to each ciphertext; each ciphertext is obtained by the data party encrypting each plaintext according to the encryption key corresponding to each plaintext; the encryption key corresponding to each plaintext is determined according to the second auxiliary information of each plaintext; the second auxiliary information is determined by the data party according to the first auxiliary information and the second unique identifier; the decryption key is determined according to the decryption index, and the ciphertext is decrypted according to the decryption key; the successfully decrypted plaintext is determined as the query result. In this way, the data between the query party and the data party are completely hidden, and the security and privacy in the query process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology (Fintech), and in particular to a two-way hidden data query method and device. Background Art

[0002] With the development of computer technology, more and more technologies (such as blockchain, cloud computing or big data) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and big data technology is no exception. However, due to the security and real-time requirements of the financial and payment industries, higher requirements are also placed on the data anonymity of big data technology.

[0003] The hidden query method of the prior art is that the query party initiates a query request with obfuscated information and information to be queried; then the data party encrypts the plaintext corresponding to the obfuscated data and the information to be queried to obtain each ciphertext, and sends the private key and ciphertext corresponding to each ciphertext to the query party as feedback results; finally, the query party decrypts each ciphertext using the private key to obtain the plaintext corresponding to the information to be queried.

[0004] However, the query request in the prior art includes information to be queried, which makes the query party have the probability of privacy leakage, that is, the concealment effect of the query party is probabilistic; the feedback result of the data party includes the ciphertext corresponding to the plaintext, and there is a probability that the plaintext corresponding to the ciphertext can be decrypted by the private key, resulting in information leakage, that is, the concealment effect of the data party is probabilistic; therefore, the security and privacy of the current hidden query method are poor, and there are security risks. Summary of the invention

[0005] The embodiment of the present invention provides a two-way hidden data query method and device, which are used to eliminate probabilistic security and privacy, realize complete data hiding between the query party and the data party, and improve the security and privacy during the query process.

[0006] In a first aspect, an embodiment of the present invention provides a two-way hidden data query method, comprising:

[0007] The querying party determines a query request based on the first unique identifier of the information to be queried, and sends the query request to the data party; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0008] The querying party receives the feedback result sent by the data party; the feedback result includes the ciphertexts corresponding to the plaintexts in the data party and the decryption indexes corresponding to the ciphertexts; the ciphertexts are obtained by the data party encrypting the plaintexts according to the encryption keys corresponding to the plaintexts; the encryption keys corresponding to the plaintexts are determined according to the second auxiliary information of the plaintexts; the second auxiliary information of the plaintexts is determined by the data party according to the first auxiliary information and the second unique identifier of the plaintexts; when the first unique identifier is consistent with the second unique identifier, the first unique identifier and the second unique identifier are offset;

[0009] For any ciphertext, the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypts the ciphertext according to the decryption key of the ciphertext;

[0010] The querying party determines the successfully decrypted plaintext as the query result.

[0011] In the above technical solution, the query request includes the first auxiliary information determined according to the first unique identifier, that is, the query request does not include the first unique identifier of the information to be queried, thereby achieving complete concealment of the query request of the query party, preventing the leakage of the first unique identifier, and improving the privacy and security of the query request; the feedback result determined by the data party does not include the decryption key, thereby avoiding the situation where information leakage due to the decryption of the ciphertext is avoided. At the same time, the feedback result of the data party includes the ciphertext of all the plaintext of the data party. By including the first unique identifier and the second unique identifier in the encryption key, the query party can only decrypt the ciphertext corresponding to the plaintext it queried, thereby improving the privacy and security of the data party.

[0012] Optionally, the querying party determines the query request based on the first unique identifier of the information to be queried, including:

[0013] The querying party determines the first public key of the querying party and the second public key of the querying party according to the public key, the first private key of the querying party and the second private key of the querying party;

[0014] The querying party determines the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier;

[0015] The querying party generates a query request, wherein the query request includes the first public key, the second public key, and the first auxiliary information.

[0016] In the above technical solution, the query request includes the first auxiliary information determined according to the first unique identifier, which is equivalent to representing the first unique identifier of the information to be queried through the first auxiliary information. That is to say, the query request does not include the first unique identifier of the information to be queried. Therefore, the query request of the inquirer is completely concealed, the leakage of the first unique identifier is prevented, and the privacy and security of the query request are improved.

[0017] Optionally, the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, including:

[0018] The decryption index of the ciphertext is determined according to the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the second public key;

[0019] The querying party converts the decryption index into the decryption key of the ciphertext based on the second private key; or the decryption index of the ciphertext is determined according to the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the first public key;

[0020] The querying party converts the decryption index into a decryption key of the ciphertext based on the first private key or the second private key.

[0021] In the above technical solution, the second auxiliary information includes the first auxiliary information and the second unique identifier, and the first auxiliary information includes the first unique identifier, which is equivalent to the second auxiliary information including the second unique identifier and the first unique identifier, that is, the encryption key includes the first unique identifier and the second unique identifier. When the first unique identifier and the second unique identifier are consistent, the first unique identifier and the second unique identifier are offset, so that the encryption key only includes the public key of the query party and the private key of the query party, and the decryption key converted by the query party through the decryption index also includes the public key of the query party and the private key of the query party; because the public key of the query party is determined by the private key of the query party, the encryption key only includes the private key of the query party, and the decryption key converted by the query party through the decryption index also includes the private key of the query party; thereby making the encryption key and the decryption key correspond to each other, that is, the query party can only decrypt the ciphertext corresponding to the plaintext of the information to be queried, thereby improving the privacy and security of the data party.

[0022] Optionally, the feedback result also includes a first hash value of an encryption key corresponding to each ciphertext;

[0023] The querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypts the ciphertext according to the decryption key of the ciphertext, including:

[0024] The querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext;

[0025] The querying party determines a second hash value of a decryption key of the ciphertext;

[0026] The querying party determines a second hash value that is consistent with the first hash value, and decrypts the ciphertext corresponding to the first hash value according to the second hash value.

[0027] In the above technical solution, by determining the first hash value and the second hash value, the ciphertext corresponding to the information to be queried can be determined without repeatedly decrypting other ciphertexts, thereby reducing the amount of calculation and increasing query efficiency.

[0028] In a second aspect, an embodiment of the present invention provides a two-way hidden data query method, comprising:

[0029] The data subject obtains a query request; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0030] For any plaintext, the data party determines the second auxiliary information of the plaintext based on the first auxiliary information, according to the second unique identifier of the plaintext and the public key;

[0031] The data party determines the encryption key of the plaintext and the decryption index of the ciphertext corresponding to the plaintext according to the second auxiliary information;

[0032] The data party encrypts the plaintext according to the encryption key to obtain a ciphertext;

[0033] The data party determines the decryption index and the ciphertext of each ciphertext as a feedback result, and sends the feedback result to the query party.

[0034] In the above technical solution, the feedback result determined by the data party does not include the decryption key, thereby avoiding information leakage due to the decryption of the ciphertext. The feedback result of the data party includes the ciphertext of all the plaintexts of the data party. By including the first unique identifier and the second unique identifier in the encryption key, the querying party can only decrypt the ciphertext corresponding to the plaintext it queried, thereby improving the privacy and security of the data party.

[0035] Optionally, the data party determines, according to the second auxiliary information, an encryption key of the plaintext and a decryption index of a ciphertext corresponding to the plaintext, including:

[0036] For any plaintext, the data party generates a first random number and a second random number;

[0037] The data party determines the encryption key based on the second auxiliary information according to any public key of the query party, the first random number and the second random number;

[0038] The data party determines the decryption index based on the public key, according to another public key of the query party, the first random number and the second random number.

[0039] In the above technical solution, the association and uniqueness between the plaintext and the encryption key are guaranteed by random numbers, and the security of the encryption key is guaranteed.

[0040] Optionally, the data party determines the decryption index and ciphertext of each plaintext as a feedback result, including:

[0041] For any plaintext, the data party determines a first hash value of an encryption key of the plaintext;

[0042] The data party takes the first hash value of the encryption key of the plaintext, the decryption index and the ciphertext as a tuple;

[0043] The data party determines each tuple as a feedback result.

[0044] In the above technical solution, the first hash value of the encryption key corresponding to the plaintext, the decryption index and the ciphertext are taken as a tuple, which increases the correlation between the first hash value, the decryption index and the ciphertext, improves the decryption efficiency of the query party, and thus improves the query efficiency.

[0045] In a third aspect, an embodiment of the present invention provides a two-way hidden data query device, comprising:

[0046] A determination module, configured to determine a query request based on a first unique identifier of the information to be queried, and send the query request to the data party; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0047] For any ciphertext, determine the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypt the ciphertext according to the decryption key of the ciphertext;

[0048] Determine the successfully decrypted plaintext as the query result;

[0049] A receiving module is used to receive the feedback results sent by the data party; the feedback results include the ciphertexts corresponding to the plaintexts in the data party and the decryption indexes corresponding to the ciphertexts; the ciphertexts are obtained by the data party encrypting the plaintexts according to the encryption keys corresponding to the plaintexts; the encryption keys corresponding to the plaintexts are determined according to the second auxiliary information of the plaintexts; the second auxiliary information of the plaintexts is determined by the data party according to the first auxiliary information and the second unique identifier of the plaintexts.

[0050] Optionally, the determining module is specifically used to:

[0051] Determine the first public key of the querying party and the second public key of the querying party according to the public key, the first private key of the querying party and the second private key of the querying party;

[0052] Determine the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier;

[0053] A query request is generated, where the query request includes the first public key, the second public key, and the first auxiliary information.

[0054] Optionally, the determining module is specifically used to:

[0055] The decryption index of the ciphertext is determined according to the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the second public key;

[0056] Based on the second private key, the decryption index is converted into a decryption key of the ciphertext; or the decryption index of the ciphertext is determined according to the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the first public key;

[0057] The decryption index is converted into a decryption key of the ciphertext based on the first private key or the second private key.

[0058] Optionally, the feedback result also includes a first hash value of an encryption key corresponding to each ciphertext;

[0059] The determination module is specifically used for:

[0060] Determining a decryption key for the ciphertext according to a decryption index of the ciphertext;

[0061] Determining a second hash value of a decryption key for the ciphertext;

[0062] Determine a second hash value that is consistent with the first hash value, and decrypt the ciphertext corresponding to the first hash value according to the second hash value.

[0063] In a fourth aspect, an embodiment of the present invention provides a two-way hidden data query device, comprising:

[0064] An acquiring unit, configured to acquire a query request; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0065] a processing unit, configured to determine, for any plaintext, second auxiliary information of the plaintext based on the first auxiliary information and according to a second unique identifier and a public key of the plaintext;

[0066] Determine, according to the second auxiliary information, an encryption key of the plaintext and a decryption index of a ciphertext corresponding to the plaintext;

[0067] Encrypt the plaintext according to the encryption key to obtain a ciphertext;

[0068] The decryption index and the ciphertext of each ciphertext are determined as feedback results, and the feedback results are sent to the querying party.

[0069] Optionally, the processing unit is specifically used for:

[0070] For any plaintext, generate a first random number and a second random number;

[0071] Based on the second auxiliary information, determine the encryption key according to any public key of the querying party, the first random number, and the second random number;

[0072] Based on the public key, the decryption index is determined according to another public key of the querying party, the first random number and the second random number.

[0073] Optionally, the processing unit is specifically used for:

[0074] For any plaintext, determine a first hash value of an encryption key of the plaintext;

[0075] Taking the first hash value of the encryption key of the plaintext, the decryption index and the ciphertext as a tuple;

[0076] Each tuple is determined as a feedback result.

[0077] In a fifth aspect, an embodiment of the present invention further provides a computer device, including:

[0078] A memory for storing program instructions;

[0079] The processor is used to call the program instructions stored in the memory and execute the above-mentioned two-way hidden data query method according to the obtained program.

[0080] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned bidirectional hidden data query method. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0082] Figure 1 A schematic diagram of a system architecture provided by an embodiment of the present invention;

[0083] Figure 2 A schematic diagram of a flow chart of a two-way hidden data query method provided by an embodiment of the present invention;

[0084] Figure 3 A schematic diagram of a flow chart of a two-way hidden data query method provided by an embodiment of the present invention;

[0085] Figure 4 A schematic diagram of the structure of a two-way hidden data query device provided by an embodiment of the present invention;

[0086] Figure 5 A schematic diagram of the structure of a bidirectional hidden data query device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0087] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0088] In the prior art, in order to prevent the data of both parties of data interaction (i.e., the query party and the data party) from being stolen or leaked, the privacy and security of both parties of data interaction are generally achieved through a two-way hidden query method.

[0089] For example, the two parties of data interaction are the query party and the data party; the query party is used to query the deposit corresponding to the user name ID; the data party is used to receive the query request including the user name ID sent by the query party, and return the deposit data corresponding to the user name ID to the query party; in order to better illustrate the two-way hidden query method in the prior art, a specific example will be used as an example below, and the specific process is as follows:

[0090] S1.1. The querying party determines that the user name to be queried is 1001;

[0091] S1.2, the querying party randomly selects four obfuscated user names, namely: 1002, 1003, 1004 and 1005, to obfuscate the querying user name 1001;

[0092] S1.3, performing hash operations on the query user name 1001 and the obfuscated user names 1002, 1003, 1004, and 1005, and obtaining corresponding hash values, which are h(1001), h(1002), h(1003), h(1004), and h(1005), respectively;

[0093] S1.4. Take a hash value of a preset number of digits to represent the user name, such as taking the first seven digits of h(1001), h(1002), h(1003), h(1004) and h(1005) to obtain h`(1001), h`(1002), h`(1003), h`(1004) and h`(1005);

[0094] S1.5. h`(1001), h`(1002), h`(1003), h`(1004) and h`(1005) are sent to the data party as query requests.

[0095] S2.1. The data party receives the query request sent by the query party, and the query request includes h`(1001), h`(1002), h`(1003), h`(1004) and h`(1005);

[0096] S2.2. The data party performs a hash operation on all the user names in its own database to obtain a hash list, which includes the hash values ​​corresponding to each user name; for example, if the user names include a1, ..., a9, the hash list includes h(a1), ..., h(a9);

[0097] S2.3. The data party takes the first seven digits of the hash value in the hash list (corresponding to the query party above), and obtains an updated hash list including h`(a1), ..., h`(a9);

[0098] S2.4. The data party compares the updated hash list with h`(1001), h`(1002), h`(1003), h`(1004) and h`(1005) in the query request to determine the consistent hash values; for example, h`(a1) is consistent with h`(1001), h`(a5) is consistent with h`(1002), h`(a7) is consistent with h`(1003), h`(a2) is consistent with h`(1004), and h`(a9) is consistent with h`(1005).

[0099] S2.5. The data party determines the deposit data b1, b5, b7, b2 and b9 of h`(a1), h`(a5), h`(a7), h`(a2) and h`(a9);

[0100] S2.6. The data party randomly generates multiple obfuscated deposit data, such as generating three obfuscated deposit data b11, b12 and b13;

[0101] S2.7. The data party generates 8 encryption keys (the sum of the number of deposit data and the number of obfuscated deposit data), pk1, ..., pk8; and encrypts the deposit data b1, b5, b7, b2, b9 and the obfuscated deposit data b11, b12, b13 respectively, to obtain ciphertexts c1, c5, c7, c2, c9, c11, c12 and c13;

[0102] S2.8. The data party returns the encryption keys pk1, ..., pk8 and ciphertexts c1, c5, c7, c2, c9, c11, c12, c13 to the query party.

[0103] S3.1. The querying party receives the encryption keys pk1, ..., pk8 and ciphertexts c1, c5, c7, c2, c9, c11, c12, c13 sent by the data party and returns them to the querying party; the ciphertexts c1, c5, c7, c2, c9, c11, c12, c13 are decrypted according to the encryption keys pk1, ..., pk8 to obtain the deposit data;

[0104] S3.2. Based on the auxiliary information, determine the deposit data corresponding to the user name 1001 to be queried; wherein the auxiliary information may be an association relationship between the ciphertext and the user name, etc.

[0105] From the above example, it can be seen that for the query request of the query party, including the obfuscated user name and the user name to be queried, the data party can determine that one of the user names a1, a5, a7, a2, and a9 is the user name to be queried based on "h`(a1) is consistent with h`(1001), h`(a5) is consistent with h`(1002), h`(a7) is consistent with h`(1003), h`(a2) is consistent with h`(1004), and h`(a9) is consistent with h`(1005)". In other words, the data party has a 1 / 5 chance of determining the user name to be queried, resulting in the privacy leakage of the query party. Therefore, the security and privacy of the query party are probabilistic, that is, the security and privacy are low.

[0106] For the deposit data returned by the data party, the query party will obtain other deposit data except for the user name to be queried, resulting in the leakage of deposit data corresponding to other user names. Therefore, the security and privacy of the data party are probabilistic, that is, the security and privacy are low.

[0107] Figure 1 A system architecture applicable to an embodiment of the present invention is exemplarily shown, and the system architecture includes a query party 110 and a data party 120 .

[0108] The querying party 110 is used to determine the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier; then generate a query request according to the first public key, the second public key and the first auxiliary information, and send the query request to the data party 120;

[0109] Receive the feedback result sent by the data party 120, determine the decryption key of the ciphertext according to the decryption index of the ciphertext, determine the second hash value of the decryption key of the ciphertext, then determine the second hash value consistent with the first hash value, and decrypt the ciphertext corresponding to the first hash value according to the second hash value to obtain the plaintext corresponding to the information to be queried.

[0110] The query party 110 is used to receive a query request, determine the second auxiliary information of the plaintext based on the first auxiliary information of the query request and the second unique identifier and the public key of the plaintext; then determine the encryption key based on the second auxiliary information according to any public key of the query party, the first random number and the second random number; based on the public key, determine the decryption index according to another public key of the query party, the first random number and the second random number; then determine the first hash value of the encryption key of the plaintext; finally, send the first hash value of the encryption key of each plaintext, the decryption index and the ciphertext as feedback results to the query party 110.

[0111] It should be noted that the above Figure 1 The structure shown is only an example and is not limited to this embodiment of the present invention.

[0112] Based on the above description, Figure 2 The flowchart of a two-way hidden data query method provided by an embodiment of the present invention is exemplarily shown, and the flowchart can be executed by a two-way hidden data query device.

[0113] like Figure 2 As shown in the figure, the process specifically includes:

[0114] Step 210: The querying party determines a query request based on the first unique identifier of the information to be queried, and sends the query request to the data party.

[0115] In the embodiment of the present invention, the query request includes first auxiliary information; the first auxiliary information is determined based on the first unique identifier; the first unique identifier can be an identity card number, a telephone number, etc., which is not specifically limited here.

[0116] Step 220: The querying party receives the feedback result sent by the data party.

[0117] In an embodiment of the present invention, the feedback result includes each ciphertext corresponding to each plaintext in the data party and a decryption index corresponding to each ciphertext; each ciphertext is obtained by the data party encrypting each plaintext according to the encryption key corresponding to each plaintext; the encryption key corresponding to each plaintext is determined according to the second auxiliary information of each plaintext; the second auxiliary information of each plaintext is determined by the data party according to the first auxiliary information and the second unique identifier of each plaintext.

[0118] Step 230: For any ciphertext, the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypts the ciphertext according to the decryption key of the ciphertext.

[0119] In the embodiment of the present invention, the ciphertext corresponding to the first unique identifier is determined by determining the first Hash value of the decryption key, and then the ciphertext is decrypted by the decryption key.

[0120] In step 240, the querying party determines the successfully decrypted plaintext as the query result.

[0121] In step 210, the querying party determines the first auxiliary information based on the public key pre-agreed with the data party, thereby generating a query request.

[0122] Specifically, the querying party determines the first public key of the querying party and the second public key of the querying party based on the public key, the first private key of the querying party and the second private key of the querying party; determines the first auxiliary information based on the public key, the first private key, the second private key and the first unique identifier; the querying party generates a query request, and the query request includes the first public key, the second public key and the first auxiliary information.

[0123] For example, the querying party P1 determines the first unique identifier i of the information to be queried, such as the first unique identifier being the user's ID number, telephone number, etc.

[0124] The querying party P1 generates two private keys, including a first private key e and a second private key f, wherein the private key may be a random number or generated by a key generation algorithm, which is not specifically limited here.

[0125] The querying party P1 uses the public key g, the first private key e, and the second private key f to determine the first public key and the second public key; specifically, the first public key x = g e , the second public key y = g f , the first auxiliary information zi = g ef-i The querying party P1 uses the first public key x, the second public key y and the first auxiliary information zi as a query request.

[0126] In step 220, for any plaintext, the encryption key of the plaintext is determined based on the second auxiliary information. The second auxiliary information is determined based on the first auxiliary information and the second unique identifier corresponding to the plaintext. When the first unique identifier is consistent with the second unique identifier, the first unique identifier and the second unique identifier are offset; that is, the encryption key of the plaintext corresponding to the first unique identifier does not include the information of the first unique identifier and the second unique identifier, so that the querying party can determine the decryption key corresponding to the encryption key based on the decryption index.

[0127] In order to better explain the technical solution for the data party to determine the encryption key, Figure 3 A schematic flow chart of a two-way hidden data query method is exemplarily shown, and the flow chart can be executed by a two-way hidden data query device.

[0128] like Figure 3 As shown, the specific process includes:

[0129] Step 310: The data subject obtains a query request.

[0130] In the embodiment of the present invention, the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier.

[0131] Step 320: For any plaintext, the data party determines the second auxiliary information of the plaintext based on the first auxiliary information, according to the second unique identifier of the plaintext and the public key.

[0132] In an embodiment of the present invention, the first auxiliary information includes a first unique identifier, and therefore the second auxiliary information determined based on the second unique identifier includes the first unique identifier and the second unique identifier, and the relationship between the first unique identifier and the second unique identifier is subtraction or division, so that when the first unique identifier and the second unique identifier are consistent, the first unique identifier and the second unique identifier cancel each other out.

[0133] Step 330: The data party determines the encryption key of the plaintext and the decryption index of the ciphertext corresponding to the plaintext according to the second auxiliary information.

[0134] In the embodiment of the present invention, the encryption key includes the second unique identifier and the first unique identifier of the information to be queried, and the decryption index does not include the second unique identifier and the first unique identifier of the information to be queried.

[0135] Step 340: The data party encrypts the plaintext according to the encryption key to obtain ciphertext.

[0136] In step 350, the data party determines the decryption index and the ciphertext of each ciphertext as a feedback result, and sends the feedback result to the query.

[0137] In step 320, the second auxiliary information includes a second unique identifier and a first unique identifier of the information to be queried; combining the above statements and giving an example, after the data party P2 obtains the query request (including the first public key x, the second public key y and the first auxiliary information zi), the data party P2 generates a first random number and a second random number for each plaintext in its own database, such as the first random number of the data mj is rj, and the second random number is sj, wherein j represents the second unique identifier of the plaintext, and the random number can be a symmetric key or a randomly generated value, which is not specifically limited here.

[0138] Data party P2 determines the second auxiliary information of each plaintext based on the first auxiliary information zi. Taking the above plaintext mj as an example, the second auxiliary information zj=zi*g j , because zi=g ef-i , that is, zj = g ef-i *g j =g ef-i+j .

[0139] It can be seen from the above formula that when the first unique identifier i and the second unique identifier j are consistent, the first unique identifier i and the second unique identifier j cancel each other out.

[0140] In step 330, an encryption key is determined based on the second auxiliary information, and a decryption index is determined based on the public key.

[0141] Specifically, for any plaintext, the data party generates a first random number and a second random number;

[0142] The data party determines the encryption key based on the second auxiliary information according to any public key of the query party, the first random number and the second random number;

[0143] The data party determines the decryption index based on the public key, according to another public key of the query party, the first random number and the second random number.

[0144] Taking the above plain text mj as an example, the data party P2 generates a first random number rj and a second random number sj; based on the second auxiliary information zj=g ef-i+j , determine the encryption key kj=zj of the plaintext mj according to the second public key y, the first random number rj and the second random number sj sj *y rj ;

[0145] Based on the public key g, the decryption index wj=x of the plaintext mj is determined according to the first public key x, the first random number rj and the second random number sj. sj *g rj .

[0146] In an practicable manner, the encryption key may be determined based on the first public key x, and the decryption index may be determined based on the second public key y, such as kj=zj sj *x rj , wj=y sj *g rj .

[0147] In step 340, taking the above plaintext mj as an example, the plaintext is encrypted in the following formula (1):

[0148] Ej=kj⊕mj=zj sj *y rj ⊕mj (1);

[0149] Among them, Ej is the ciphertext of plaintext mj, and kj is the encryption key of plaintext mj.

[0150] In step 350, the feedback result also includes the first hash value of the encryption key of each plaintext; specifically, for any plaintext, the data party determines the first hash value of the encryption key of the plaintext; the first hash value of the encryption key of the plaintext, the decryption index and the ciphertext are taken as tuples; the data party determines each tuple as the feedback result.

[0151] Taking the above plaintext mj as an example, the data party P2 performs a hash operation on the encryption key kj of the plaintext mj to obtain a first hash value hash(kj).

[0152] The data party P2 uses the encryption key kj, the first hash value hash(kj) and the ciphertext Ej as the tuple corresponding to the plaintext mj, and sends the tuple corresponding to each plaintext as a feedback result to the query party P1.

[0153] After receiving the query result sent by the data party, the query party will perform calculations based on any tuple and determine the decryption key based on the decryption index of the ciphertext in the tuple.

[0154] In step 230, the decryption index of the ciphertext is determined based on the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined based on the second auxiliary information of the plaintext and the second public key; the querying party converts the decryption index into the decryption key of the ciphertext based on the second private key; or the decryption index of the ciphertext is determined based on the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined based on the second auxiliary information of the plaintext and the first public key; the querying party converts the decryption index into the decryption key of the ciphertext based on the first private key or the second private key.

[0155] Taking the above plaintext mj as an example, the ciphertext corresponding to the plaintext mj is Ej, and the decryption index of the ciphertext Ej is wj. If the encryption key kj of the plaintext mj is zjsj *y rj , which includes the second public key, then the decryption index wj of the ciphertext Ej = x sj *g rj , which includes the first public key.

[0156] If the encryption key kj of plaintext mj = zj sj *x rj , which includes the first public key, then the decryption index wj of the ciphertext Ej = y sj *g rj , which includes the second public key.

[0157] For decryption indexes determined by different public keys, the querying party uses different private keys when determining the decryption key. Specifically, if the decryption index includes the first public key, the querying party converts the decryption index into the decryption key of the ciphertext based on the second private key. If the decryption index includes the second public key, the querying party converts the decryption index into the decryption key of the ciphertext based on the first private key.

[0158] For example, if the decryption index of ciphertext Ej is wj=x sj *g rj , then the querying party determines the decryption key as kj`=wj based on the second private key f f ; Similarly, if the decryption index of the ciphertext Ej is wj=y sj *g rj , then the querying party determines the decryption key as kj`=wj based on the first private key e e .

[0159] It should be noted that the encryption key and the decryption key are symmetric keys, that is, when the encryption key and the decryption key are consistent, the ciphertext encrypted by the encryption key can be successfully decrypted by the decryption key. Further, when the first unique identifier is consistent with the second unique identifier, the encryption key and the decryption key are consistent.

[0160] Take the above plaintext mj as an example. The encryption key of plaintext mj is kj=zj sj *y rj , further, kj = g (ef-i+j)*sj *y rj , if the first unique identifier i is consistent with the second unique identifier j, then kj = g ef*sj *y rj .

[0161] Decryption key kj`=wj e , further, kj`=(x sj *g rj ) f =x sj*f *g rj*f =(ge ) sj*f *g rj*f , where g f =y, then kj`=g ef*sj *y rj .

[0162] In summary, only when the first unique identifier is consistent with the second unique identifier, the encryption key and the decryption key are consistent, that is, the decryption key determined by the querying party can successfully decrypt the plaintext; similarly, if the first unique identifier is inconsistent with the second unique identifier, the decryption key kj`=g ef*sj *y rj , encryption key kj = g (ef-i+j)*sj *y rj , that is, the encryption key and decryption key are inconsistent, and the ciphertext cannot be decrypted by the inconsistent decryption key.

[0163] In one practicable manner, the querying party directly decrypts the ciphertext using the decryption key until the decryption is successful.

[0164] In the embodiment of the present invention, in order to reduce decryption operations, the ciphertext corresponding to the first unique identifier is determined by comparing the hash value of the decryption key with the hash value of the encryption key.

[0165] Specifically, the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext; determines a second Hash value of the decryption key of the ciphertext; determines a second Hash value consistent with the first Hash value, and decrypts the ciphertext corresponding to the first Hash value according to the second Hash value.

[0166] Taking the above plaintext mj as an example, the first hash value of the decryption key kj` of the plaintext mj is determined to be hash(kj`), and the second hash value of the encryption key kj of the plaintext mj is hash(kj). If the first hash value and the second hash value are consistent, it is determined that the encryption key and the decryption key are consistent, that is, the decryption key determined by the inquiring party can successfully decrypt the ciphertext to obtain the plaintext.

[0167] In one possible implementation, a preset number of digits of the first Hash value and the second Hash value may be used for comparison, such as the first 9 digits of the first Hash value and the second Hash value, which is not specifically limited here.

[0168] Taking the above plaintext mj as an example, when j=i, the method for decrypting the ciphertext Ei includes the following formula (2):

[0169] Ei⊕ki`=ki`⊕ki⊕mi=mi (2);

[0170] Among them, Ei is the ciphertext of plaintext mi.

[0171] After obtaining the plaintext mi, the querying party uses the plaintext mi as the query result.

[0172] In the embodiment of the present invention, the querying party does not send its own information to be queried (i.e., the first unique identifier) ​​to the data party. It only sends the first public key x, the second public key y, and the first auxiliary information zi representing the first unique identifier i. After receiving x, y, and zi, the data party cannot infer the first unique identifier i of the querying party's information to be queried. Therefore, the query request of the querying party is completely concealed, the leakage of the first unique identifier is prevented, and the privacy and security of the query request are improved;

[0173] At the same time, only when the first unique identifier and the second unique identifier are consistent, the first unique identifier and the second unique identifier are offset, so that the decryption key converted by the query party through the decryption index is consistent with the encryption key, so that the query party can only decrypt the ciphertext corresponding to the plaintext of the information to be queried. In other words, although the query party obtains the ciphertext other than the ciphertext corresponding to the first unique identifier i, it cannot know the decryption key of other ciphertexts, that is, it cannot successfully decrypt other ciphertexts, so that the data of the data party is completely hidden, preventing the leakage of other plaintexts, and improving the privacy and security of the query request;

[0174] Through hash value comparison, after the query party receives the feedback results or each tuple sent by the data party, it calculates each tuple to obtain the decryption key of each ciphertext, and compares the first hash value of the decryption key with the second hash value of the encryption key in the tuple to determine the tuple corresponding to the first unique identifier. There is no need to traverse and decrypt all ciphertexts, which improves computing efficiency, reduces the amount of calculation, and improves query efficiency.

[0175] Based on the same technical concept, Figure 4 The structure diagram of a two-way hidden data query device provided by an embodiment of the present invention is exemplarily shown, and the process that can be executed by the device.

[0176] like Figure 4 As shown, the device specifically includes:

[0177] The determination module 410 is used to determine a query request based on the first unique identifier of the information to be queried, and send the query request to the data party; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0178] For any ciphertext, determine the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypt the ciphertext according to the decryption key of the ciphertext;

[0179] Determine the successfully decrypted plaintext as the query result;

[0180] The receiving module 420 is used to receive the feedback results sent by the data party; the feedback results include the ciphertexts corresponding to the plaintexts in the data party and the decryption indexes corresponding to the ciphertexts; the ciphertexts are obtained by the data party encrypting the plaintexts according to the encryption keys corresponding to the plaintexts; the encryption keys corresponding to the plaintexts are determined according to the second auxiliary information of the plaintexts; the second auxiliary information of the plaintexts is determined by the data party according to the first auxiliary information and the second unique identifier of the plaintexts.

[0181] Optionally, the determining module 410 is specifically configured to:

[0182] Determine the first public key of the querying party and the second public key of the querying party according to the public key, the first private key of the querying party and the second private key of the querying party;

[0183] Determine the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier;

[0184] A query request is generated, where the query request includes the first public key, the second public key, and the first auxiliary information.

[0185] Optionally, the determining module 410 is specifically configured to:

[0186] The decryption index of the ciphertext is determined according to the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the second public key;

[0187] Based on the second private key, the decryption index is converted into a decryption key of the ciphertext; or the decryption index of the ciphertext is determined according to the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the first public key;

[0188] The decryption index is converted into a decryption key of the ciphertext based on the first private key or the second private key.

[0189] Optionally, the feedback result also includes a first hash value of an encryption key corresponding to each ciphertext;

[0190] The determination module 410 is specifically used for:

[0191] Determining a decryption key for the ciphertext according to a decryption index of the ciphertext;

[0192] Determining a second hash value of a decryption key for the ciphertext;

[0193] Determine a second hash value that is consistent with the first hash value, and decrypt the ciphertext corresponding to the first hash value according to the second hash value.

[0194] Based on the same technical concept, Figure 5 The structure diagram of a two-way hidden data query device provided by an embodiment of the present invention is exemplarily shown, and the process that can be executed by the device.

[0195] like Figure 5 As shown, the device specifically includes:

[0196] The acquisition unit 510 is configured to acquire a query request; the query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier;

[0197] A processing unit 520 is configured to determine, for any plaintext, second auxiliary information of the plaintext based on the first auxiliary information and according to a second unique identifier and a public key of the plaintext;

[0198] Determine, according to the second auxiliary information, an encryption key of the plaintext and a decryption index of a ciphertext corresponding to the plaintext;

[0199] Encrypt the plaintext according to the encryption key to obtain a ciphertext;

[0200] The decryption index and the ciphertext of each ciphertext are determined as feedback results, and the feedback results are sent to the querying party.

[0201] Optionally, the processing unit 520 is specifically configured to:

[0202] For any plaintext, generate a first random number and a second random number;

[0203] Based on the second auxiliary information, determine the encryption key according to any public key of the querying party, the first random number, and the second random number;

[0204] Based on the public key, the decryption index is determined according to another public key of the querying party, the first random number and the second random number.

[0205] Optionally, the processing unit 520 is specifically configured to:

[0206] For any plaintext, determine a first hash value of an encryption key of the plaintext;

[0207] Taking the first hash value of the encryption key of the plaintext, the decryption index and the ciphertext as a tuple;

[0208] Each tuple is determined as a feedback result.

[0209] Based on the same technical concept, an embodiment of the present invention further provides a computer device, including:

[0210] A memory for storing program instructions;

[0211] The processor is used to call the program instructions stored in the memory and execute the above-mentioned two-way hidden data query method according to the obtained program.

[0212] Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned bidirectional hidden data query method.

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

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

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

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

[0217] 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 two-way hidden data query method, characterized in that: include: The querying party determines a query request based on the first unique identifier of the information to be queried, and sends the query request to the data party; The query request includes first auxiliary information; The first auxiliary information is determined according to the first unique identifier; wherein the querying party determines the query request based on the first unique identifier of the information to be queried, including: the querying party determines the first public key and the second public key of the querying party according to the public key, the first private key of the querying party and the second private key of the querying party; the querying party determines the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier; the querying party generates a query request, and the query request includes the first public key, the second public key and the first auxiliary information; The querying party receives the feedback result sent by the data party; the feedback result includes each ciphertext corresponding to each plaintext in the data party and the decryption index corresponding to each ciphertext; each ciphertext is obtained by the data party encrypting each plaintext according to the encryption key corresponding to each plaintext; the encryption key corresponding to each plaintext is determined according to the second auxiliary information of each plaintext; the second auxiliary information of each plaintext is determined by the data party according to the first auxiliary information and the second unique identifier of each plaintext; the second unique identifier is consistent with the first unique identifier; For any ciphertext, the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypts the ciphertext according to the decryption key of the ciphertext; wherein the querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, including: the decryption index of the ciphertext is determined according to the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the second public key; the querying party converts the decryption index into the decryption key of the ciphertext based on the second private key; or the decryption index of the ciphertext is determined according to the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the first public key; the querying party converts the decryption index into the decryption key of the ciphertext based on the first private key; The querying party determines the successfully decrypted plaintext as the query result.

2. The method according to claim 1, characterized in that The feedback result also includes a first hash value of the encryption key corresponding to each ciphertext; The querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypts the ciphertext according to the decryption key of the ciphertext, including: The querying party determines the decryption key of the ciphertext according to the decryption index of the ciphertext; The querying party determines a second hash value of a decryption key of the ciphertext; The querying party determines a second hash value that is consistent with the first hash value, and decrypts the ciphertext corresponding to the first hash value according to the second hash value.

3. A two-way hidden data query method, characterized in that: include: The data subject obtains the query request; The query request includes a first public key, a second public key and first auxiliary information; The first public key and the second public key are determined by the querying party according to the public key, the first private key of the querying party, and the second private key of the querying party; the first auxiliary information is determined by the querying party according to the public key, the first private key, the second private key, and the first unique identifier; For any plaintext, the data party determines the second auxiliary information of the plaintext based on the first auxiliary information, according to the second unique identifier of the plaintext and the public key; The second unique identifier is consistent with the first unique identifier; The data party determines the encryption key of the plaintext and the decryption index of the ciphertext corresponding to the plaintext according to the second auxiliary information: for any plaintext, the data party generates a first random number and a second random number; based on the second auxiliary information, the data party determines the encryption key according to any public key of the query party, the first random number and the second random number; based on the public key, the data party determines the decryption index according to another public key of the query party, the first random number and the second random number; The data party encrypts the plaintext according to the encryption key to obtain a ciphertext; The data party determines the decryption index and the ciphertext of each ciphertext as a feedback result, and sends the feedback result to the query party.

4. The method according to claim 3, characterized in that The data party determines the decryption index and ciphertext of each plaintext as the feedback result, including: For any plaintext, the data party determines a first hash value of an encryption key of the plaintext; The data party takes the first hash value of the encryption key of the plaintext, the decryption index and the ciphertext as a tuple; The data party determines each tuple as a feedback result.

5. A two-way hidden data query device, characterized in that: include: A determination module, configured to determine a query request based on a first unique identifier of the information to be queried, and send the query request to a data party; The query request includes first auxiliary information; the first auxiliary information is determined according to the first unique identifier; the determination module is specifically used to: determine the first public key of the querying party and the second public key of the querying party according to the public key, the first private key of the querying party and the second private key of the querying party; Determine the first auxiliary information according to the public key, the first private key, the second private key and the first unique identifier; the querying party generates a query request, the query request includes the first public key, the second public key and the first auxiliary information; For any ciphertext, determine the decryption key of the ciphertext according to the decryption index of the ciphertext, and decrypt the ciphertext according to the decryption key of the ciphertext; The decryption index of the ciphertext is determined according to the first public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the second public key; The determination module is specifically used to: convert the decryption index into the decryption key of the ciphertext based on the second private key; or the decryption index of the ciphertext is determined according to the second public key; the encryption key of the plaintext corresponding to the ciphertext is determined according to the second auxiliary information of the plaintext and the first public key; Based on the first private key, convert the decryption index into a decryption key of the ciphertext; Determine the successfully decrypted plaintext as the query result; A receiving module, used for receiving the feedback result sent by the data party; the feedback result includes each ciphertext corresponding to each plaintext in the data party and the decryption index corresponding to each ciphertext; the each ciphertext is obtained by the data party encrypting the each plaintext according to the encryption key corresponding to the each plaintext; the encryption key corresponding to each plaintext is determined according to the second auxiliary information of each plaintext; the second auxiliary information of each plaintext is determined by the data party according to the first auxiliary information and the second unique identifier of each plaintext; the second unique identifier is consistent with the first unique identifier.

6. A two-way hidden data query device, characterized in that: include: An acquisition unit, used for acquiring a query request; The query request includes a first public key, a second public key and first auxiliary information; The first public key and the second public key are determined by the querying party according to the public key, the first private key of the querying party, and the second private key of the querying party; the first auxiliary information is determined by the querying party according to the public key, the first private key, the second private key, and the first unique identifier; a processing unit, configured to determine, for any plaintext, second auxiliary information of the plaintext based on the first auxiliary information and according to a second unique identifier and a public key of the plaintext; The second unique identifier is consistent with the first unique identifier; Determine, according to the second auxiliary information, an encryption key of the plaintext and a decryption index of a ciphertext corresponding to the plaintext; The processing unit is specifically configured to: generate a first random number and a second random number for any plaintext; Based on the second auxiliary information, determine the encryption key according to any public key of the querying party, the first random number, and the second random number; and determining the decryption index based on the public key, according to another public key of the querying party, the first random number and the second random number; Encrypt the plaintext according to the encryption key to obtain a ciphertext; The decryption index and the ciphertext of each ciphertext are determined as feedback results, and the feedback results are sent to the querying party.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 2 or 3 to 4.

Citation Information

Patent Citations

  • Cryptograph index-based data query method

    CN106022145A

  • Method and server for security management in database

    CN106022155A