CN115237943B - Data retrieval method and device based on encrypted data and storage medium - Google Patents

Data retrieval method and device based on encrypted data and storage medium Download PDF

Info

Publication number
CN115237943B
CN115237943B CN202211147457.6A CN202211147457A CN115237943B CN 115237943 B CN115237943 B CN 115237943B CN 202211147457 A CN202211147457 A CN 202211147457A CN 115237943 B CN115237943 B CN 115237943B
Authority
CN
China
Prior art keywords
data
holder
query
key
random number
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.)
Active
Application number
CN202211147457.6A
Other languages
Chinese (zh)
Other versions
CN115237943A (en
Inventor
晏志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Yiketeng Information Technology Co ltd
Original Assignee
Nanjing Yiketeng Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Yiketeng Information Technology Co ltd filed Critical Nanjing Yiketeng Information Technology Co ltd
Priority to CN202211147457.6A priority Critical patent/CN115237943B/en
Publication of CN115237943A publication Critical patent/CN115237943A/en
Application granted granted Critical
Publication of CN115237943B publication Critical patent/CN115237943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/045Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply hybrid encryption, i.e. combination of symmetric and asymmetric encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3247Cryptographic 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3263Cryptographic 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 certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic 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 certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]

Abstract

The invention discloses a data retrieval method, a device and a storage medium based on encrypted data, wherein the method comprises the following steps: a data searching party generates a query condition set and carries out digital signature to generate a signature result, and sends a digital certificate of the searching party, the query condition set and the signature result to a data holding party; after the data owner successfully verifies, searching and generating a query result set and an owner random number set, and sending an owner digital certificate and the owner random number set to the data searcher; the data retrieval party generates an exchange parameter and sends the exchange parameter to the data holding party; the data holder generates a key sequence set and a ciphertext sequence set, and encrypts the ciphertext sequence set to generate a digital envelope and send the digital envelope to the data searcher; and the data searching party decrypts to obtain the target data. The invention provides a lightweight encryption retrieval method, which can solve the technical problem that the data retrieval is difficult to hide in the field of data retrieval in the prior art and ensure the data security in the retrieval process.

Description

