CN114840867A - Data query method, device and system based on exchangeable encrypted data confusion - Google Patents
Data query method, device and system based on exchangeable encrypted data confusion Download PDFInfo
- Publication number
- CN114840867A CN114840867A CN202210763526.XA CN202210763526A CN114840867A CN 114840867 A CN114840867 A CN 114840867A CN 202210763526 A CN202210763526 A CN 202210763526A CN 114840867 A CN114840867 A CN 114840867A
- Authority
- CN
- China
- Prior art keywords
- list
- data
- user
- party
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/58—Random or pseudo-random number generators
- G06F7/588—Random number generators, i.e. based on natural stochastic processes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/03—Credit; Loans; Processing thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0407—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Business, Economics & Management (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Databases & Information Systems (AREA)
- Finance (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Accounting & Taxation (AREA)
- Data Mining & Analysis (AREA)
- Strategic Management (AREA)
- Computational Linguistics (AREA)
- Power Engineering (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Economics (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a data query method, a device and a system based on exchangeable encrypted data confusion, wherein the method comprises the following steps: generating a first hash value according to the user identifier; encrypting the first hash value by using a first exchangeable encryption key to obtain a first encrypted value; intercepting the first n bits of the first hash value to obtain a second hash value; generating a session identifier; sending an inquiry request to an inquired party, wherein the inquiry request carries a first encryption value, a second hash value and a session identifier; receiving a second encrypted value and a second user list returned by the inquired party; the second encryption value is obtained by signing the first encryption value; the second user list is obtained by encrypting all keys of the first user list by using an exchangeable encryption algorithm; encrypting all keys in the second user list to obtain a fourth user list; and determining whether the target user exists in the inquired party or not according to the second encryption value and the fourth user list. The method can conceal trace queries with minimal information leakage.
Description
Technical Field
The invention relates to the field of private data processing, in particular to a data query method, a device and a system based on exchangeable encrypted data confusion.
Background
In the data circulation process, when the inquired party inquires the data directly, the leakage of the data can be generated.
For example: when a bank credits an individual (a checked user), the authenticity of information of three elements (name, mobile phone number and identity card) of the user needs to be verified, if the bank verifies whether the three elements are real through an operator, the direct query mode is that the three elements are sent to the operator, and the operator queries whether the three elements exist really in a self bank. In the above process, the operator knows that the user is loan-making to a bank, that is, the user's information is leaked.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a data query method, apparatus and system based on exchangeable encrypted data obfuscation, so as to perform confidential query in mass data and minimize leakage of user information.
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides a data query method based on exchangeable encrypted data obfuscation, where the method is applied to a querying party, and the method includes:
generating a first hash value according to the identity of the target user;
generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
generating a session identifier;
sending a query request to a queried party, wherein the query request carries the first identity encryption value, the second hash value and the session identifier;
receiving a second identity encryption value and second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
encrypting all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
determining that the target user is present in the queried party when the second identity secret is present in the fourth user list data.
In a second aspect, an embodiment of the present invention provides a data query method based on exchangeable encrypted data obfuscation, where the method is applied to a queried party, and the method includes:
receiving an inquiry request sent by an inquiring party, wherein the inquiry request carries a first identity encryption value, a second hash value and a session identifier;
querying first user list data with the prefix of the key as the second hash value from a database;
generating a second exchangeable encryption key;
taking a key list of the first user list data, and encrypting all keys in the key list by using the second exchangeable encryption key to obtain second user list data;
signing the first identity encryption value to obtain a second identity encryption value;
and returning the second identity encryption value and the second user list data to the inquiring party.
In a third aspect, an embodiment of the present invention provides a data query method based on exchangeable encrypted data obfuscation, including:
the inquiring party generates a first hash value according to the identity of the target user;
the inquiring party generates a first exchangeable encryption key, and encrypts the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
the inquiring party intercepts the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
the inquiring party generates a session identifier;
the inquiring party sends an inquiring request to the inquired party, wherein the inquiring request carries the first identity encryption value, the second hash value and the session identifier;
the inquired party inquires the first user list data with the prefix of the key as the second hash value from the database;
the inquired party generates a second exchangeable encryption key;
the inquired party acquires the key list of the first user list data, and encrypts all keys in the key list by using the second exchangeable encryption key to obtain second user list data;
the inquired party signs the first identity encryption value to obtain a second identity encryption value;
the inquired party returns the second identity encryption value and the second user list data to the inquired party;
the inquiring party encrypts all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
and when the second identity encryption value exists in the fourth user list data, the inquirer determines that the target user exists in the inquired party.
In a fourth aspect, an embodiment of the present invention provides a data query apparatus based on exchangeable encrypted data obfuscation, where the apparatus is applied to a querying party, and the apparatus includes:
the hash module is used for generating a first hash value according to the identity of the target user;
the first exchangeable encryption module is used for generating a first exchangeable encryption key and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
the intercepting module is used for intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
the conversation identification generating module is used for generating conversation identification;
a first sending module, configured to send an inquiry request to an inquired party, where the inquiry request carries the first identity encryption value, the second hash value, and the session identifier;
the first receiving module is used for receiving the second identity encryption value and the second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
the second exchangeable encryption module is used for encrypting all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
and the user determining module is used for determining that the target user exists in the inquired party when the second identity encryption value exists in the fourth user list data.
In a fifth aspect, an embodiment of the present invention provides a data query apparatus based on exchangeable encrypted data obfuscation, where the apparatus is applied to a queried party, and the apparatus includes:
the second receiving module is used for receiving an inquiry request sent by an inquiring party, wherein the inquiry request carries the first identity encryption value, the second hash value and the session identifier;
the database query module is used for querying first user list data with the prefix of the key as the second hash value from a database;
the exchangeable encryption key generation module is used for generating a second exchangeable encryption key;
a second user list data determining module, configured to fetch a key list of the first user list data, and encrypt all keys in the key list using the second exchangeable encryption key to obtain second user list data;
the signature module is used for signing the first identity encryption value to obtain a second identity encryption value;
and the second sending module is used for returning the second identity encryption value and the second user list data to the inquiring party.
In a sixth aspect, an embodiment of the present invention provides a data query system based on exchangeable encrypted data obfuscation, including:
the inquiring party is used for generating a first hash value according to the identity of the target user; generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value; intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer; generating a session identifier; sending a query request to a queried party, wherein the query request carries the first identity encryption value, the second hash value and the session identifier;
the inquired party is used for inquiring the first user list data of which the prefixes of the keys are the second hash values from the database; generating a second exchangeable encryption key; taking a key list of the first user list data, and encrypting all keys in the key list by using the second exchangeable encryption key to obtain second user list data; signing the first identity encryption value to obtain a second identity encryption value; returning the second identity encryption value and the second user list data to the inquiring party;
the inquiring party is further configured to encrypt all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data; determining that the target user is present in the queried party when the second identity secret is present in the fourth user list data.
In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data query method based on confusion of exchangeable encrypted data as described in any one of the above.
In an eighth aspect, an embodiment of the present invention provides a computer device, including:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a data query method based on swappable encrypted data obfuscation as any one of above.
The technical scheme has the following beneficial effects:
the embodiment of the invention realizes the function of whether the target user exists in the checked party or not based on the exchangeable encryption algorithm. In the process, the two parties respectively encrypt own data and opposite data, whether a target user exists in the inquired party or not is finally checked, if the inquired user does not exist in the inquired party, the inquired party cannot speculate the information of the inquired user, and therefore the secret inquiry in mass data is realized, and the user information is leaked to the minimum extent.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a data query method based on swappable encrypted data obfuscation performed by a querying party in accordance with an embodiment of the invention;
FIG. 2 is a flow chart of a data query method based on swappable encrypted data obfuscation performed by a queried party according to an embodiment of the invention;
FIG. 3 is a general flow chart of a data query method based on swappable encrypted data obfuscation performed by the system according to an embodiment of the present invention;
FIG. 4 is an overall flow diagram of another exchangeable encrypted data obfuscation-based data query method performed by the system of an embodiment of the present invention;
FIG. 5 is a schematic diagram of queryable data generation during a user representation query process in accordance with an embodiment of the invention;
FIG. 6 is a functional block diagram of a data query device based on swappable encrypted data obfuscation applied to a querying party according to an embodiment of the present invention;
FIG. 7 is a functional block diagram of a data query device based on swappable encrypted data obfuscation applied to a queried party according to an embodiment of the present invention;
FIG. 8 is a functional block diagram of a computer-readable storage medium of an embodiment of the present invention;
FIG. 9 is a functional block diagram of a computer device of an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
According to the embodiment of the invention, the hidden query is realized in the mass data in an OT (implicit Transfer) query mode, so that the data leakage is reduced to the minimum extent. The mass data means that the magnitude of the user of the checked party is 10 hundred million or more, and the data volume can influence the feasibility of the technology, so the support of the mass data indicates that the embodiment of the invention has good feasibility.
The technical scheme of the embodiment of the invention relates to the following three types of objects:
checked user (target user): social entities such as individuals or businesses;
the inquiring party: the organization or enterprise which needs to inquire the user data to the third-party organization because of receiving some services of the checked user and because of incomplete data;
the inquired party: the specific data of some checked users, and the organization or enterprise providing the information of the checked users to the inquirer.
In an exemplary application scenario, the three types of objects may include:
queried user (or target user): a person, for example, who applies for a loan from a bank;
the inquiring party: a bank, which needs external data supplement since the user's default risk needs to be confirmed;
the inquired party: the operator provides the bank with the call and the related portrait information of the specific user.
In an embodiment of the present invention, the input of the query may include: the inquiring party acquires data from the inquired party through the hash code of the identification information of the inquired user; the output of the query (information provided by the querying party) may include: whether a target user exists; or whether the target user exists and user portrait data of the target user.
In one embodiment, the querying party uses an exchangeable encryption algorithm to determine whether a target user is present in the library of queried parties. In another embodiment, after the querier determines that the target user is present, the user representation information of the target user is obtained from the querier using OT (1 out of N inadvertent transfer) technology.
Regarding exchangeable encryption algorithms:
and (3) a commutative encryption algorithm (public encryption) is used for realizing the function of whether the target user exists in the checked party or not. In the process, the two parties respectively encrypt own data and the data of the other party, and finally check whether the target user exists in the inquired party.
The exchangeable encryption algorithm is defined as follows:
the two keys k1, k2 encrypt the information m, and different encryption sequences can obtain the same encryption result:
Ek1(Ek2(m)) = Ek2(Ek1(m))。
the encryption implementation principle can be exchanged, please refer to the cited documents: Hosseini-Khayat S. Using Commutative Encryption to Share a secret. 2008.
Regarding OT (N selects 1 to inadvertently transmit):
by inadvertently transmitting the OT, a hit piece of data is obtained from a plurality of pieces of information of the inquired party. In an embodiment of the present invention, the user representation of the target user is obtained when the querier determines that the target user exists on the querier. The technology can ensure that the inquirer can only obtain a desired one of the n pieces of data and can not guess any other one. And the inquired party can guess the target user only in n pieces according to probability, that is, if n =100, the inquired party can guess who the target user is with only 1% probability.
For the implementation principle, refer to: brassard G, C Cr peuu, Robert J M. All or Nothing Disclosure of secrets. Advances in cryptography-CRYPTO' 86, 1986.
Example one
Fig. 1 is a flowchart of a data query method based on swappable encrypted data obfuscation performed by a querying party according to an embodiment of the present invention. As shown in fig. 1, it includes the following steps:
s101: generating a first hash value according to the identity of the target user;
specifically, the identification of the target user may include any one or a combination of any more of identification identifications such as a mobile communication terminal number, an identification number, a passport number, and the like of the user. This step may generate the first hash value based on an information digest algorithm. The message digest algorithm includes, but is not limited to, the md5 algorithm.
S102: generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
s103: intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
specifically, in the process, the inquirer provides the first n bits of md5, which is beneficial to reducing the target user quantity. Because md5 has strong dispersity, the inquired party obtains the top n bit value and cannot calculate the target user. The number of bits of n may be determined by both the inquiring party and the inquired party, and n may be 6 or 7, as an example.
S104: generating a session identifier; for example, a universal Unique Identifier (uuid) is generated.
S105: sending a query request to a queried party, wherein the query request carries the first identity encryption value, the second hash value and the session identifier;
s106: receiving a second identity encryption value and second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
s107: encrypting all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
s108: when the second identity secret is present in the fourth user list data, determining that the target user is present in the queried party. Determining that the target user is not present in the queried party when the second identity secret is not present in the fourth user list data.
The final conclusion of the query is: whether the target user exists on the inquired party; in the process, the inquired party cannot know who the target user of the inquirer is, and meanwhile, the inquirer cannot know who other returned users are.
In a further embodiment, the method may further comprise the steps of:
when the second identity encryption value exists in the fourth user list data, determining an index number of the second identity encryption value in the fourth user list data;
sending the session identification to a queried party to initiate a user representation query for the target user;
receiving a public key list returned by the inquired party;
determining a target public key corresponding to the index number from the public key list;
generating a random number, and encrypting the random number by using the target public key to obtain a random number encryption value;
sending the session identification and the random number encryption value to a inquired party;
receiving an encrypted user portrait list returned by the inquired party;
and extracting target data matched with the index number from the encrypted user portrait list, and performing XOR on the target data and the random number to obtain user portrait data of the target user.
The technical scheme has the advantages that:
the system can perform confidential inquiry in mass data (the inquired party has the data volume of 10 hundred million or more), and can minimally leak user information.
If the inquired user does not exist in the inquired party, the inquired party cannot speculate the information of the inquired user;
when the target user portrait is obtained, the inquired party can only guess who the inquired user is in a large range;
the inquiring party can not obtain any other user information except the inquired user information.
Example two
Fig. 2 is a flowchart of a data query method based on swappable encrypted data obfuscation performed by a queried party according to an embodiment of the present invention. As shown in fig. 2, it includes the following steps:
s201: receiving an inquiry request sent by an inquiring party, wherein the inquiry request carries a first identity encryption value, a second hash value and a session identifier;
s202: querying first user list data with the prefix of the key as the second hash value from a database;
s203: generating a second exchangeable encryption key;
s204: taking a key list of the first user list data, and encrypting all keys in the key list by using a second exchangeable encryption key to obtain second user list data;
s205: signing the first identity encryption value to obtain a second identity encryption value;
s206: and returning the second identity encryption value and the second user list data to the inquiring party.
In a further embodiment, the method may further comprise the steps of:
storing the first user list data in sequence, and associating the first user list data with the session identifier to obtain associated third user list data;
receiving a user portrait query request aiming at a target user and sent by a query party, wherein the query request carries the session identifier;
searching the third user list data from a database according to the session identifier;
counting the list length of the third user list data, generating a public and private key pair list associated with the list length, and determining a public key list from the public and private key pair list, wherein the public key list comprises a plurality of public keys;
returning the public key list to the inquiring party;
receiving the session identification and the random number encrypted value sent by the inquiring party; the random number encryption value is obtained by encrypting a random number by an inquirer according to a target public key selected from the public key list;
a plurality of private keys in a private key list in the public and private key pair list are taken to decrypt the random number encrypted value sent by the inquiring party respectively to obtain a random number decrypted value list;
querying a plurality of user portrait data associated with the third user list data, respectively performing binary conversion on the plurality of user portrait data to obtain a user portrait binary data list, and performing xor on the user portrait binary data list and data with the same position sequence in the random number decryption value list in a one-to-one correspondence manner to obtain an encrypted user portrait list;
returning the encrypted user representation list to a querying party.
EXAMPLE III
Fig. 3 is an overall flowchart of a data query method based on swappable encrypted data obfuscation, which is executed by the system according to the embodiment of the present invention. As shown in fig. 3, it includes the following steps:
s1: and the inquiring party generates a target user key according to the user identity, wherein the target user key is a hash value M indicating the user identity.
The hash value M is a unique identification hash value used for identifying the user identity; the user identity can be a mobile phone number or an identity card number. The correlation calculation formula is as follows: key = md5 hash (mobile | IdNo).
In the embodiment of the invention, md5 can be adopted to hash the query key so as to hash and desensitize the original key value; the md5 algorithm has the advantages of: the final hash value can be output in a uniform length no matter the length of the input data; has good dispersibility, namely two similar inputs and completely irregular output.
S2: the querier generates a first exchangeable encryption key e1, encrypts M with first exchangeable encryption key e1, and obtains D1.
S3: and the inquiring party intercepts the first n bits of the hash value M to obtain P.
Wherein n may be 6 or 7, as an example.
In this process the querier provides the first n bits of md5 to narrow the target user population. Because md5 has strong dispersity, the inquired party obtains the front n-bit value and cannot calculate the target user;
the number of the n bits can be determined by both parties, and due to the dispersity of md5, the number of data pieces which can be found by different n values in the determined data quantity is stable, and the maximum number of data pieces does not have a particularly large difference from the average number of data pieces;
the following is for the total amount generated randomly: 1,047,220,755, statistics of prefix queries for 10 hundred million cell phone numbers md 5:
table 1: md5 prefix inquiry statistical table
Number of bits | Maximum value | Minimum value | Mean value of |
5 | 1157 | 851 | 999 |
6 | 109 | 24 | 62.4 |
7 | 19 | 1 | 4 |
8 | 7 | 1 | 1.27 |
9 | 4 | 1 | 1 |
10 | 3 | 1 | 1 |
According to the statistics of table 1, n =7 (aggregation statistics are performed on the same first 7 bits of 10 hundred million data) has an average of 4, and returns 19 at most, and 1 at least.
S4: the querier generates a unique session identification (sessionId), denoted as S.
There are many methods that can be generated here, for example, generating a universal Unique Identifier (uuid). The execution order of step S4 is not dependent on S1, S2, S3, S4 may be executed before S1, or S4 is located between S1 and S2, or between S2 and S3.
S5: the inquiring party sends an inquiring request to the inquirer, and the inquiring request carries D1, P and S.
S6: the inquired party inquires user list data L1 with prefix P of key from the database.
In the data preparation phase, the inquired party needs to import the data into a database (such as a key-value database). In the above example of the application scenario, the querying party and the queried party perform querying with the key determined based on the mobile phone number, and then the queried party should store the mobile phone number md5 as the key and other data as value.
Assume that the operator's data format is as follows:
mobile is Mobile phone number;
name is Name;
idno is the identity card number;
age;
amount is the consumption Amount;
the storage structure is then:
key=md5(mobile)
Value={
"Mobile":"135......",
"Name": "certain in plum",
"Idno":"330......",
"Age":33,
"Amount":68
}。
as data storage devices for mass data to be checked, for example: and (4) hbase. Such databases may support good horizontal expansion with low impact on performance, e.g., hbase on the order of 10 billion data may maintain fast response.
The KV database can provide quick query based on key; the KV database can provide fast range query based on prefix, for example, all data of a certain character string can be quickly searched by key prefix.
S7: the inquired party generates a second exchangeable encryption key e 2.
In particular, this step may use an exchangeable encryption algorithm to generate the encryption key. In this embodiment, the two parties perform query interaction in an exchangeable encryption manner.
S8: the key list of the inquired party user list data L1 is encrypted by using the exchangeable encryption algorithm and the second exchangeable encryption key e2, so that L2 is obtained.
S9: the inquired party saves all the user list data L1 in sequence and associates with the session identifier (sessionId), and the associated data L3 is obtained.
S10: the inquired party conducts RSA signature on the D1 value of the inquirer to obtain D2.
S11: the queried party returns D2 and L2 to the querier.
S12: the inquirer secondarily encrypts all keys in L2 by using the exchangeable encryption algorithm and using the first exchangeable encryption key e1, so as to obtain L4.
S13: the querier determines whether D2 exists in L4 and the index number IDX of D2 in L4.
If D2 exists in L4, it indicates that the target user exists in the inquired party. This step returns a list so that it can be determined that D2 is the second in the returned L4 list.
The final conclusion of the query is: whether the target user exists in the checked party or not and the index number in the result list of the checked party; in the process, the inquired party cannot know who the target user of the inquirer is, and meanwhile, the inquirer cannot know who other returned users are.
Fig. 4 is an overall flowchart of another data query method based on swappable encrypted data obfuscation, which is performed by the system according to the embodiment of the present invention. As shown in fig. 4, it includes the following steps:
s14: the querier sends a session identification s (sessionid) to the querier to initiate a user profile query.
S15: the inquired party looks up the stored list L3 from the database according to the session identity s (sessionid).
S16: the inquired party counts the length W of the L3 list, generates W RSA public and private key pairs, and takes all public keys to form a public key list R: r = PUK _1~ PUK _ W.
S17: the inquired party returns all public key lists R to the inquirer.
S18: the inquiring party determines the IDX bit public key from the public key list R: PUK _ IDX.
S19: the inquiring party generates a random number x and encrypts the x by using the PUK _ IDX to obtain a random number encryption value M _ IDX.
S20: the inquiring party sends the session identification s (sessionid) and the random number encryption value M _ IDX to the inquirer.
The session identification is sent again in order to be associated with the last query.
S21: the inquired party respectively decrypts the random number encrypted values M _ IDX by using the corresponding W private keys to obtain a random number decrypted value list which comprises W random number decrypted values E: e _1 to E _ W.
S22: the inquirer inquires about a plurality of user portrait data associated with L3, performs binary conversion on each user portrait data to obtain a user portrait binary data list, and performs XOR between the user portrait binary data list and a corresponding E in the random number decryption value list to obtain an encrypted user portrait list RET. In this step, the ith binary user portrait value is sorted or ordered in the user portrait binary data list, and the ith random number decryption value is sorted in the random number decryption value list.
FIG. 5 is a diagram illustrating the generation of queryable data during a user representation query process in accordance with an embodiment of the present invention. As shown in fig. 5, the following detailed example describes a specific processing procedure:
in step S16, the inquired party holds n users to be inquired, and user list data is formed; the inquired party generates a pair of public and private keys for each user correspondingly, and the number of the public and private key pairs is equal to that of the users. For example: generating a pair of public and private keys for a user 1, wherein the pair comprises a public key 1 and a private key 1; generating a pair of public and private keys for the user 2, wherein the pair comprises a public key 2 and a private key 2; and so on until a pair of public and private keys is generated for user n, comprising public key n and private key n. In step S17, the inquired party retrieves a public key list composed of all the public keys and returns the public key list to the inquirer.
In step S21 and step S22, after the inquired party receives the random number encrypted value sent by the inquiring party, the inquired party decrypts the random number encrypted value by using the private key corresponding to the user for each user, so as to obtain a corresponding decrypted value; carrying out XOR processing on the random number decryption value corresponding to each user and the user portrait binary data of the user to correspondingly obtain a user portrait XOR value corresponding to the user; the n user portrait XOR values form a list of user portrait XOR values. For example, for a user 1, a private key 1 is taken to decrypt the random number encrypted value to obtain a random number decrypted value 1, and the decrypted value 1 is subjected to XOR with the image binary data of the user 1 to generate an XOR value 1; for the user 2, the private key 2 is used for decrypting the random number encrypted value to obtain a random number decrypted value 2, and the decrypted value 2 is subjected to XOR with the image binary data of the user 2 to generate an XOR value 2; and repeatedly executing the steps until the exclusive OR values of all the n users are generated and returned to the inquirer.
S23: the inquired party returns an encrypted user portrait list RET to the inquirer.
S24: the inquiring party takes out the IDX data from the encrypted user portrait list RET and carries out XOR between the IDX data and the random number x to obtain the user portrait data of the target user.
FIG. 4 is a flowchart illustrating a process for a querying party to determine that a target user is present at a queried party and to request retrieval of user representation data; the flow mainly uses OT (transport without intention) mode to obtain 1 from n; the OT mode ensures that the inquiring party can only obtain one effective record; the inquired party cannot know who is the target user in the user list.
The technical scheme has the advantages that:
the confidential query can be performed in mass data (the data volume of the inquired party is 10 hundred million or more), and the user information is minimally leaked.
If the inquired user does not exist in the inquired party, the inquired party cannot speculate the information of the inquired user;
when the target user portrait is obtained, the inquired party can only guess who the inquired user is in a large range;
the inquiring party can not obtain any other user information except the inquired user information.
Example four
Fig. 6 is a functional block diagram of a data query device based on exchangeable encrypted data obfuscation applied to a querying party according to an embodiment of the present invention. As shown in fig. 6, the data query apparatus 300 includes:
the hash module 301 is configured to generate a first hash value according to the identity of the target user;
the first exchangeable encryption module 302 is configured to generate a first exchangeable encryption key, and encrypt the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
an intercepting module 303, configured to intercept the first n bits of the first hash value to obtain a second hash value, where n is a positive integer;
a session identifier generating module 304, configured to generate a session identifier;
a first sending module 305, configured to send an inquiry request to an inquired party, where the inquiry request carries the first identity encryption value, the second hash value, and the session identifier;
the first receiving module 306 is configured to receive the second identity encrypted value and the second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
a second exchangeable encryption module 307, configured to encrypt all keys in the second user list data using the first exchangeable encryption key to obtain fourth user list data;
a user determining module 308, configured to determine that the target user exists in the inquired party when the second identity encryption value exists in the fourth user list data.
In a further embodiment, the data query apparatus 300 may further include:
an index number determining module, configured to determine, when the second identity encrypted value exists in the fourth user list data, an index number of the second identity encrypted value in the fourth user list data according to a sequence number of the second identity encrypted value in the fourth user list data;
the first sending module is further configured to send the session identifier to a queried party to initiate a user representation query for the target user;
the first receiving module is further configured to receive a public key list returned by the inquired party;
the target public key determining module is used for determining a target public key corresponding to the index number from the public key list;
the random number encryption value generating module is used for generating a random number and encrypting the random number by using the target public key to obtain a random number encryption value;
the first sending module is further configured to send the session identifier and the random number encrypted value to the inquired party;
the first receiving module is further used for receiving an encrypted user portrait list returned by the inquired party;
and the user portrait data determining module is used for taking out target data matched with the index number from the encrypted user portrait list and carrying out XOR on the target data and the random number to obtain the user portrait data of the target user.
EXAMPLE five
Fig. 7 is a functional block diagram of a data query apparatus based on swappable encrypted data obfuscation applied to a queried party according to an embodiment of the present invention. As shown in fig. 7, the data query apparatus 400 includes:
a second receiving module 401, configured to receive an inquiry request sent by an inquiring party, where the inquiry request carries a first identity encryption value, a second hash value, and a session identifier;
a database query module 402, configured to query, from a database, first user list data with a prefix of a key being the second hash value;
an exchangeable encryption key generating module 403 for generating a second exchangeable encryption key;
a second user list data determining module 404, configured to take a key list of the first user list data, and encrypt all keys in the key list by using a second exchangeable encryption key (based on an exchangeable encryption algorithm), so as to obtain second user list data;
a signature module 405, configured to sign the first identity encryption value to obtain a second identity encryption value;
a second sending module 406, configured to return the second identity cryptographic value and the second user list data to the querying party.
In a further embodiment, the data query apparatus 400 may further include:
the association storage module is used for sequentially storing all the first user list data and associating the first user list data with the session identifier to obtain associated third user list data;
the second receiving module is further configured to receive a user portrait query request for a target user, where the user portrait query request carries the session identifier;
the database query module is used for searching the third user list data from a database according to the session identifier;
a public and private key pair generation module, configured to count the list length of the third user list data, generate a public and private key pair list associated with the list length, and determine a public key list from the public and private key pair list, where the public key list includes a plurality of public keys;
the second sending module is further configured to return the public key list to the inquiring party;
the second receiving module is further configured to receive the session identifier and the random number encrypted value sent by the querying party; the random number encryption value is obtained by encrypting the random number according to a target public key selected from the public key list by the inquiring party;
the decryption module is used for decrypting the random number encrypted value sent by the inquiring party by taking a private key in the public and private key pair list to obtain a random number decrypted value list;
a user portrait data processing module, configured to query a plurality of user portrait data associated with the third user list data, perform binary conversion on the plurality of user portrait data, respectively, to obtain a user portrait binary data list, and perform xor on the user portrait binary data list and data with the same position ordering in the random number decryption value list in a one-to-one correspondence manner, to obtain an encrypted user portrait list;
the second sending module is further configured to return the encrypted user representation list to a querying party.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
EXAMPLE six
The embodiment provides a data query system based on exchangeable encrypted data confusion, which comprises:
the inquiring party is used for generating a first hash value according to the identity of the target user; generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value; intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer; generating a session identifier; sending an inquiry request to an inquired party, wherein the inquiry request carries the first identity encryption value, the second hash value and the session identifier;
the inquired party is used for inquiring the first user list data of which the prefixes of the keys are the second hash values from the database; generating a second exchangeable encryption key; taking a key list of the first user list data, and encrypting all keys in the key list by using a second exchangeable encryption key to obtain second user list data; signing the first identity encryption value to obtain a second identity encryption value; returning the second identity encryption value and the second user list data to the inquiring party;
the inquiring party is further configured to encrypt all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data; determining that the target user is present in the queried party when the second identity secret is present in the fourth user list data.
In a further embodiment, the inquired party is further configured to store the first user list data in sequence, and associate the first user list data with the session identifier to obtain associated third user list data;
the inquiring party is further used for determining the index number of the second identity encryption value in the fourth user list data when the second identity encryption value exists in the fourth user list data; sending the session identification to a queried party to initiate a user representation query for the target user;
the inquired party is also used for searching the third user list data from a database according to the session identifier; counting the list length of the third user list data, generating a public and private key pair list associated with the list length, and taking out a public key list from the public and private key pair list, wherein the public key list comprises a plurality of public keys; returning the public key list to the inquiring party;
the inquiring party is also used for determining a target public key corresponding to the index number from the public key list; generating a random number, and encrypting the random number by using the target public key to obtain a random number encryption value; sending the session identification and the random number encryption value to a inquired party;
the inquired party is also used for taking a private key in the public and private key pair list to decrypt a random number encrypted value sent by the inquirer to obtain a random number decrypted value list; querying a plurality of user portrait data associated with the third user list data, respectively performing binary conversion on the plurality of user portrait data to obtain a user portrait binary data list, and performing XOR on the user portrait binary data list and data with the same position sequence in the random number decryption value list in a one-to-one correspondence manner to obtain an encrypted user portrait list; returning the encrypted user representation list to a querying party;
and the inquiring party is also used for taking out target data matched with the index number from the encrypted user portrait list and carrying out XOR on the target data and the random number to obtain the user portrait data of the target user.
In a further embodiment, the inquiring party is further configured to generate the first hash value based on an information digest algorithm according to the mobile communication terminal number or the identification number of the target user.
EXAMPLE seven
FIG. 8 is a functional block diagram of a computer-readable storage medium of an embodiment of the present invention. As shown in fig. 8, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the data query method based on the confusion of exchangeable encrypted data are implemented.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. Of course, there are other ways of storing media that can be read, such as quantum memory, graphene memory, and so forth. It should be noted that the computer-readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer-readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
Example eight
FIG. 9 is a functional block diagram of a computer device of an embodiment of the present invention. An embodiment of the present application provides a computer device 1000, as shown in fig. 9, which includes: one or more processors 1001, a storage device 1002 and a communication bus 1003, wherein the storage device 1002 stores machine-readable instructions executable by the processors 1001, when the computer device 1000 runs, the processors 1001 and the storage device 1002 communicate with each other through the communication bus 1003, and the processors 1001 execute the machine-readable instructions to execute or implement the steps of the data query method based on confusion of exchangeable encrypted data according to any of the foregoing embodiments.
Processor 1001 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), etc.; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
The communication bus 1003 includes hardware, software, or both for coupling the above-described components to each other. For example, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. A bus may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Although the present application provides method steps as in an embodiment or a flowchart, more or fewer steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (15)
1. A data query method based on exchangeable encrypted data confusion, which is applied to a query party, and is characterized in that the method comprises the following steps:
generating a first hash value according to the identity of the target user;
generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
generating a session identifier;
sending a query request to a queried party, wherein the query request carries the first identity encryption value, the second hash value and the session identifier;
receiving a second identity encryption value and second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
encrypting all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
determining that the target user is present in the queried party when the second identity secret is present in the fourth user list data.
2. The method of claim 1, further comprising:
when the second identity encryption value exists in the fourth user list data, determining an index number of the second identity encryption value in the fourth user list data;
sending the session identification to a queried party to initiate a user representation query for the target user;
receiving a public key list returned by the inquired party;
determining a target public key corresponding to the index number from the public key list;
generating a random number, and encrypting the random number by using the target public key to obtain a random number encryption value;
sending the session identification and the random number encryption value to a inquired party;
receiving an encrypted user portrait list returned by the inquired party;
and extracting target data matched with the index number from the encrypted user portrait list, and performing XOR on the target data and the random number to obtain user portrait data of the target user.
3. A data query method based on exchangeable encrypted data confusion, the method is applied to a queried party, and is characterized in that the method comprises the following steps:
receiving an inquiry request sent by an inquirer, wherein the inquiry request carries a first identity encryption value, a second hash value and a session identifier;
querying first user list data with the prefix of the key as the second hash value from a database;
generating a second exchangeable encryption key;
taking a key list of the first user list data, and encrypting all keys in the key list by using the second exchangeable encryption key to obtain second user list data;
signing the first identity encryption value to obtain a second identity encryption value;
and returning the second identity encryption value and the second user list data to the inquiring party.
4. The method of claim 3, further comprising:
storing the first user list data in sequence, and associating the first user list data with the session identifier to obtain associated third user list data;
receiving a user portrait query request aiming at a target user and sent by a query party, wherein the query request carries the session identifier;
searching the third user list data from a database according to the session identifier;
counting the list length of the third user list data, generating a public and private key pair list associated with the list length, and taking a public key list from the public and private key pair list, wherein the public key list comprises a plurality of public keys;
returning the public key list to the inquiring party;
receiving the session identification and the random number encrypted value sent by the inquiring party; the random number encryption value is obtained by encrypting a random number by an inquirer according to a target public key selected from the public key list;
respectively decrypting the random number encrypted values sent by the inquiring party by taking a private key list in the public and private key pair list to obtain a random number decrypted value list;
querying a plurality of user portrait data associated with the third user list data, respectively performing binary conversion on the plurality of user portrait data to obtain a user portrait binary data list, and performing XOR on the user portrait binary data list and data with the same position sequence in the random number decryption value list in a one-to-one correspondence manner to obtain an encrypted user portrait list;
returning the encrypted user representation list to a querying party.
5. A data query method based on exchangeable encrypted data confusion is characterized by comprising the following steps:
the inquiring party generates a first hash value according to the identity of the target user;
the inquiring party generates a first exchangeable encryption key, and encrypts the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
the inquiring party intercepts the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
the inquiring party generates a session identifier;
the inquiring party sends an inquiring request to the inquired party, wherein the inquiring request carries the first identity encryption value, the second hash value and the session identifier;
the inquired party inquires first user list data with the prefix of the key as the second hash value from a database;
the inquired party generates a second exchangeable encryption key;
the inquired party acquires the key list of the first user list data, and encrypts all keys in the key list by using the second exchangeable encryption key to obtain second user list data;
the inquired party signs the first identity encryption value to obtain a second identity encryption value;
the inquired party returns the second identity encryption value and the second user list data to the inquired party;
the inquiring party encrypts all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
and when the second identity encryption value exists in the fourth user list data, the inquirer determines that the target user exists in the inquired party.
6. The method of claim 5, further comprising:
the inquired party stores the first user list data in sequence and associates the first user list data with the session identifier to obtain associated third user list data;
when the second identity encryption value exists in the fourth user list data, the inquiring party determines the index number of the second identity encryption value in the fourth user list data;
the inquiring party sends the session identification to the inquired party to initiate a user portrait inquiry aiming at the target user;
the inquired party searches the third user list data from a database according to the session identifier;
the inquired party counts the list length of the third user list data, generates a public and private key pair list associated with the list length, and takes a public key list from the public and private key pair list, wherein the public key list comprises a plurality of public keys;
the inquired party returns the public key list to the inquirer;
the inquiring party determines a target public key corresponding to the index number from the public key list;
the inquiring party generates a random number and encrypts the random number by using the target public key to obtain a random number encryption value;
the inquiring party sends the session identification and the random number encryption value to the inquired party;
the inquired party takes a private key list in the public and private key pair list to decrypt the random number encrypted values sent by the inquirer respectively to obtain a random number decrypted value list;
querying a plurality of user portrait data associated with the third user list data, respectively performing binary conversion on the plurality of user portrait data to obtain a user portrait binary data list, and performing xor on the user portrait binary data list and data with the same position sequence in the random number decryption value list in a one-to-one correspondence manner to obtain an encrypted user portrait list;
the inquired party returns the encrypted user portrait list to the inquired party;
and the inquiring party takes out the target data matched with the index number from the encrypted user portrait list and carries out XOR on the target data and the random number to obtain the user portrait data of the target user.
7. A data query apparatus based on exchangeable encrypted data obfuscation, the apparatus being applied to a querying party, the apparatus comprising:
the hash module is used for generating a first hash value according to the identity of the target user;
the first exchangeable encryption module is used for generating a first exchangeable encryption key and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value;
the intercepting module is used for intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer;
the conversation identification generating module is used for generating conversation identification;
a first sending module, configured to send an inquiry request to an inquired party, where the inquiry request carries the first identity encryption value, the second hash value, and the session identifier;
the first receiving module is used for receiving the second identity encryption value and the second user list data returned by the inquired party; the second identity encryption value is obtained after the inquired party signs the first identity encryption value; the second user list data is obtained by encrypting all keys in the first user list data by the inquired party by using an exchangeable encryption algorithm, and the first user list data refers to data of which the prefixes of the keys in the database of the inquired party are the second hash values;
the second exchangeable encryption module is used for encrypting all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data;
and the user determining module is used for determining that the target user exists in the inquired party when the second identity encryption value exists in the fourth user list data.
8. The apparatus of claim 7, further comprising:
an index number determining module, configured to determine, when the second identity encrypted value exists in the fourth user list data, an index number of the second identity encrypted value in the fourth user list data according to a sequence number of the second identity encrypted value in the fourth user list data;
the first sending module is further configured to send the session identifier to a queried party to initiate a user representation query for the target user;
the first receiving module is further configured to receive a public key list returned by the inquired party;
the target public key determining module is used for determining a target public key corresponding to the index number from the public key list;
the random number encryption value generating module is used for generating a random number and encrypting the random number by using the target public key to obtain a random number encryption value;
the first sending module is further configured to send the session identifier and the random number encrypted value to the inquired party;
the first receiving module is further used for receiving an encrypted user portrait list returned by the inquired party;
and the user portrait data determining module is used for taking out target data matched with the index number from the encrypted user portrait list and carrying out XOR on the target data and the random number to obtain the user portrait data of the target user.
9. A data query apparatus based on exchangeable encrypted data obfuscation, the apparatus being applied to a queried party, the apparatus comprising:
the second receiving module is used for receiving an inquiry request sent by an inquiring party, wherein the inquiry request carries the first identity encryption value, the second hash value and the session identifier;
the database query module is used for querying first user list data with the prefix of the key as the second hash value from a database;
the exchangeable encryption key generation module is used for generating a second exchangeable encryption key;
a second user list data determining module, configured to fetch a key list of the first user list data, and encrypt all keys in the key list using the second exchangeable encryption key to obtain second user list data;
the signature module is used for signing the first identity encryption value to obtain a second identity encryption value;
and the second sending module is used for returning the second identity encryption value and the second user list data to the inquiring party.
10. The apparatus of claim 9, further comprising:
the association storage module is used for sequentially storing the first user list data and associating the first user list data with the session identifier to obtain associated third user list data;
the second receiving module is further configured to receive a user portrait query request for a target user, where the user portrait query request carries the session identifier;
the database query module is used for searching the third user list data from a database according to the session identifier;
a public and private key pair generation module, configured to count the list length of the third user list data, generate a public and private key pair list associated with the list length, and determine a public key list from the public and private key pair list, where the public key list includes a plurality of public keys;
the second sending module is further configured to return the public key list to the inquiring party;
the second receiving module is further configured to receive the session identifier and the random number encrypted value sent by the querying party; the random number encryption value is obtained by encrypting a random number by an inquirer according to a target public key selected from the public key list;
the decryption module is used for respectively decrypting the random number encrypted values sent by the inquiring party by taking the private key list in the public and private key pair list to obtain a random number decrypted value list;
a user portrait data processing module, configured to query a plurality of user portrait data associated with the third user list data, perform binary conversion on the plurality of user portrait data, respectively, to obtain a user portrait binary data list, and perform xor on the user portrait binary data list and data with the same position ordering in the random number decryption value list in a one-to-one correspondence manner, to obtain an encrypted user portrait list;
the second sending module is further configured to return the encrypted user portrait list to a querying party.
11. A data query system based on swappable encrypted data obfuscation, comprising:
the inquiring party is used for generating a first hash value according to the identity of the target user; generating a first exchangeable encryption key, and encrypting the first hash value by using the first exchangeable encryption key to obtain a first identity encryption value; intercepting the first n bits of the first hash value to obtain a second hash value, wherein n is a positive integer; generating a session identifier; sending an inquiry request to an inquired party, wherein the inquiry request carries the first identity encryption value, the second hash value and the session identifier;
the inquired party is used for inquiring the first user list data of which the prefixes of the keys are the second hash values from the database; generating a second exchangeable encryption key; taking a key list of the first user list data, and encrypting all keys in the key list by using the second exchangeable encryption key to obtain second user list data; signing the first identity encryption value to obtain a second identity encryption value; returning the second identity encryption value and the second user list data to the inquiring party;
the inquiring party is further configured to encrypt all keys in the second user list data by using the first exchangeable encryption key to obtain fourth user list data; determining that the target user is present in the queried party when the second identity secret is present in the fourth user list data.
12. The system of claim 11,
the inquired party is also used for sequentially storing the first user list data and associating the first user list data with the session identifier to obtain associated third user list data;
the inquiring party is further used for determining the index number of the second identity encryption value in the fourth user list data when the second identity encryption value exists in the fourth user list data; sending the session identification to a queried party to initiate a user representation query for the target user;
the inquired party is also used for searching the third user list data from a database according to the session identifier; counting the list length of the third user list data, generating a public and private key pair list associated with the list length, and determining a public key list from the public and private key pair list, wherein the public key list comprises a plurality of public keys; returning the public key list to the inquiring party;
the inquiring party is also used for determining a target public key corresponding to the index number from the public key list; generating a random number, and encrypting the random number by using the target public key to obtain a random number encryption value; sending the session identification and the random number encryption value to a inquired party;
the inquired party is also used for obtaining a private key list in the public and private key pair list to decrypt the random number encrypted value sent by the inquirer respectively to obtain a random number decrypted value list; querying a plurality of user portrait data associated with the third user list data, respectively performing binary conversion on the plurality of user portrait data to obtain a user portrait binary data list, and performing XOR on the user portrait binary data list and data with the same position sequence in the random number decryption value list in a one-to-one correspondence manner to obtain an encrypted user portrait list;
and the inquiring party is also used for taking out target data matched with the index number from the encrypted user portrait list and carrying out XOR on the target data and the random number to obtain the user portrait data of the target user.
13. The system of claim 11, wherein the inquiring party is further configured to generate the first hash value based on an information summarization algorithm according to the mobile communication terminal number or the identification number of the target user.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a data query method based on exchangeable encrypted data obfuscation as claimed in any one of claims 1 to 6.
15. A computer device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the exchangeable encrypted data obfuscation-based data query method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210763526.XA CN114840867B (en) | 2022-07-01 | 2022-07-01 | Data query method, device and system based on exchangeable encrypted data confusion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210763526.XA CN114840867B (en) | 2022-07-01 | 2022-07-01 | Data query method, device and system based on exchangeable encrypted data confusion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114840867A true CN114840867A (en) | 2022-08-02 |
CN114840867B CN114840867B (en) | 2022-09-20 |
Family
ID=82574101
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210763526.XA Active CN114840867B (en) | 2022-07-01 | 2022-07-01 | Data query method, device and system based on exchangeable encrypted data confusion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114840867B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115098549A (en) * | 2022-08-25 | 2022-09-23 | 北京数牍科技有限公司 | Fair data hiding trace query method, device, equipment and storage medium |
CN115544579A (en) * | 2022-11-24 | 2022-12-30 | 北京融数联智科技有限公司 | Double-random data confusion query method, device and system |
CN115935429A (en) * | 2022-12-30 | 2023-04-07 | 上海零数众合信息科技有限公司 | Data processing method, device, medium and electronic equipment |
CN117729534A (en) * | 2023-05-17 | 2024-03-19 | 荣耀终端有限公司 | Query method, electronic equipment and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107547525A (en) * | 2017-08-14 | 2018-01-05 | 复旦大学 | A kind of method for secret protection of big data query processing |
CN110166466A (en) * | 2019-05-28 | 2019-08-23 | 湖南大学 | It is a kind of efficiently the multi-user of renewal authority to can search for encryption method and system |
CN110457945A (en) * | 2019-08-01 | 2019-11-15 | 卫盈联信息技术(深圳)有限公司 | Method, inquiry method, apparatus, service method, apparatus and the storage medium of list inquiry |
CN110851869A (en) * | 2019-11-14 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Sensitive information processing method and device and readable storage medium |
US20210203661A1 (en) * | 2019-12-31 | 2021-07-01 | Google Llc | Autonomously generated portable accounts |
WO2021158287A1 (en) * | 2020-02-06 | 2021-08-12 | Google Llc | Generating sequences of network data while preventing acquisition or manipulation of time data |
-
2022
- 2022-07-01 CN CN202210763526.XA patent/CN114840867B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107547525A (en) * | 2017-08-14 | 2018-01-05 | 复旦大学 | A kind of method for secret protection of big data query processing |
CN110166466A (en) * | 2019-05-28 | 2019-08-23 | 湖南大学 | It is a kind of efficiently the multi-user of renewal authority to can search for encryption method and system |
CN110457945A (en) * | 2019-08-01 | 2019-11-15 | 卫盈联信息技术(深圳)有限公司 | Method, inquiry method, apparatus, service method, apparatus and the storage medium of list inquiry |
CN110851869A (en) * | 2019-11-14 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Sensitive information processing method and device and readable storage medium |
US20210203661A1 (en) * | 2019-12-31 | 2021-07-01 | Google Llc | Autonomously generated portable accounts |
WO2021158287A1 (en) * | 2020-02-06 | 2021-08-12 | Google Llc | Generating sequences of network data while preventing acquisition or manipulation of time data |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115098549A (en) * | 2022-08-25 | 2022-09-23 | 北京数牍科技有限公司 | Fair data hiding trace query method, device, equipment and storage medium |
CN115098549B (en) * | 2022-08-25 | 2022-10-28 | 北京数牍科技有限公司 | Fair data track hiding query method, device, equipment and storage medium |
CN115544579A (en) * | 2022-11-24 | 2022-12-30 | 北京融数联智科技有限公司 | Double-random data confusion query method, device and system |
CN115935429A (en) * | 2022-12-30 | 2023-04-07 | 上海零数众合信息科技有限公司 | Data processing method, device, medium and electronic equipment |
CN115935429B (en) * | 2022-12-30 | 2023-08-22 | 上海零数众合信息科技有限公司 | Data processing method, device, medium and electronic equipment |
CN117729534A (en) * | 2023-05-17 | 2024-03-19 | 荣耀终端有限公司 | Query method, electronic equipment and system |
Also Published As
Publication number | Publication date |
---|---|
CN114840867B (en) | 2022-09-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114840867B (en) | Data query method, device and system based on exchangeable encrypted data confusion | |
Wang et al. | Search in my way: Practical outsourced image retrieval framework supporting unshared key | |
US11042664B2 (en) | Efficient implementation for differential privacy using cryptographic functions | |
CN114840866B (en) | Data query method, device and system based on blind signature data confusion | |
CN114036565A (en) | Private information retrieval system and private information retrieval method | |
CN115098549B (en) | Fair data track hiding query method, device, equipment and storage medium | |
CN113434555B (en) | Data query method and device based on searchable encryption technology | |
CN111177769A (en) | Private data protection list query method and related list query system | |
CN116502254B (en) | Method and device for inquiring trace capable of searching statistics | |
CN113836559A (en) | Sample alignment method, device, equipment and storage medium in federated learning | |
CN111783136A (en) | Data protection method, device, equipment and storage medium | |
CN115544579B (en) | Double-random data confusion query method, device and system | |
CN114756895A (en) | Secret trace data verification method and system based on homomorphic encryption | |
CN113672949A (en) | Data transmission method and system for protecting advertisement multiparty privacy | |
CN115408435A (en) | Data query method and device | |
WO2022105518A1 (en) | Electronic voting method and device | |
CN117077209B (en) | Large-scale data hiding trace query method | |
Park et al. | PKIS: practical keyword index search on cloud datacenter | |
CN117371011A (en) | Data hiding query method, electronic device and readable storage medium | |
CN117371010A (en) | Data trace query method, electronic device and readable storage medium | |
CN114611152B (en) | Query method and query system | |
CN114500006B (en) | Query request processing method and device | |
Li et al. | Forward and backward secure keyword search with flexible keyword shielding | |
WO2022110716A1 (en) | Cold start recommendation method and apparatus, computer device and storage medium | |
CN115422579A (en) | Data encryption storage and query method and system after storage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |