Search

CN-116680324-B - Data hiding and tracking query method and device, storage medium and electronic equipment

CN116680324BCN 116680324 BCN116680324 BCN 116680324BCN-116680324-B

Abstract

The disclosure relates to a data trace query method and device, a computer readable storage medium and electronic equipment, and relates to the technical field of cryptography; judging whether a target user identifier corresponding to a user identifier to be queried in a request to be queried exists in a preset user identifier set according to the first objective function, acquiring characteristic data corresponding to the target user identifier when the existence of the target user identifier is determined, constructing a target key character string according to the first target random polynomial, encrypting the user identifier to be queried and the characteristic data based on the target key character string to obtain a data query result, and sending the data query result to a data query party. The method and the device realize the trace query of the data querying party.

Inventors

  • ZHOU YIJING
  • HUANG CUITING
  • CHEN TAO

Assignees

  • 杭州博盾习言科技有限公司

Dates

Publication Date
20260508
Application Date
20230605

Claims (12)

  1. 1. The data trace query method is characterized by being configured on a data service side, and comprises the following steps of: Analyzing a data query request sent by a data query party to obtain a first objective function and a first objective random polynomial, wherein the analyzing the data query request to obtain a first encryption function and a first encryption polynomial is performed in response to the data query request sent by the data query party; acquiring a homomorphic encryption key pair corresponding to the data inquiring party, and decrypting the first encryption function and the first encryption polynomial based on a homomorphic encryption private key in the homomorphic encryption key pair to obtain a first objective function and a first objective random polynomial; judging whether a target user identifier corresponding to the user identifier to be queried in the request to be queried exists in a preset user identifier set according to the first objective function; When the target user identifier is determined to exist, acquiring characteristic data corresponding to the target user identifier, and constructing a target key character string according to the first target random polynomial, wherein the characteristic data comprises a first original random polynomial corresponding to the target user identifier, a first ratio between the first target random polynomial and the first original random polynomial, a hash processing on the first ratio to obtain a first hash character string, and a fragmentation processing on the first hash character string to obtain a first key character string and a second key character string; encrypting the user identification to be queried and the characteristic data based on the target key character string to obtain a data query result, and sending the data query result to a data query party; the data hiding trace query method further comprises the following steps: Acquiring an original user identifier held by the data service party, and constructing the preset user identifier set according to the original user identifier; Constructing a first original user identification polynomial according to original user identifications included in the user identification set, and calculating a first identification polynomial coefficient of the first original user identification polynomial; Constructing a first original random polynomial and calculating a first random polynomial coefficient of the first original random polynomial; Encrypting the first identification polynomial coefficient and the first random polynomial coefficient based on the homomorphic encryption public key in the homomorphic encryption key pair, and sending the encrypted first identification polynomial coefficient and the encrypted first random polynomial coefficient to a data inquiring party so that the data inquiring party generates a data inquiring request according to the encrypted first identification polynomial coefficient and the encrypted first random polynomial coefficient.
  2. 2. The method of claim 1, wherein determining whether a target user identifier corresponding to a user identifier to be queried in the request to be queried exists in a preset user identifier set according to the first objective function includes: Substituting the user identification to be queried into the first objective function, and calculating the function value of the first objective function; And judging whether a target user identifier corresponding to the user identifier to be queried in the request to be queried exists in the preset user identifier set according to the function value.
  3. 3. The data trace query method according to claim 2, wherein if the function value is zero, a target user identifier corresponding to a user identifier to be queried in the request to be queried exists in the preset user identifier set; If the function value is any random constant, the target user identification corresponding to the user identification to be queried in the request to be queried does not exist in the preset user identification set.
  4. 4. The method of claim 1, wherein encrypting the user identification and the feature data to be queried based on the target key string to obtain a data query result comprises: encrypting the user identification to be queried based on a first key character string in the target key character string; Encrypting the characteristic data based on a second key character string in the target key character string, and obtaining a data query result based on the encrypted user identification to be queried and the encrypted characteristic data.
  5. 5. The data track query method as claimed in claim 1, wherein the data track query method further comprises: Acquiring target user identifiers corresponding to the data querying party, and calculating first identification quantity of the target user identifiers; and determining the hit number of the data inquirer according to the first identification number, and calculating the data inquiry cost required to be paid by the data inquirer according to the hit number.
  6. 6. The data trace query method is characterized by being configured on a data query party, and comprises the following steps of: The method comprises the steps of receiving an encrypted first identification polynomial coefficient and an encrypted first random polynomial coefficient which are sent by a data service side, wherein the encrypted first identification polynomial coefficient and the encrypted first random polynomial coefficient are generated by the data service side in a mode of acquiring an original user identification held by the data service side and constructing a preset user identification set, constructing a first original user identification polynomial according to the user identification set and calculating the first identification polynomial coefficient thereof; Generating a data query request according to the encrypted first identification polynomial coefficient, the encrypted first random polynomial coefficient, a preset second random number and the user identification to be queried, wherein the data query request comprises the steps of generating the second random number, calculating a first target function according to the second random number and the encrypted first identification polynomial coefficient, calculating a first target random polynomial according to the second random number and the encrypted first random polynomial coefficient; The data query request is sent to a data service side, the data service side receives a data query result fed back when the data service side responds to the data query request and determines that the user identification to be queried exists in a user identification set held by the data service side, wherein the data query result is obtained by the data service side through the following modes that a first objective function and a first objective random polynomial are obtained by analyzing the data query request; Decrypting the data query result based on the second random number to obtain feature data corresponding to the user identification to be queried, wherein the method comprises the steps of calculating a standard key character string corresponding to the user identification to be queried based on the second random number, and decrypting the data query result based on the standard key character string to obtain feature data corresponding to the user identification to be queried.
  7. 7. The method of claim 6, wherein calculating a standard key string corresponding to the user identification to be queried based on a second random number, comprises: carrying out hash processing on the second random number to obtain a second hash character string, and carrying out fragmentation processing on the second hash character string to obtain a third key character string and a fourth key character string; And obtaining the standard key character string according to the third key character string and the fourth key character string.
  8. 8. The method of claim 6, wherein decrypting the data query result based on the standard key string to obtain feature data corresponding to the user identification to be queried comprises: Decrypting the encrypted user identification to be queried in the data query result based on a third key character string in the standard key character string; after the encrypted user identification to be queried is successfully decrypted, decrypting the encrypted characteristic data in the data query result based on a fourth key character string in the standard key character string to obtain the characteristic data corresponding to the user identification to be queried.
  9. 9. A data track inquiry apparatus, configured to a data service party, the data track inquiry apparatus comprising: the data query request analysis module is used for analyzing a data query request sent by a data query party to obtain a first objective function and a first objective random polynomial, and comprises the steps of responding to the data query request sent by the data query party, analyzing the data query request to obtain a first encryption function and a first encryption polynomial, acquiring homomorphic encryption key pairs corresponding to the data query party, and decrypting the first encryption function and the first encryption polynomial based on homomorphic encryption private keys in the homomorphic encryption key pairs to obtain the first objective function and the first objective random polynomial; The user identification to be queried judging module is used for judging whether a target user identification corresponding to the user identification to be queried in the request to be queried exists in a preset user identification set according to the first objective function; The characteristic data acquisition module is used for acquiring characteristic data corresponding to the target user identifier when the target user identifier exists, and constructing a target key character string according to the first target random polynomial, and comprises the steps of acquiring a first original random polynomial corresponding to the target user identifier, calculating a first ratio between the first target random polynomial and the first original random polynomial, carrying out hash processing on the first ratio to obtain a first hash character string, and carrying out fragmentation processing on the first hash character string to obtain a first key character string and a second key character string; the data query result feedback module is used for encrypting the user identification to be queried and the characteristic data based on the target key character string to obtain a data query result, and sending the data query result to a data query party; The device is further used for acquiring an original user identifier held by the data service party, constructing the preset user identifier set according to the original user identifier, constructing a first original user identifier polynomial according to the original user identifier included in the user identifier set, calculating a first identifier polynomial coefficient of the first original user identifier polynomial, constructing a first original random polynomial, calculating a first random polynomial coefficient of the first original random polynomial, encrypting the first identifier polynomial coefficient and the first random polynomial coefficient based on a homomorphic encryption public key in a homomorphic encryption key pair, and sending the encrypted first identifier polynomial coefficient and the encrypted first random polynomial coefficient to the data query party, so that the data query party generates a data query request according to the encrypted first identifier polynomial coefficient and the encrypted first random polynomial coefficient.
  10. 10. A data track inquiry apparatus, configured for a data inquirer, the data track inquiry apparatus comprising: The system comprises a first receiving module, a first random polynomial coefficient and a second random polynomial coefficient, wherein the first receiving module is used for receiving the encrypted first identifier polynomial coefficient and the encrypted first random polynomial coefficient which are sent by a data service side, the encrypted first identifier polynomial coefficient and the encrypted first random polynomial coefficient are generated by the data service side in the following modes that original user identifiers held by the data service side are obtained and a preset user identifier set is built, a first original user identifier polynomial is built according to the user identifier set, and the first identifier polynomial coefficient is calculated; The data query request generation module is used for generating a data query request according to the encrypted first identification polynomial coefficient, the encrypted first random polynomial coefficient, a preset second random number and the user identification to be queried, and comprises the steps of generating a second random number, calculating a first target function according to the second random number and the encrypted first identification polynomial coefficient, calculating a first target random polynomial according to the second random number and the encrypted first random polynomial coefficient, encrypting the first target function and the first target random polynomial based on a homomorphic encryption public key in a homomorphic encryption key pair to obtain a first encryption function and a first encryption polynomial, and generating the data query request according to the first encryption function, the first encryption polynomial and the user identification to be queried; The data query result receiving module is used for sending the data query request to a data service side, receiving the data query request responded by the data service side, and when the user identification to be queried is determined to exist in a user identification set held by the data service side, feeding back the data query result, wherein the data query result is obtained by the data service side through the following modes that the data query request is analyzed to obtain a first objective function and a first objective random polynomial; the data query result decryption module is used for decrypting the data query result based on the second random number to obtain feature data corresponding to the user identifier to be queried, and comprises the steps of calculating a standard key character string corresponding to the user identifier to be queried based on the second random number, and decrypting the data query result based on the standard key character string to obtain the feature data corresponding to the user identifier to be queried.
  11. 11. A computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the data-hiding query method of any one of claims 1-8.
  12. 12. An electronic device, comprising: processor, and A memory for storing executable instructions of the processor; Wherein the processor is configured to perform the data hiding query method of any one of claims 1-8 via execution of the executable instructions.

Description

Data hiding and tracking query method and device, storage medium and electronic equipment Technical Field The embodiment of the disclosure relates to the technical field of cryptography, in particular to a data trace query method, a data trace query device, a computer-readable storage medium and electronic equipment. Background In the existing data query scheme, the data service side cannot decrypt the ciphertext sent by the data query side, so that whether the data query side successfully queries corresponding user data from the data service side through the user identification to be queried or not cannot be known, the hit rate of the data query side cannot be counted, and the accuracy of the statistical result of the hit rate is reduced. It should be noted that the information of the present invention in the above background section is only for enhancing understanding of the background of the present disclosure, and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art. Disclosure of Invention The present disclosure aims to provide a data trace query method, a data trace query device, a computer-readable storage medium, and an electronic apparatus, so as to overcome, at least to some extent, the problem of low accuracy of statistical results of hit rates due to limitations and defects of related technologies. According to one aspect of the present disclosure, there is provided a data trace query method configured to a data service side, the data trace query method including: Analyzing a data query request sent by a data query party to obtain a first objective function and a first objective random polynomial; judging whether a target user identifier corresponding to the user identifier to be queried in the request to be queried exists in a preset user identifier set according to the first objective function; When the existence of the target user identifier is determined, acquiring characteristic data corresponding to the target user identifier, and constructing a target key character string according to the first target random polynomial; and encrypting the user identification to be queried and the characteristic data based on the target key character string to obtain a data query result, and sending the data query result to a data query party. In an exemplary embodiment of the present disclosure, resolving a data query request sent by a data querying party to obtain a first objective function and a first objective random polynomial, including: Responding to a data query request sent by the data query party, and analyzing the data query request to obtain a first encryption function and a first encryption polynomial; And acquiring a homomorphic encryption key pair corresponding to the data inquiring party, and decrypting the first encryption function and the first encryption polynomial based on a homomorphic encryption private key in the homomorphic encryption key pair to obtain a first objective function and a first objective random polynomial. In an exemplary embodiment of the present disclosure, determining, according to the first objective function, whether a target user identifier corresponding to a user identifier to be queried in a request to be queried exists in a preset user identifier set includes: Substituting the user identification to be queried into the first objective function, and calculating the function value of the first objective function; And judging whether a target user identifier corresponding to the user identifier to be queried in the request to be queried exists in the preset user identifier set according to the function value. In an exemplary embodiment of the present disclosure, if the function value is zero, a target user identifier corresponding to the user identifier to be queried in the request to be queried exists in the preset user identifier set; If the function value is any random constant, the target user identification corresponding to the user identification to be queried in the request to be queried does not exist in the preset user identification set. In an exemplary embodiment of the present disclosure, constructing a target key string from the first target random polynomial includes: acquiring a first original random polynomial corresponding to the target user identifier, and calculating a first ratio between the first target random polynomial and the first original random polynomial; Carrying out hash processing on the first ratio to obtain a first hash character string, and carrying out fragmentation processing on the first hash character string to obtain a first key character string and a second key character string; and constructing the target key character string according to the first key character string and the second key character string. In an exemplary embodiment of the present disclosure, encrypting the user identifier to be queried and the feature data based on the target key string t