Data retrieval method and device based on encrypted data and storage medium
Technical Field
The invention relates to the technical field of data retrieval security, in particular to a data retrieval method and device based on encrypted data and a storage medium.
Background
Data retrieval refers to retrieving data stored in a database according to the requirements of users to obtain data required by the users. In recent years, information technology is developed at a high speed, cloud end of data storage is an inevitable trend, however, the data cloud storage brings convenience and rapidness to people and also brings a series of data security problems, and how to ensure that data in a database is not leaked, how to realize safe and efficient transportation of the data, how to hide a retrieval target of a user and the like are important problems in the field of data retrieval security.
In the prior art, a need exists in the field of data retrieval for covert data retrieval. That is, for both data retrievers and data owners of data interactions, there is a need to protect and hide data. For a data retrieval party, when a query user sends a query request to a data source as a data holder, it is desirable to obtain correct retrieval results from the data source without exposing its query request to the data source. For a data holder, a data source hopes that a query user can only obtain one query result at a time, and cannot obtain more information. In addition to the security requirements of the two parties, the communication data is required to be non-falsifiable and non-eavesdroppable during the transmission of the intermediate link.
Disclosure of Invention
The invention provides a data retrieval method, a device and a storage medium based on encrypted data, aiming at effectively solving the technical problem that the data retrieval is difficult to hide in the field of data retrieval in the prior art and ensuring the data security in the data retrieval process.
According to a first aspect of the present invention, there is provided a data retrieval method based on encrypted data, the method comprising:
a data retrieval party generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, carries out digital signature on the query condition set to generate a signature result, and sends a digital certificate of the retrieval party, the query condition set and the signature result to a data holder;
the data holder verifies the digital certificate of the searcher, the query condition set and the signature result, and after the verification is successful, the data is retrieved based on the query condition set to generate a plurality of query results corresponding to the query conditions one by one, a holder random number set is generated based on the query result set comprising the query results, and the holder digital certificate and the holder random number set are sent to the data searcher, wherein the query results comprise target query results corresponding to the target data;
the data searching party generates a searching party random number, generates an exchange parameter based on the searching party random number, the holding party digital certificate and the holding party random number set, and sends the exchange parameter to the data holding party;
the data holder obtains a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtains a ciphertext sequence set based on the key sequence set and the query result set, encrypts the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sends the digital envelope to the data searcher;
the data retriever decrypts the digital envelope to obtain the target data.
Further, the method further comprises:
before the data searcher generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be searched, the data holder generates a holder public key comprising a holder public key index and a holder modulus based on an asymmetric encryption method, generates a holder private key comprising a holder private key index and a holder modulus, and issues the holder digital certificate based on the holder public key, and the data searcher generates a searcher public key and a searcher private key based on the asymmetric encryption method, and issues the searcher digital certificate based on the searcher public key.
Further, the plurality of query conditions includes a plurality of dummy query conditions and at least one real query condition corresponding to the target data parameter.
Further, the digitally signing the set of query conditions to generate signature results comprises:
the data retriever digitally signs the query condition set based on the retriever private key to generate the signature result.
Further, the verifying, by the data holder, the retriever digital certificate, the set of query conditions, and the signature result includes:
and the data holder verifies the digital certificate of the searcher and verifies and signs the inquiry condition set and the signature result based on the digital certificate of the searcher after the verification is passed.
Further, said generating a switching parameter based on said retriever nonce, said holder digital certificate, and said set of holder nonces comprises:
the data retrieval party acquires a target owner random number corresponding to the target data parameter in the owner random number set, and acquires the owner public key index and the owner modulus corresponding to the owner digital certificate;
the data retriever generates the exchange parameters based on the retriever nonce, the target holder nonce, the holder public key exponent, and the holder modulus.
Further, the data retriever generating the exchange parameters based on the retriever nonce, the target holder nonce, the holder public key exponent, and the holder modulus comprises:
generating the exchange parameter based on:
s r =(c e mod n)⊕m r
wherein s is r Representing the exchange parameters, c the retriever random number, e the owner public key exponent, n the owner modulus, m r The target holder random number is represented, mod is a remainder operator, and ≧ is an XOR operator.
Further, the obtaining, by the data holder, a key sequence set based on the exchange parameter, a holder private key corresponding to the holder digital certificate, and the holder random number set includes:
for each owner random number in the owner random number set, the data owner obtains a key sequence corresponding to the owner random number in the key sequence set based on the exchange parameter, the owner random number, the owner private key index and the owner modulus.
Further, the data owner obtaining the key sequence corresponding to the owner random number in the key sequence set based on the exchange parameter, the owner random number, the owner private key index and the owner modulus comprises:
obtaining the key sequence according to the following formula:
k t = (s r ⊕m t ) d mod n,
wherein k is t Representing said key sequence, s r Represents the switching parameter, m t Representing the random number of the holder, d representing the private key exponent of the holder, n representing the modulus of the holder, mod being a remainder operator, ^ being an exclusive-or operator.
Further, the obtaining a ciphertext sequence set based on the key sequence set and the query result set includes:
and aiming at each key sequence in the key sequence set, the data holder acquires a query result corresponding to the key sequence in the query result set, and obtains a ciphertext sequence based on the key sequence and the query result.
Further, the obtaining of the ciphertext sequence based on the key sequence and the query result includes:
obtaining the ciphertext sequence according to the following formula:
E t = k t ⊕x t
wherein E is t Representing said ciphertext sequence, k t Representing a key sequence, x t Indicating the query result and ≧ the exclusive or operator.
Further, the encrypting the set of ciphertext sequences to generate the digital envelope based on the digital envelope encryption method comprises:
the data holder generates a session key and obtains a searcher public key structure of the searcher public key, encrypts the session key based on the searcher public key to obtain an encryption result, obtains an identifier of a symmetric encryption method corresponding to the session key, and encrypts the ciphertext sequence set based on the symmetric encryption method and the session key to generate encrypted information;
the data holder generates the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information.
Further, the data holder generating the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information includes:
generating the digital envelope based on:
Envelop eb (E 0 ,…,E i-1 ,key ab ) =Pub eb ||Enc eb (key ab )||Algo|| Enc keyab (E 0 ,E 1 ,…,E i-1 ),
wherein, envelop eb (E 0 ,…,E i-1 ,key ab ) Represents the digital envelope, (E) 0 ,E 1 ,…,E i-1 ) Representing a set of ciphertext sequences, key, comprising i ciphertext sequences ab Representing said session key, pub eb Representing the public key structure of the searcher, enc eb (key ab ) Representing said encryption result, algo representing said identity, enc keyab (E 0 ,E 1 ,…,E i-1 ) Representing the encryption information, the | operator representing concatenating two or more strings with a connector to obtain a string.
Further, the data retriever decrypting the digital envelope to obtain the target data includes:
the data searcher decrypts the digital envelope based on the private key of the searcher to obtain the session key, decrypts the encrypted information based on the session key and the identifier to obtain the ciphertext sequence set, and obtains the target data based on the ciphertext sequence set and the random number of the searcher.
Further, the obtaining the target data based on the ciphertext sequence set and the searcher nonce comprises:
and the data searching party acquires a target ciphertext sequence corresponding to the target data parameter from the ciphertext sequence set, obtains the target query result based on the target ciphertext sequence and the random number of the searching party, and obtains the target data based on the target query result.
Further, the obtaining the target query result based on the target ciphertext sequence and the searcher nonce comprises:
obtaining the target query result based on the following formula:
x r =E r ⊕c,
wherein x is r Representing the target query result, E r And c represents the random number of the search party, and ^ is an XOR operator.
According to a second aspect of the present invention, the present invention also provides a data retrieval method based on encrypted data, for a data retrieval party associated with a data holder, the method comprising:
generating a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, performing digital signature on the query condition set to generate a signature result, and sending a retriever digital certificate, the query condition set and the signature result to the data holder;
receiving a holder digital certificate and a holder random number set sent by the data holder;
generating a searcher nonce, and generating an exchange parameter based on the searcher nonce, the holder digital certificate, and the set of holder nonces, and sending the exchange parameter to the data holder;
receiving a digital envelope sent by the data holder;
decrypting the digital envelope to obtain the target data.
According to a third aspect of the present invention, the present invention further provides a data retrieval method based on encrypted data, for a data holder, the data holder being associated with a data retriever, the method comprising:
receiving a digital certificate of a searching party, a query condition set and a signature result which are sent by the data searching party;
verifying the digital certificate of the searcher, the query condition set and the signature result, searching data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one by one, generating a random number set of the holder based on the query result set comprising the query results, and sending the digital certificate of the holder and the random number set of the holder to the data searcher, wherein the query results comprise target query results corresponding to the target data;
receiving the exchange parameters sent by the data searching party;
and obtaining a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtaining a ciphertext sequence set based on the key sequence set and the query result set, encrypting the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sending the digital envelope to the data searcher, so that the data searcher decrypts the digital envelope to obtain the target data.
According to a fourth aspect of the present invention, the present invention also provides an encrypted data-based data retrieval apparatus for use with a data retrieval party associated with a data holder, the apparatus comprising:
a retrieval application sending unit, configured to generate a query condition set including a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, perform digital signature on the query condition set to generate a signature result, and send a retriever digital certificate, the query condition set, and the signature result to the data holder;
the owner random number set receiving unit is used for receiving an owner digital certificate and an owner random number set sent by the data owner;
an exchange parameter transmitting unit configured to generate a searcher random number, generate an exchange parameter based on the searcher random number, the holder digital certificate, and the holder random number set, and transmit the exchange parameter to the data holder;
a digital envelope receiving unit, configured to receive a digital envelope sent by the data holder;
a target data obtaining unit to decrypt the digital envelope to obtain the target data.
According to a fifth aspect of the present invention, the present invention also provides an encrypted data-based data retrieval apparatus for a data holder associated with a data retrieval party, the apparatus comprising:
the retrieval application receiving unit is used for receiving the digital certificate of the retrieval party, the query condition set and the signature result sent by the data retrieval party;
a holder random number set sending unit, configured to verify the retriever digital certificate, the query condition set, and the signature result, retrieve data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one to one, generate a holder random number set based on a query result set including the plurality of query results, and send the holder digital certificate and the holder random number set to the data retriever, where the plurality of query results include a target query result corresponding to the target data;
an exchange parameter receiving unit, configured to receive an exchange parameter sent by the data retrieving party;
a digital envelope sending unit, configured to obtain a key sequence set based on the exchange parameter, a holder private key corresponding to the holder digital certificate, and the holder random number set, obtain a ciphertext sequence set based on the key sequence set and the query result set, encrypt the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and send the digital envelope to the data retriever, so that the data retriever decrypts the digital envelope to obtain the target data.
According to another aspect of the present invention, there is also provided a storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform any of the encrypted data based data retrieval methods described above.
Through one or more of the above embodiments in the present invention, at least the following technical effects can be achieved:
the data retrieval method based on the encrypted data provided by the technical scheme of the invention is a lightweight retrieval method of the concealed data, and meets the safety requirement of the concealed data retrieval scene through the interaction of the asymmetric public and private key pair and the protocol of the data holder and the data retriever.
In the technical scheme of the invention, the data holder and the data searcher realize identity authentication and data encryption and decryption through digital certificates, thereby protecting the data integrity and confidentiality of the protocol interaction flow. Through the cryptographic algorithm, protocol interaction and query condition confusion, the data source is hidden by query data of a data retrieval party, and meanwhile, only one target result can be obtained by one-time query, the data of the data source is not exposed too much, and the benefit of the data source to the held data is guaranteed.
In the invention, in the transmission process of target data, data interaction is carried out through a digital envelope, and a two-layer encryption system combining a symmetric encryption method and an asymmetric encryption method is used, so that even if an encrypted file is illegally intercepted, the file cannot be decrypted because an interceptor cannot obtain a communication key of a sender, and the authenticity and the integrity of data transmission are ensured.
In conclusion, the protocol interaction process of the invention is simple, excessive public and private key pairs are not needed, the algorithm is easy to realize, the calculation process is simplified, and the invention is a safe and reliable lightweight data retrieval technology.
Drawings
The technical solution and other advantages of the present invention will become apparent from the following detailed description of specific embodiments of the present invention, which is to be read in connection with the accompanying drawings.
Fig. 1 is a flowchart illustrating steps of a data retrieval method based on encrypted data according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a data interaction process according to an embodiment of the present invention;
FIG. 3 is an encryption diagram of the digital envelope encryption method of the present invention;
fig. 4 is a flowchart illustrating steps of a data retrieval method based on encrypted data for a data retrieval party according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating steps of a method for data retrieval based on encrypted data for a data holder according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an encrypted data-based data retrieval apparatus for a data retrieval party according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an encrypted data-based data retrieval device for a data owner according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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 an aspect of the present invention, the present invention provides a data retrieval method based on encrypted data, and fig. 1 is a flowchart illustrating steps of the data retrieval method based on encrypted data according to an embodiment of the present invention, where the method includes:
step 101: a data retrieval party generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, carries out digital signature on the query condition set to generate a signature result, and sends a digital certificate of the retrieval party, the query condition set and the signature result to a data holder;
step 102: the data holder verifies the digital certificate of the searcher, the query condition set and the signature result, and after the verification is successful, the data is retrieved based on the query condition set to generate a plurality of query results corresponding to the query conditions one by one, a holder random number set is generated based on the query result set comprising the query results, and the holder digital certificate and the holder random number set are sent to the data searcher, wherein the query results comprise target query results corresponding to the target data;
step 103: the data searching party generates a searching party random number, generates an exchange parameter based on the searching party random number, the holding party digital certificate and the holding party random number set, and sends the exchange parameter to the data holding party;
step 104: the data holder obtains a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtains a ciphertext sequence set based on the key sequence set and the query result set, encrypts the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sends the digital envelope to the data searcher;
step 105: the data retriever decrypts the digital envelope to obtain the target data.
Fig. 1 is a flowchart illustrating steps of a data retrieval method based on encrypted data according to an embodiment of the present invention, fig. 2 is a schematic diagram illustrating a data interaction process according to an embodiment of the present invention, and the steps 101 to 105 are specifically described below based on fig. 1 and fig. 2.
In step 101, a data retrieving party generates a query condition set including a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, performs digital signature on the query condition set to generate a signature result, and sends a digital certificate of the retrieving party, the query condition set and the signature result to a data holding party.
Illustratively, in data retrieval, a data retrieval party sends a retrieval request to a data holder, wherein the retrieval request comprises related information of data to be acquired and safety information for ensuring data safety. Specifically, when a query user as a data retrieving party sends a query request to a data source as a data holding party, it is desirable to obtain correct results without exposing its query request to the data source. In order to solve the problem, a data retrieval party acquires a target data parameter corresponding to target data to be retrieved, and generates at least one real query condition according to at least one target data parameter. In order not to expose own query requirements, the data retriever simultaneously generates a plurality of false query conditions for confusing real query conditions, and mixes the real query conditions and the plurality of false query conditions to generate a query condition set comprising the plurality of query conditions.
After the query condition set is generated, the whole query condition set is digitally signed through a private key of a retrieval party corresponding to the data retrieval party to generate a signature result Sign db . The digital signature has two functions, namely, the function of confirming that the message is actually sent by the signature of the sender because an unknown person difficultly counterfeits the signature of the sender, and the function of ensuring the integrity of the message because the digital signature can ensure the integrity of the message, so that the digital signature can play a role of protecting data in a cryptographic algorithm.
The data searcher itself has a searcher digital certificate, and after generating the inquiry condition set and signature result, as shown in fig. 2, the data searcher transmits a search request to the data holder, that is, transmits the searcher digital certificate, the inquiry condition set and signature result to the data holder.
In step 102, the data holder verifies the digital certificate of the searcher, the query condition set and the signature result, and after the verification is successful, retrieves data based on the query condition set to generate a plurality of query results corresponding to the query conditions one by one, generates a holder random number set based on the query result set including the query results, and sends the holder digital certificate and the holder random number set to the data searcher, wherein the query results include a target query result corresponding to the target data.
Illustratively, the data holder verifies the retriever digital certificate, the set of query conditions and the signature result. Specifically, after receiving a retrieval request from a data retrieving party, a data holding party first verifies a digital certificate of the retrieving party to determine whether the other party is a legal data retrieving party. And after the digital certificate of the searcher is verified to be a legal certificate, signature verification is carried out on the query condition set and the signature result, so that whether the query condition set is complete data or not and whether the signature result is from a legal data searcher or not are determined.
After successful verification, the query condition set (t) is checked 0 ,t 1 ,…,t r ,…,t i-1 ) Analyzing to obtain each query condition, then performing data retrieval in the database, retrieving corresponding query results according to each query condition, and generating a query result set (x) 0 ,x 1 ,…,x r ,…,x i-1 ). The query conditions correspond to the query results one by one, the number of elements in the set is consistent, and the query conditions with the same serial number correspond to the query results.
Because only the query condition t is in the query condition set r Is a true query condition, therefore, only the query result m in the query result set r And the target query result corresponding to the target data is obtained. But it does not know to the data holder which is the true query condition and therefore which data is the target query result that the user really needs. If the data holder sends all the query results to the data retriever, not only information is leaked, but also data transmission load is increased. For a data holder, a data source hopes that a query user can only obtain one query result at a time, and cannot obtain more information. To solve the problem, the data holder does not directly send the query result set to the data retriever, but temporarily stores the query result set on a temporary storage, and based on the query result set (x) 0 ,x 1 ,…,x r ,…,x i-1 ) Generating a set of owner random numbers (m) 0 ,m 1 ,…,m r ,…,m i-1 )。
The data holder has a holder digital certificate, and the data searching party transmits the holder digital certificate and the holder random number set to the data searching party in encrypted communication.
In step 103, the data searcher generates a searcher nonce, generates an exchange parameter based on the searcher nonce, the holder digital certificate, and the set of holder nonces, and transmits the exchange parameter to the data holder.
Illustratively, the data searching party generates a searching party random number c and obtains the relevant parameters of the digital certificate of the holding party after receiving the digital certificate of the holding party and the random number set of the holding party, and obtains the random number corresponding to the target data in the random number set of the holding party, then generates the exchange parameters and sends the exchange parameters to the data holding party. In the invention, the exchange parameter has two key points, on one hand, different from the previous set, the exchange parameter has only one data which is specially generated aiming at the target data, the exchange parameter is related with the target data, but not directly related target data parameter, therefore, the data holder can not obtain the data wanted by the user according to the exchange parameter, and the requirement of hiding the data by the user is realized. On the other hand, the exchange parameter uses the data related to the holder public key corresponding to the holder digital certificate, so the exchange parameter is only valid for the data holder, and other unknown persons cannot break the required information even receiving the exchange parameter, thereby ensuring the data security.
In step 104, the data holder obtains a key sequence set based on the exchange parameter, a holder private key corresponding to the holder digital certificate, and the holder random number set, obtains a ciphertext sequence set based on the key sequence set and the query result set, encrypts the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sends the digital envelope to the data retriever.
Illustratively, after receiving the exchange parameters, the data owner performs data processing on each owner random number in the owner random number set to obtain key sequences with consistent quantity, and a plurality of key sequences form the key sequence set.
In order to realize the transmission of target data, a data holder obtains a ciphertext sequence set based on a key sequence set and a query result set, the query result set is in a temporary storage state in the previous step, and only in the step, the data processing is carried out on the query result set and the data processing is sent to a user in a safe mode.
When data is sent, in order to further guarantee data transmission safety, the data are transmitted by adopting a digital envelope encryption method so as to realize double data protection. Specifically, the set of ciphertext sequences is encrypted to generate a digital envelope, and the digital envelope is sent to the data retriever.
In the process of encrypting through the digital envelope, a sender randomly generates a symmetric key to encrypt data into a ciphertext, but the key is also given to a receiver, and the receiver can correctly decrypt the ciphertext. The key is encrypted with the public key of the receiver to ensure that only the receiver can decrypt the key, and similarly, the key is packaged in a letter envelope and only the receiver can check the key. Fig. 3 is an encryption schematic diagram of the digital envelope encryption method in the present invention, and the following explains the digital envelope encryption technology according to fig. 3:
s1: the data holder encrypts the plaintext by using the symmetric key to generate ciphertext information.
S2: the data holder encrypts the symmetric key using the public key of the data retriever to generate a digital envelope.
S3: and the data holder sends the digital envelope and the ciphertext information to the data searcher.
S4: and after receiving the encrypted information of the data holder, the data retrieval party opens the digital envelope by using the private key of the data retrieval party to obtain the symmetric key.
S5: and the data retrieval party decrypts the ciphertext information by using the symmetric key to obtain an initial plaintext.
In the invention, data is transmitted through a digital envelope, the digital envelope method is a method for distributing a symmetric key through the result of asymmetric encryption (an encryption method with a public key and a private key), and the digital envelope is a technology for realizing information confidentiality verification. When the receiving party receives the digital envelope, the private key or the pre-shared key is firstly used for decryption to obtain a symmetric key, and then the symmetric key is used for decryption of the ciphertext to obtain the original text.
In step 105, the data retriever decrypts the digital envelope to obtain the target data.
Illustratively, after receiving the digital envelope, the data searcher decrypts the digital envelope by using the private key of the searcher to obtain a symmetric key, and then decrypts the digital envelope by using the symmetric key to obtain information, thereby analyzing the target data.
Further, the method further comprises:
before the data searcher generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be searched, the data holder generates a holder public key comprising a holder public key index and a holder modulus based on an asymmetric encryption method, generates a holder private key comprising a holder private key index and a holder modulus, and issues the holder digital certificate based on the holder public key, and the data searcher generates a searcher public key and a searcher private key based on the asymmetric encryption method, and issues the searcher digital certificate based on the searcher public key.
Illustratively, the scheme uses a symmetric encryption method and an asymmetric encryption method. The symmetric encryption method is used only when final transmission of the target data is performed. And before transmitting the target data, the data transmission uses an asymmetric encryption method. The multiple encryption algorithms can realize an asymmetric encryption method, and the same encryption algorithm is used by both data interaction parties. In the present invention, a classical RSA asymmetric encryption algorithm may be used, which usually generates a pair of RSA keys, one of which is a secret private key that is stored by the user, and the other of which is a public key that can be made public, or even registered in a network server. The RSA algorithm is a widely studied public key algorithm, has undergone various attacks, and is generally considered to be one of the most excellent public key schemes at present.
Before a data searching party sends a searching request, the two parties respectively generate a private key, a public key and a digital certificate which are required by an asymmetric encryption algorithm, and respectively and strictly store own password information.
For a data holder, the data holder generates a holder public key (e, n) and a holder private key (d, n) based on an asymmetric encryption method, wherein e is a holder public key index, d is a holder private key index, and n is a holder modulus. Then issuing a digital certificate Cert of the holder based on the public key (d, n) of the holder e
For the data retriever, the data retriever generates the public key of the retriever based on the same asymmetric encryption method (e) b ,n b ) And the holder private key (d) b ,n b ) Wherein e is b For the public key index of the search party, d b For the index of the private key of the searcher, n b Is the search module. Then based on the public key of the searcher (e) b ,n b ) Issuing a holder digital certificate Cert eb
Further, the plurality of query conditions includes a plurality of dummy query conditions and at least one real query condition corresponding to the target data parameter.
Illustratively, when a query user as a data retrieving party sends a query request to a data source as a data holding party, it is desirable to obtain correct results without exposing the query request to the data source. In order to solve the problem, a data retrieval party acquires target data parameters corresponding to target data to be retrieved, generates at least one real query condition according to the at least one target data parameter, simultaneously generates a plurality of false query conditions for confusing the real query conditions in order not to expose the query requirements of the data retrieval party, and mixes the real query conditions and the plurality of false query conditions to generate a query condition set comprising the plurality of query conditions.
For example, the data retriever generates two random numbers i and r, respectively, and r ∈ [0, i-1 ]]The random number i is the number of the query conditions in the query condition set, and the random number r is the sequence number corresponding to the real query condition. Then construct a query condition set (t) with i query conditions 0 ,t 1 ,…,t r ,…,t i-1 ) Wherein only the query condition t r The query is a true query, and the rest of the query are perturbed.
Further, said digitally signing the set of query conditions to generate a signature result comprises:
the data retriever digitally signs the query condition set based on the retriever private key to generate the signature result.
Illustratively, the data retriever uses the private key (d) b ,n b ) Performing digital signature on a query condition set (t) containing i query conditions 0 ,t 1 ,…,t r ,…,t i-1 ) Performing encryption processing, performing digital signature to generate signature result Sign db
Further, the verifying the retriever digital certificate, the query condition set and the signature result by the data holder comprises:
and the data holder verifies the digital certificate of the searcher and verifies and signs the inquiry condition set and the signature result based on the digital certificate of the searcher after the verification is passed.
Illustratively, the data holder verifies the digital certificate of the data retriever to determine whether the other party is a legal data retriever. After the digital certificate of the searcher is verified to be a legal certificate, signature verification is carried out on the inquiry condition set and the signature result, so as to determine whether the inquiry condition set is complete data and whether the signature result is from a legal data searcher.
Further, said generating a switching parameter based on said retriever nonce, said holder digital certificate, and said set of holder nonces comprises:
the data retrieval party acquires a target owner random number corresponding to the target data parameter in the owner random number set, and acquires the owner public key index and the owner modulus corresponding to the owner digital certificate;
the data retriever generates the exchange parameters based on the retriever nonce, the target holder nonce, the holder public key exponent, and the holder modulus.
Further, the data retriever generating the exchange parameters based on the retriever nonce, the target holder nonce, the holder public key exponent, and the holder modulus comprises:
generating the exchange parameter based on:
s r =(c e mod n)⊕m r
wherein s is r Representing the exchange parameter, c representing the searcher nonce, e representing the holder public key exponent, n representing the holder modulus, m r The target holder random number is represented, mod is a remainder operator, and ≧ is an XOR operator.
Illustratively, the data searching party realizes the hiding of the searching information through the false query condition when the searching request occurs, and under the condition of simultaneously having the false query condition and the real query condition, how to accurately obtain the target data is the key point of the invention. In this step, the data retrieving party generates the exchange parameter specially for the target data, and encrypts the data by using the public key index e of the holding party and the modulus n of the holding party in the process.
Further, the obtaining, by the data holder, a key sequence set based on the exchange parameter, a holder private key corresponding to the holder digital certificate, and the holder random number set includes:
for each owner random number in the owner random number set, the data owner obtains a key sequence corresponding to the owner random number in the key sequence set based on the exchange parameter, the owner random number, the owner private key index and the owner modulus.
Further, the data holder obtaining a key sequence corresponding to the holder random number in the key sequence set based on the exchange parameter, the holder random number, the holder private key index and the holder modulus comprises:
obtaining the key sequence according to the following formula:
k t = (s r ⊕m t ) d mod n,
wherein k is t Representing said key sequence, s r Represents the exchange parameter, m t Representing the random number of the holder, d representing the private key exponent of the holder, n representing the modulus of the holder, mod being a remainder operator, ^ being an exclusive-or operator.
Further, the obtaining a ciphertext sequence set based on the key sequence set and the query result set includes:
and aiming at each key sequence in the key sequence set, the data holder acquires a query result corresponding to the key sequence in the query result set, and obtains a ciphertext sequence based on the key sequence and the query result.
Further, the obtaining of the ciphertext sequence based on the key sequence and the query result includes:
obtaining the ciphertext sequence according to the following formula:
E t = k t ⊕x t
wherein, E t Representing the ciphertext sequence, k t Representing a key sequence, x t Indicating the query result, and ≧ the xor operator.
Illustratively, the invention realizes the information hiding transmission through mathematical operation, in particular, firstly calculating the key sequence k t Calculating the ciphertext sequence E again t . The value i is the number of the query conditions in the query condition set, the value r is the serial number corresponding to the real query condition, r belongs to [0, i-1 ]]. Firstly based on the operation formula k t = (s r ⊕m t ) d mod n generating a key sequence k t Based on the operation formula E t = k t ⊕x t Generating a ciphertext sequence E t
The following illustrates how the technical solution of the present invention specifically reduces the target data through multiple mathematical operations:
suppose that there are 3 query conditions (t) for the data retriever 0 ,t 1 ,t 2 ) The corresponding data holder retrieves 3 query results (x) 0 ,x 1 ,x 2 ) Assume the 3 rd query condition t 2 Is the data that the inquirer really wants to inquire, in this example, i is 3, r is 3, and the corresponding inquiry result is x 2
Data retrieval direction sends query conditions (t) to data holder 0 ,t 1 ,t 2 ) The data holder retrieves 3 query results (x) 0 ,x 1 ,x 2 ) And generates 3 random numbers to the inquiring party (m) in one-to-one correspondence 0 ,m 1 ,m 2 ). The data searching party generates a random number c and selects a corresponding t 2 M of 2 Calculating the exchange parameter s 2 =(c e mod n)⊕m 2 And then the data are sent to a data holder, and the data holder further performs mathematical operation after receiving the exchange parameters.
First, the data holder calculates the key sequence based on the following equation:
k 0 = (s 2 ⊕m 0 ) d mod n,
k 1 = (s 2 ⊕m 1 ) d mod n,
k 2 = (s 2 ⊕m 2 ) d mod n,
the data holder then calculates the ciphertext sequence based on:
E 0 = k 0 ⊕x 0
E 1 = k 1 ⊕x 1
E 2 = k 2 ⊕x 2
encryption sequence (E) to be generated by data holder 0 ,E 1 ,E 2 ) And sending the data to a data retrieval party. The data retrieval party selects a corresponding target query result E according to the actual 3 rd query condition to be searched 2 Because k is 2 And = c, the following operation is corresponded to:
E 2 ⊕c =x 2 ⊕k 2 ⊕c =x 2 ⊕c⊕c =x 2
the mathematical principle on which this equation is based is: after a number a is xored twice, the result is still a. Due to s 2 Exclusive or of m 2 ,k 2 Exclusive OR m again in calculation 2 The operation is restored to q = (c) e mod n) and then further decrypt the operation c = (q) by the holder private key d d mod n). The whole operation process is shown as the following formula:
k 2 =(s 2 ⊕m 2 ) d mod n =((c e mod n)⊕m 2 ⊕m 2 ) d mod n=(c e mod n) d mod n=c。
wherein x is 2 Is the correct query result, and for k 0 ,k 1 Although the operation can be decrypted to calculate the result, the result is a value which has no relation with c, and the inquiring party of the value can not be deduced reversely, and further the inquiring party can not pass through E 0 And E 1 Obtaining a query result x 0 And x 1 . Thus, target data required by the data search party can be obtained.
Further, the encrypting the set of ciphertext sequences to generate the digital envelope based on the digital envelope encryption method comprises:
the data holder generates a session key and acquires a searcher public key structure of the searcher public key, encrypts the session key based on the searcher public key to obtain an encryption result, acquires an identifier of a symmetric encryption method corresponding to the session key, and encrypts the ciphertext sequence set based on the symmetric encryption method and the session key to generate encrypted information;
the data holder generates the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information.
Further, the data holder generating the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information includes:
generating the digital envelope based on:
Envelop eb (E 0 ,E 1 ,…,E i-1 ,key ab ) =Pub eb ||Enc eb (key ab )||Algo|| Enc keyab (E 0 ,E 1 ,…,E i-1 ),
wherein, envelop eb (E 0 ,E 1 ,…,E i-1 ,key ab ) Representing said digital envelope, (E) 0 ,E 1 ,…,E i-1 ) Representing a set of ciphertext sequences, key, comprising i ciphertext sequences ab Representing said session key, pub eb Representing the public key structure of the searcher, enc eb (key ab ) Representing said encryption result, algo representing said identity, enc keyab (E 0 ,E 1 ,…,E i-1 ) Representing the encryption information, the | operator representing concatenating two or more strings with a connector to obtain a string.
Illustratively, the data holder encrypts the transmission ciphertext sequence using a digital envelope methodSet (E) 0 ,…,E i-1 ) Encryption mode Envelop eb (E 0 ,E 1 ,…,E i-1 ,key ab ) =Pub eb ||Enc eb (key ab )||Algo|| Enc keyab (E 0 ,E 1 ,…,E i-1 ) Wherein, pub eb For querying the public key structure of the user, enc eb (key ab ) Encrypting a session key for use with a querying user public key ab Algo is a symmetric encryption algorithm identifier, enckey ab (E 0 ,E 1 ,…,E i-1 ) In order to adopt Algo symmetric encryption algorithm and use session key ab Encryption ciphertext sequence set (E) 0 ,E 1 ,…,E i-1 )。
Further, the data retriever decrypting the digital envelope to obtain the target data includes:
the data searcher decrypts the digital envelope based on the private key of the searcher to obtain the session key, decrypts the encrypted information based on the session key and the identifier to obtain the ciphertext sequence set, and obtains the target data based on the ciphertext sequence set and the random number of the searcher.
Further, the obtaining the target data based on the ciphertext sequence set and the searcher nonce comprises:
and the data searching party acquires a target ciphertext sequence corresponding to the target data parameter from the ciphertext sequence set, obtains the target query result based on the target ciphertext sequence and the random number of the searching party, and obtains the target data based on the target query result.
Further, the obtaining the target query result based on the target ciphertext sequence and the searcher nonce comprises:
obtaining the target query result based on the following formula:
x r =E r ⊕c,
wherein x is r Representing the target query result, E r And c represents the random number of the search party, and [ ] is an XOR operator.
Illustratively, the data retriever receives a digital envelope eb (E 0 ,E 1 ,…,E i-1 ,key ab ) Thereafter, the searcher's private key (d) is used b ,n b ) Opening the envelope, and specifically, decrypting by using the private key of the searcher to obtain the session key ab Using session key ab Decrypting with a symmetric encryption algorithm corresponding to the identification Algo, wherein the decryption object is encryption information Enc keyab (E 0 ,E 1 ,…,E i-1 ) And after decryption, the original ciphertext sequence set (E) of the data holder is obtained 0 ,E 1 ,…,E i-1 ) Finally based on the operation formula x r =E r And ^ c, obtaining a target query result and further obtaining target data.
Through one or more of the above embodiments of the present invention, at least the following technical effects can be achieved:
the data retrieval method based on the encrypted data provided by the technical scheme of the invention is a lightweight retrieval method of the concealed data, and meets the safety requirement of the concealed data retrieval scene through the interaction of the asymmetric public and private key pair and the protocol of the data holder and the data retriever.
In the technical scheme of the invention, the data holder and the data searcher realize identity authentication and data encryption and decryption through digital certificates, thereby protecting the data integrity and confidentiality of the protocol interaction flow. The hiding of the query data of the data retrieval party to the data source is realized through the cryptographic algorithm, protocol interaction and query condition confusion, and simultaneously, only one target result can be obtained through one-time query, so that the data of the data source is not excessively exposed, and the benefit of the data source to the held data is ensured.
In the invention, in the transmission process of target data, data interaction is carried out through a digital envelope, and a two-layer encryption system combining a symmetric encryption method and an asymmetric encryption method is used, so that even if an encrypted file is illegally intercepted, the file cannot be decrypted because an interceptor cannot obtain a communication key of a sender, and the authenticity and the integrity of data transmission are ensured.
In conclusion, the protocol interaction process of the invention is simple, excessive public and private key pairs are not needed, the algorithm is easy to realize, the calculation process is simplified, and the invention is a safe and reliable lightweight data retrieval technology.
In conclusion, the protocol interaction process of the invention is simple, does not need too many public and private key pairs, is easy to realize, has simple calculation process, and is a light-weight data retrieval technology based on encryption.
According to a second aspect of the present invention, the present invention further provides a data retrieval method based on encrypted data, which is used for a data retrieval party, where the data retrieval party is associated with a data holder, and fig. 4 is a flowchart of steps of a data retrieval method based on encrypted data, which is used for the data retrieval party and is provided by an embodiment of the present invention, and as shown in fig. 4, the method includes:
step 201: generating a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, performing digital signature on the query condition set to generate a signature result, and sending a digital certificate of a retrieving party, the query condition set and the signature result to the data holder;
step 202: receiving a holder digital certificate and a holder random number set sent by the data holder;
step 203: generating a searcher nonce, and generating an exchange parameter based on the searcher nonce, the holder digital certificate, and the set of holder nonces, and sending the exchange parameter to the data holder;
step 204: receiving a digital envelope sent by the data holder;
step 205: decrypting the digital envelope to obtain the target data.
Other aspects and implementation details of the encrypted data-based data retrieval method are the same as or similar to those of the encrypted data-based data retrieval method described above, and are not described herein again.
According to a third aspect of the present invention, the present invention further provides a data retrieval method based on encrypted data, which is used for a data holder, where the data holder is associated with a data retrieval party, and fig. 5 is a flowchart of steps of a data retrieval method based on encrypted data, which is used for the data holder and is provided by an embodiment of the present invention, and as shown in fig. 5, the method includes:
step 301: receiving a digital certificate of a searching party, a query condition set and a signature result which are sent by the data searching party;
step 302: verifying the digital certificate of the searcher, the query condition set and the signature result, searching data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one by one, generating a random number set of the holder based on the query result set comprising the query results, and sending the digital certificate of the holder and the random number set of the holder to the data searcher, wherein the query results comprise target query results corresponding to the target data;
step 303: receiving the exchange parameters sent by the data searching party;
step 304: and obtaining a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtaining a ciphertext sequence set based on the key sequence set and the query result set, encrypting the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sending the digital envelope to the data searcher, so that the data searcher decrypts the digital envelope to obtain the target data.
Other aspects and implementation details of the encrypted data-based data retrieval method are the same as or similar to those of the encrypted data-based data retrieval method described above, and are not described herein again.
According to a fourth aspect of the present invention, the present invention further provides an encrypted data based data retrieval apparatus for a data retrieving party, where the data retrieving party is associated with a data holding party, and fig. 6 is a schematic structural diagram of an encrypted data based data retrieval apparatus for a data retrieving party according to an embodiment of the present invention, where the apparatus includes:
a retrieval application sending unit 401, configured to generate a query condition set including a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, perform digital signature on the query condition set to generate a signature result, and send a digital certificate of a retriever, the query condition set, and the signature result to the data holder;
a holding party random number set receiving unit 402, configured to receive a holding party digital certificate and a holding party random number set sent by the data holding party;
an exchange parameter sending unit 403, configured to generate a searcher random number, generate an exchange parameter based on the searcher random number, the holder digital certificate, and the holder random number set, and send the exchange parameter to the data holder;
a digital envelope receiving unit 404, configured to receive a digital envelope sent by the data holder;
a target data obtaining unit 405, configured to decrypt the digital envelope to obtain the target data.
Other aspects and implementation details of the encrypted data-based data retrieval device are the same as or similar to those of the encrypted data-based data retrieval method described above, and are not described herein again.
According to a fifth aspect of the present invention, the present invention further provides an encrypted data based data retrieval apparatus, for a data holder, where the data holder is associated with a data retrieval party, and fig. 7 is a schematic structural diagram of an encrypted data based data retrieval apparatus for a data holder according to an embodiment of the present invention, as shown in fig. 7, the apparatus includes:
a retrieval application receiving unit 501, configured to receive a digital certificate of a retrieving party, a query condition set, and a signature result sent by the data retrieving party;
a holder random number set sending unit 502, configured to verify the retriever digital certificate, the query condition set, and the signature result, retrieve data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one to one, generate a holder random number set based on a query result set including the plurality of query results, and send the holder digital certificate and the holder random number set to the data retriever, where the plurality of query results include a target query result corresponding to the target data;
an exchange parameter receiving unit 503, configured to receive an exchange parameter sent by the data retrieving party;
a digital envelope sending unit 504, configured to obtain a key sequence set based on the exchange parameter, a holder private key corresponding to the holder digital certificate, and the holder random number set, obtain a ciphertext sequence set based on the key sequence set and the query result set, encrypt the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and send the digital envelope to the data retriever, so that the data retriever decrypts the digital envelope to obtain the target data.
Other aspects and implementation details of the encrypted data-based data retrieval device are the same as or similar to those of the encrypted data-based data retrieval method described above, and are not described herein again.
According to another aspect of the present invention, there is also provided a storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform any of the encrypted data based data retrieval methods described above.
In summary, although the present invention has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, therefore, the scope of the present invention shall be determined by the appended claims.

Claims (20)

1. A method for data retrieval based on encrypted data, the method comprising:
a data retrieval party generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, digitally signs the query condition set to generate a signature result, and sends a digital certificate of the data retrieval party, the query condition set and the signature result to a data holder, wherein the query conditions comprise a plurality of false query conditions and at least one real query condition corresponding to the target data parameters;
the data holder verifies the digital certificate of the searcher, the query condition set and the signature result, and after the verification is successful, the data is retrieved based on the query condition set to generate a plurality of query results corresponding to the query conditions one by one, a holder random number set is generated based on the query result set comprising the query results, and the holder digital certificate and the holder random number set are sent to the data searcher, wherein the query results comprise target query results corresponding to the target data;
the data searching party generates a searching party random number, generates an exchange parameter based on the searching party random number, the holding party digital certificate and the holding party random number set, and sends the exchange parameter to the data holding party;
the data holder obtains a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtains a ciphertext sequence set based on the key sequence set and the query result set, encrypts the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sends the digital envelope to the data searcher;
the data retriever decrypts the digital envelope to obtain the target data.
2. The method of claim 1, wherein the method further comprises:
before the data retriever generates a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, the data holder generates a holder public key comprising a holder public key index and a holder modulus based on an asymmetric encryption method, generates the holder private key comprising a holder private key index and the holder modulus, and issues the holder digital certificate based on the holder public key, and the data retriever generates a retriever public key and a retriever private key based on the asymmetric encryption method, and issues the retriever digital certificate based on the retriever public key.
3. The method of claim 2, wherein digitally signing the set of query conditions to generate a signature result comprises:
the data retriever digitally signs the query condition set based on the retriever private key to generate the signature result.
4. The method of claim 3, wherein the data holder verifying the retriever digital certificate, the set of query conditions and the signature result comprises:
and the data holder verifies the digital certificate of the searcher and verifies and signs the inquiry condition set and the signature result based on the digital certificate of the searcher after the verification is passed.
5. The method of claim 4, wherein generating a switching parameter based on the set of retriever nonce, the holder digital certificate, and the holder nonce comprises:
the data retrieval party acquires a target owner random number corresponding to the target data parameter in the owner random number set, and acquires the owner public key index and the owner modulus corresponding to the owner digital certificate;
the data retriever generates the exchange parameters based on the retriever random number, the target holder random number, the holder public key exponent, and the holder modulus.
6. The method of claim 5, wherein the data retriever generating the exchange parameters based on the retriever nonce, the target holder nonce, the holder public key exponent, and the holder modulus comprises:
generating the exchange parameter based on:
s r =(c e mod n)⊕m r
wherein s is r Representing the exchange parameter, c representing the searcher nonce, e representing the holder public key exponent, n representing the holder modulus, m r And the target holder random number is represented, mod is a remainder operator, and ^ is an XOR operator.
7. The method of claim 6, wherein the data holder deriving a set of key sequences based on the exchange parameters, a holder private key to which the holder digital certificate corresponds, and the set of holder random numbers comprises:
for each owner random number in the owner random number set, the data owner obtains a key sequence corresponding to the owner random number in the key sequence set based on the exchange parameter, the owner random number, the owner private key index and the owner modulus.
8. The method of claim 7, wherein the data holder deriving a key sequence in the set of key sequences corresponding to the holder random number based on the exchange parameters, the holder random number, the holder private key exponent, and the holder modulus comprises:
obtaining the key sequence according to the following formula:
k t = (s r ⊕m t ) d mod n,
wherein k is t Representing said key sequence, s r Represents the exchange parameter, m t Representing the holder random number, d representing the holder private key exponent, n representing the holder modulus, mod being the remainder operator, ∈ being the exclusive or operator.
9. The method of claim 8, wherein the deriving a set of ciphertext sequences based on the set of key sequences and the set of query results comprises:
and aiming at each key sequence in the key sequence set, the data holder acquires a query result corresponding to the key sequence in the query result set, and obtains a ciphertext sequence based on the key sequence and the query result.
10. The method of claim 9, wherein obtaining a ciphertext sequence based on the key sequence and the query result comprises:
obtaining the ciphertext sequence according to the following formula:
E t = k t ⊕x t
wherein E is t Representing said ciphertext sequence, k t Representing a key sequence, x t Indicating the query result and ≧ the exclusive or operator.
11. The method of claim 10, wherein the encrypting the set of ciphertext sequences to generate a digital envelope based on a digital envelope encryption method comprises:
the data holder generates a session key and obtains a searcher public key structure of the searcher public key, encrypts the session key based on the searcher public key to obtain an encryption result, obtains an identifier of a symmetric encryption method corresponding to the session key, and encrypts the ciphertext sequence set based on the symmetric encryption method and the session key to generate encrypted information;
the data holder generates the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information.
12. The method of claim 11, wherein the data holder generating the digital envelope based on the retriever public key structure, the encryption result, the session key, the identification, and the encryption information comprises:
generating the digital envelope based on:
Envelop eb (E 0 ,…,E i-1 ,key ab ) =Pub eb ||Enc eb (key ab )||Algo|| Enc keyab (E 0 ,E 1 ,…,E i-1 ),
wherein, envelop eb (E 0 ,…,E i-1 ,key ab ) Representing said digital envelope, (E) 0 ,E 1 ,…,E i-1 ) Representing a set of ciphertext sequences, key, comprising i ciphertext sequences ab Representing said session key, pub eb Representing the public key structure of the searcher, enc eb (key ab ) Representing said encryption result, algo representing said identity, enc keyab (E 0 ,E 1 ,…,E i-1 ) Representing the encryption information, the | operator representing concatenating two or more strings with a connector to obtain a string.
13. The method of claim 12, wherein the data retriever decrypting the digital envelope to obtain the target data comprises:
the data searcher decrypts the digital envelope based on the private key of the searcher to obtain the session key, decrypts the encrypted information based on the session key and the identifier to obtain the ciphertext sequence set, and obtains the target data based on the ciphertext sequence set and the random number of the searcher.
14. The method of claim 13, wherein the deriving the target data based on the set of ciphertext sequences and the searcher nonce comprises:
and the data searching party acquires a target ciphertext sequence corresponding to the target data parameter from the ciphertext sequence set, obtains the target query result based on the target ciphertext sequence and the random number of the searching party, and obtains the target data based on the target query result.
15. The method of claim 14, wherein the deriving the target query result based on the target ciphertext sequence and the searcher nonce comprises:
obtaining the target query result based on the following formula:
x r =E r ⊕c,
wherein x is r Representing the target query result, E r And c represents the random number of the search party, and [ ] is an XOR operator.
16. A data retrieval method based on encrypted data for a data retriever, the data retriever being associated with a data holder, the method comprising:
generating a query condition set comprising a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, performing digital signature on the query condition set to generate a signature result, and sending a retriever digital certificate, the query condition set and the signature result to the data holder, wherein the plurality of query conditions comprise a plurality of false query conditions and at least one real query condition corresponding to the target data parameters;
receiving a holder digital certificate and a holder random number set sent by the data holder;
generating a searcher nonce, and generating an exchange parameter based on the searcher nonce, the holder digital certificate, and the set of holder nonces, and sending the exchange parameter to the data holder;
receiving a digital envelope sent by the data holder;
and decrypting the digital envelope to obtain the target data.
17. A data retrieval method based on encrypted data for a data holder associated with a data retriever, the method comprising:
receiving a digital certificate of a searching party, a query condition set and a signature result which are sent by the data searching party;
verifying the digital certificate of the searcher, the query condition set and the signature result, searching data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one by one, generating a random number set of the holder based on the query result set comprising the query results, and sending the digital certificate of the holder and the random number set of the holder to the data searcher, wherein the query results comprise target query results corresponding to target data, and the query conditions comprise a plurality of false query conditions and at least one real query condition corresponding to the target data parameters;
receiving the exchange parameters sent by the data searching party;
and obtaining a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtaining a ciphertext sequence set based on the key sequence set and the query result set, encrypting the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sending the digital envelope to the data searcher, so that the data searcher decrypts the digital envelope to obtain the target data.
18. A data retrieval apparatus based on encrypted data for use with a data retriever, the data retriever being associated with a data holder, the apparatus comprising:
a retrieval application sending unit, configured to generate a query condition set including a plurality of query conditions according to target data parameters corresponding to target data to be retrieved, perform digital signature on the query condition set to generate a signature result, and send a retriever digital certificate, the query condition set, and the signature result to the data holder, where the plurality of query conditions include a plurality of false query conditions and at least one real query condition corresponding to the target data parameters;
the owner random number set receiving unit is used for receiving an owner digital certificate and an owner random number set sent by the data owner;
an exchange parameter transmitting unit configured to generate a searcher nonce, generate an exchange parameter based on the searcher nonce, the holder digital certificate, and the holder nonce set, and transmit the exchange parameter to the data holder;
a digital envelope receiving unit, configured to receive a digital envelope sent by the data holder;
and the target data acquisition unit is used for decrypting the digital envelope to obtain the target data.
19. A data retrieval apparatus based on encrypted data for a data holder associated with a data retriever, the apparatus comprising:
a retrieval application receiving unit, configured to receive a digital certificate of a retrieval party, a query condition set, and a signature result sent by the data retrieval party;
a holder random number set sending unit, configured to verify the retriever digital certificate, the query condition set, and the signature result, retrieve data based on the query condition set after the verification is successful to generate a plurality of query results corresponding to a plurality of query conditions one to one, generate a holder random number set based on a query result set including the plurality of query results, and send the holder digital certificate and the holder random number set to the data retriever, where the plurality of query results include a target query result corresponding to target data, where the plurality of query conditions include a plurality of false query conditions and at least one true query condition corresponding to the target data parameter;
an exchange parameter receiving unit, configured to receive an exchange parameter sent by the data retrieving party;
and the digital envelope sending unit is used for obtaining a key sequence set based on the exchange parameters, a holder private key corresponding to the holder digital certificate and the holder random number set, obtaining a ciphertext sequence set based on the key sequence set and the query result set, encrypting the ciphertext sequence set based on a digital envelope encryption method to generate a digital envelope, and sending the digital envelope to the data searcher, so that the data searcher decrypts the digital envelope to obtain the target data.
20. A storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform the method of any one of claims 16 and 17.
CN202211147457.6A 2022-09-21 2022-09-21 Data retrieval method and device based on encrypted data and storage medium Active CN115237943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211147457.6A CN115237943B (en) 2022-09-21 2022-09-21 Data retrieval method and device based on encrypted data and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211147457.6A CN115237943B (en) 2022-09-21 2022-09-21 Data retrieval method and device based on encrypted data and storage medium

Publications (2)

Publication Number Publication Date
CN115237943A CN115237943A (en) 2022-10-25
CN115237943B true CN115237943B (en) 2022-12-09

Family

ID=83681385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211147457.6A Active CN115237943B (en) 2022-09-21 2022-09-21 Data retrieval method and device based on encrypted data and storage medium

Country Status (1)

Country Link
CN (1) CN115237943B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115936891B (en) * 2023-01-28 2023-05-16 中债金科信息技术有限公司 Financial data retrieval method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10020936B1 (en) * 2015-02-05 2018-07-10 Ionic Security Inc. Systems and methods for encryption and provision of information security using platform services
CN109672537A (en) * 2019-01-18 2019-04-23 如般量子科技有限公司 Anti- quantum certificate acquisition system and acquisition methods based on public key pond
CN112202719A (en) * 2020-09-04 2021-01-08 广州江南科友科技股份有限公司 Signature method, system, device and storage medium based on digital certificate
CN113709158A (en) * 2021-08-27 2021-11-26 国网安徽省电力有限公司池州供电公司 Safety e-mail authentication method based on PKI

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100346249C (en) * 2004-12-31 2007-10-31 联想(北京)有限公司 Method for generating digital certificate and applying the generated digital certificate

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10020936B1 (en) * 2015-02-05 2018-07-10 Ionic Security Inc. Systems and methods for encryption and provision of information security using platform services
CN109672537A (en) * 2019-01-18 2019-04-23 如般量子科技有限公司 Anti- quantum certificate acquisition system and acquisition methods based on public key pond
CN112202719A (en) * 2020-09-04 2021-01-08 广州江南科友科技股份有限公司 Signature method, system, device and storage medium based on digital certificate
CN113709158A (en) * 2021-08-27 2021-11-26 国网安徽省电力有限公司池州供电公司 Safety e-mail authentication method based on PKI

Also Published As

Publication number Publication date
CN115237943A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
CN107196966B (en) Identity authentication method and system based on block chain multi-party trust
CN112019591B (en) Cloud data sharing method based on block chain
US10027654B2 (en) Method for authenticating a client device to a server using a secret element
US8099607B2 (en) Asymmetric crypto-graphy with rolling key security
US7359507B2 (en) Server-assisted regeneration of a strong secret from a weak secret
JP5562687B2 (en) Securing communications sent by a first user to a second user
US7899184B2 (en) Ends-messaging protocol that recovers and has backward security
US7149311B2 (en) Methods and apparatus for providing networked cryptographic devices resilient to capture
CA2747891C (en) Method for generating an encryption/decryption key
US20030115452A1 (en) One time password entry to access multiple network sites
US20110145576A1 (en) Secure method of data transmission and encryption and decryption system allowing such transmission
JP4130653B2 (en) Pseudo public key encryption method and system
JPH08340330A (en) Communication system
US20110194698A1 (en) Key Sharing System
JP2012019511A (en) System and method of safety transaction between wireless communication apparatus and server
JP2000078124A (en) Method for establishing key while using aerial communication and password, and password protocol
CN110535626B (en) Secret communication method and system for identity-based quantum communication service station
CN115237943B (en) Data retrieval method and device based on encrypted data and storage medium
CN113486324B (en) Method for realizing three-factor anonymous identity authentication based on SM2 algorithm
CN113676448A (en) Off-line equipment bidirectional authentication method and system based on symmetric key
CN111245611B (en) Anti-quantum computation identity authentication method and system based on secret sharing and wearable equipment
US20220038267A1 (en) Methods and devices for secured identity-based encryption systems with two trusted centers
KR20200055672A (en) Encryption systems and method using permutaion group based cryptographic techniques
CN114760053B (en) Distribution method, device, equipment and medium of symmetric key
JP4000899B2 (en) Cryptographic method with authentication, decryption method and device with authentication, program, and computer-readable recording medium

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