Anonymous Query System and Method Based on Data Obfuscation

By employing the Montgomery curve encryption algorithm and symmetric encryption algorithm in the stealth query system, the problem of low query efficiency in existing technologies is solved, achieving efficient and secure data query and privacy protection.

CN116680736BActive Publication Date: 2026-11-10上海勃池信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310651198.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2026-11-10
Estimated Expiration
2043-06-02

AI Technical Summary

Technical Problem

In existing anonymous query systems based on data obfuscation, the use of unintentional transmission protocols leads to low query efficiency.

Method used

The query key is generated using the Montgomery curve encryption algorithm, and the data query is performed by generating a confusion ID through the data query and confusion module. The query efficiency is improved by combining the symmetric encryption algorithm.

Benefits of technology

While ensuring data query security, it improves the efficiency of anonymous query, achieving efficient data query and privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680736B_ABST
    Figure CN116680736B_ABST
Patent Text Reader

Abstract

This invention provides an anonymous query system and method based on data obfuscation, comprising: a data encryption / decryption module and a data query and obfuscation module; the data encryption / decryption module is used to generate a query key according to the Montgomery curve encryption algorithm, and encrypt the ID to be queried based on the query key to obtain query ciphertext; the data query and obfuscation module is used to generate an obfuscated ID, and perform a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID; the data encryption / decryption module is also used to generate query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypt the query result ciphertext to obtain the query result corresponding to the ID to be queried. This invention improves the efficiency of anonymous querying.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data query technology, and in particular to an anonymous query system and method based on data obfuscation. Background Technology

[0002] In anonymous query services for sensitive information, such as those provided by financial institutions, it is necessary to ensure that the user IDs the financial institution wants to query cannot be detected by others, and that the query results do not expose any additional private information. Currently, anonymous queries based on data obfuscation require the use of unintentional transmission protocols, which typically rely on asymmetric encryption algorithms, resulting in low query efficiency. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a stealth query system and method based on data obfuscation, so as to improve the efficiency of stealth query.

[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0005] In a first aspect, embodiments of the present invention provide an anonymous query system based on data obfuscation, comprising: a data encryption / decryption module and a data query and obfuscation module; the data encryption / decryption module is used to generate a query key according to the Montgomery curve encryption algorithm, and encrypt the ID to be queried based on the query key to obtain query ciphertext; the data query and obfuscation module is used to generate an obfuscated ID, and perform a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID; the data encryption / decryption module is further used to generate query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypt the query result ciphertext to obtain the query result corresponding to the ID to be queried.

[0006] In one implementation, the query key includes: a first private key, a first public key, and a second public key; the data encryption / decryption module includes: a first encryption unit; wherein the first encryption unit is used to generate a first private key for the ID to be queried using an elliptic curve encryption algorithm, and to generate a first public key on a Montgomery curve and a second public key on a twisted line based on the first private key.

[0007] In one implementation, the first encryption unit is further configured to generate a random string, encode the ID to be queried onto the quadratic extension field of the Montgomery curve based on the random string to obtain a first encoding result, and calculate the ciphertext of the ID to be queried based on the first encoding result and a first private key to obtain a query ciphertext set; wherein the encoding process includes: determining the verification information of the ID to be queried based on the ID string of the ID to be queried; converting the verification information into first bytecode, and converting the random string into second bytecode; generating a target integer based on the first bytecode and the second bytecode, and converting the target integer into a target point of the Montgomery curve on a preset finite prime field based on a preset modulus p; determining a legitimate public key point on the quadratic extension field of the Montgomery curve based on the target point, and encoding the ID to be queried onto the legitimate public key point on the quadratic extension field of the Montgomery curve to obtain the first encoding result.

[0008] In one implementation, the data query and obfuscation module includes: an obfuscation unit, a data storage unit, and a query unit; the obfuscation unit is used to generate multiple obfuscated IDs and determine a database retrieval index set for the obfuscated IDs and the IDs to be queried; the query unit is used to perform data queries in the data storage unit based on the database retrieval index set, obtain multiple matching IDs, and calculate a query result index set for the matching IDs.

[0009] In one implementation, the query key includes: a second private key, a shared key, and a symmetric encryption key; the data encryption / decryption module further includes: a second encryption unit; the second encryption unit is used to determine whether the first public key, the second public key, and the query ciphertext set are legitimate public key points; if so, each matching ID is encoded to obtain a second encoding result, and a second private key, a first parameter, and a shared key are generated based on the second encoding result, and a symmetric encryption key for each matching ID is generated based on the shared key, and the matching ID is encrypted based on the symmetric encryption key to obtain the query result ciphertext.

[0010] In one embodiment, the second encryption unit is further configured to determine whether the y-value of the Montgomery curve is a quadratic residue modulo p based on the second encoding result; if the y-value of the Montgomery curve is a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the first public key; if the y-value of the Montgomery curve is not a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the second public key.

[0011] In one implementation, the query key includes: a third private key, a second encryption unit, and is further used to generate the third private key, calculate a second parameter for each matching ID based on the third private key and the second encoding result, calculate a third parameter based on the first and second parameters, and calculate a fourth parameter based on the third private key and the query ciphertext set.

[0012] In one implementation, the data query and obfuscation module further includes: a verification unit, configured to calculate the query result index of the ID to be queried, search for the target index corresponding to the query result index of the ID to be queried in the set of query result indexes matching the ID, and determine the corresponding target query result ciphertext and third parameter based on the target index.

[0013] In one implementation, the data encryption / decryption module further includes: a first decryption unit, used to calculate a decryption key based on the third and fourth parameters corresponding to the target index, and to decrypt the target query result ciphertext based on the decryption key to obtain the query result.

[0014] Secondly, embodiments of the present invention provide a method for stealth query based on data obfuscation. This method is applied to any of the stealth query systems based on data obfuscation provided in the first aspect above, comprising: generating a query key using a data encryption / decryption module according to the Montgomery curve encryption algorithm, and encrypting the ID to be queried based on the query key to obtain query ciphertext; generating an obfuscated ID using a data query and obfuscation module, and performing a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID; generating a query result ciphertext corresponding to the matching ID using a data encryption / decryption module based on the query ciphertext and the query key, and decrypting the query result ciphertext to obtain the query result corresponding to the ID to be queried.

[0015] Thirdly, embodiments of the present invention provide an electronic device including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the steps of any of the methods provided in the first aspect above.

[0016] The embodiments of the present invention bring the following beneficial effects:

[0017] The above-described anonymity query system and method based on data obfuscation provided in this invention includes: a data encryption / decryption module and a data query and obfuscation module; the data encryption / decryption module is used to generate a query key according to the Montgomery curve encryption algorithm, and encrypt the ID to be queried based on the query key to obtain query ciphertext; the data query and obfuscation module is used to generate an obfuscated ID, and perform a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID; the data encryption / decryption module is also used to generate query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypt the query result ciphertext to obtain the query result corresponding to the ID to be queried. In the anonymity query service, the above system uses the Montgomery curve encryption algorithm for encryption calculation and performs data query through data obfuscation, which can improve query efficiency while ensuring data query security.

[0018] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the structure of an anonymous query system based on data obfuscation, provided in an embodiment of the present invention.

[0022] Figure 2 This is a schematic diagram of another stealth query system based on data obfuscation provided in an embodiment of the present invention;

[0023] Figure 3 A schematic diagram of each unit of an anonymous query system based on data obfuscation provided in an embodiment of the present invention;

[0024] Figure 4 A task flowchart of an anonymous query system based on data obfuscation provided in an embodiment of the present invention;

[0025] Figure 5 A flowchart of an anonymous query method based on data obfuscation provided in an embodiment of the present invention;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0027] icon:

[0028] 10-Data encryption / decryption module; 20-Data query and obfuscation module; 101-First encryption unit; 102-First decryption unit; 103-Second encryption unit; 201-Obfuscation unit; 202-Data storage unit; 203-Query unit; 204-Verification unit. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] To facilitate a better understanding of this application by those skilled in the art, the technical terms involved in this invention will be briefly introduced below.

[0031] 1. Private Information Retrieval (PIR) is a privacy-preserving technology designed to enable users to retrieve specific information from a database without disclosing their query information. PIR technology is commonly used in fields such as healthcare, finance, and e-commerce, providing users with convenient and secure retrieval services while protecting personal privacy. For example, in the financial sector, banks and other financial institutions can use PIR technology to effectively identify fraudulent activities while protecting customer privacy. The implementation of PIR involves multiple layers of encryption, hash functions, and randomization, among other technologies, to ensure the integrity of query results and the security of private data during the query process.

[0032] 2. Oblivious Transfer (OT) is a cryptographic protocol designed to achieve secure communication between two parties. In an OT protocol, the sender sends information to the receiver, but the sender does not know what information the receiver needs, and the receiver cannot determine what information the sender possesses. Therefore, the OT protocol guarantees that the sent information is private to the receiver, while the sender cannot obtain information that the receiver does not want them to have. This protocol is commonly used in fields such as digital signatures, hash functions, and encryption to protect privacy and confidentiality during data transmission and exchange. Depending on the amount of information sent and received, OT protocols can be categorized into 2-choose-1, n-choose-1, and n-choose-k protocols, among others. OT protocols can be used to implement anonymous query services based on data obfuscation.

[0033] 3. Forward and backward security are generally referred to as forward security (FS) and backward security (BS), respectively. Forward security means that even if the current key is obtained by an attacker, it can still protect historical communication content from being cracked; backward security means that even if the current key is obtained by an attacker, it can still protect future communication content from being cracked or tampered with. Forward and backward security are important characteristics of encryption protocols or secure communication mechanisms. A stealth query system that implements forward and backward security means that even if the key used for a query is intercepted by an attacker, the attacker cannot decrypt any information from previous or subsequent communications.

[0034] 4. The Montgomery curve is a commonly used curve type in elliptic curve cryptography algorithms, widely applied to secure communication mechanisms such as digital signatures, key negotiation, and encryption. Encryption algorithms based on Montgomery curves have two main characteristics: ① When performing elliptic curve scalar multiplication, general elliptic curve cryptography algorithms require both the x and y coordinates of the curve in the calculation, while Montgomery curves can use the Montgomery's Ladder Algorithm, which is based solely on the x-coordinate; ② To prevent attacks targeting elliptic curve cryptography algorithms, general elliptic curve cryptography algorithms require verification of the received public key before encryption, while encryption algorithms based on Montgomery curves can omit this step in many application scenarios. Therefore, encryption algorithms based on Montgomery curves are characterized by high computational speed, small storage space, and ease of hardware acceleration.

[0035] After introducing the technical terms involved in this invention, the application scenarios and design concepts of the embodiments of this application will be briefly described below.

[0036] Currently, anonymous queries based on data obfuscation require the use of stealth transmission protocols, which typically rely on asymmetric encryption algorithms, resulting in low query efficiency. Therefore, this invention provides an anonymous query system and method based on data obfuscation to improve the efficiency of anonymous queries.

[0037] To facilitate understanding of this embodiment, a detailed description of the anonymous query system based on data obfuscation disclosed in this embodiment of the invention will be provided first. See [link to documentation]. Figure 1The diagram shows the structure of an anonymous query system based on data obfuscation. The system mainly includes: a data encryption / decryption module 10 and a data query and obfuscation module 20. The data encryption / decryption module 10 generates a query key based on the Montgomery curve encryption algorithm and encrypts the ID to be queried using the query key to obtain query ciphertext. The data query and obfuscation module 20 generates an obfuscated ID and performs a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID. The data encryption / decryption module 10 also generates a query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypts the query result ciphertext to obtain the query result corresponding to the ID to be queried.

[0038] The above-mentioned anonymous query system based on data obfuscation provided in this embodiment of the invention uses the Montgomery curve encryption algorithm for encrypted calculation in the anonymous query service, and performs data query through data obfuscation, which can improve query efficiency while ensuring data query security.

[0039] In one implementation, see Figure 2 As shown, the data encryption / decryption module 10 includes: a first encryption unit 101, a first decryption unit 102, and a second encryption unit 103; the data query and obfuscation module 20 includes: an obfuscation unit 201, a data storage unit 202, a query unit 203, and a verification unit 204.

[0040] For specific implementation, see Figure 3 As shown, the system provided in this embodiment of the invention can be divided into client and server deployments. The client is deployed in the form of an SDK (Software Development Kit); the server is deployed on the server of the data output service provider and accepts query requests from the client through an API (Application Programming Interface).

[0041] The client includes: a first encryption unit 101, an obfuscation unit 201, a verification unit 204, and a first decryption unit 102. The first encryption unit 101 generates the query key used for this query in real-time and generates the query ciphertext based on the ID to be queried. The obfuscation unit 201 generates several obfuscated IDs different from the ID to be queried. The verification unit 204, connected to the first decryption unit 102, verifies whether the data returned by the server contains encrypted data of the ID to be queried. The first decryption unit 102, connected to the verification unit 204, decrypts the encrypted data corresponding to the ID to be queried in the returned results.

[0042] The server includes a second encryption unit 103, a data storage unit 202, and a query unit 203. The data storage unit 202 is connected to the query unit 203 and is used to store the data to be queried. The query unit 203 is connected to the data storage unit 202 and the second encryption unit 103 and is used to match IDs in the database that meet preset query conditions. The second encryption unit 103 is connected to the query unit 203 and is used to instantly generate the query key used for this query and generate the corresponding query result ciphertext based on the query ciphertext.

[0043] See below. Figure 4 As shown, the functions of each unit are introduced in conjunction with the specific query process.

[0044] In one implementation, the query key includes: a first private key, a first public key, and a second public key; the first encryption unit 101 is used for:

[0045] (1) Use the elliptic curve cryptography algorithm to generate the first private key of the ID to be queried, and generate the first public key on the Montgomery curve and the second public key on the twist line based on the first private key.

[0046] In practical implementation, the first private key s for the Elliptic Curve Cryptography (ECC) algorithm is generated. B The first private key needs to be guaranteed to be within the Montgomery curve y. 2 =x 3 +Ax 2 +x and twist lines By 2 =x 3 +Ax 2 Sufficient security is provided on both +x. The Montgomery curve used in this embodiment of the invention can be Curve 25519, with parameters A = 486662 and a distortion factor B = 2. The allowed value space for the first private key is: { s : s∈2 254 +8*{0, 1, ..., 2} 251 -1}}.

[0047] Based on the first key s B Calculate the first public key K on the Montgomery curve respectively. B =s B G, and the second public key K' on the twisted line. B =s B G'. In this embodiment of the invention, the abscissa of the base point G of curve Curve25519 can be selected as x = 9, and the abscissa of the base point G' of the twist line can be selected as x = 2.

[0048] (2) Generate a random string, and based on the random string, encode the ID to be queried onto the second expansion field of the Montgomery curve to obtain the first encoding result.

[0049] In practice, a random string R is generated, and based on this random string R, the ID to be queried is encoded onto the quadratic extension field of the Montgomery curve using the encoding function f, resulting in the first encoding result x = {x1, x2, ..., x...}. k}, where x i =f(ID) i ,R),ID i This is the verification information for the i-th ID to be queried.

[0050] The specific encoding process includes:

[0051] (i) Determine the verification information of the ID to be queried based on the ID string of the ID to be queried.

[0052] Specifically, verification information for the ID to be queried is constructed based on the ID string of the ID to be queried. The verification information for the ID to be queried may include, but is not limited to, one of the following data:

[0053] a: User ID string;

[0054] b: The hash value of the user ID, which may include, but is not limited to, the SHA-256 of the user ID;

[0055] c: Other verification information, generated by an injective function whose argument is the user ID string.

[0056] (ii) Convert the verification information into first bytecode and the random string into second bytecode.

[0057] Specifically, the verification information of the ID to be queried is converted into the first bytecode b. ID And convert the random string R into the second bytecode b. R .

[0058] (iii) Generate a target integer based on the first bytecode and the second bytecode, and convert the target integer into a target point of the Montgomery curve on a preset finite prime field based on a preset modulus p.

[0059] Specifically, the target integer z = g(b) is generated based on the first bytecode and the second bytecode. ID ∥b R ), where g is the generating function, and the symbol "∥" represents the concatenation of bytecode. In this embodiment of the invention, the generating function g directly converts the bytecode to an integer z using big-endian encoding.

[0060] After generating the target integer z, calculate x′ = z mod p, and convert z into a Montgomery curve defined over the finite prime field F. p The target point x′ is on the curve. For the curve Curve25519 used in this embodiment of the invention, the preset modulus p can be p = 2. 255 -19.

[0061] (iv) Determine the legitimate public key points on the quadratic extension of the Montgomery curve based on the target point, and encode the ID to be queried into the legitimate public key points on the quadratic extension of the Montgomery curve to obtain the first encoding result.

[0062] Specifically, let i = 0, 1, 2, ..., and sequentially determine whether x = x′ + i is a valid public key point on the quadratic extension of the Montgomery curve, that is, determine whether x = x′ + i is within the value space of the quadratic extension of the Montgomery curve, and encode the ID to be queried into the first valid public key point found. The curve Curve25519 used in this embodiment has the following value space for valid public key points on its quadratic extension:

[0063]

[0064] (3) Calculate the ciphertext of the ID to be queried based on the first encoding result and the first private key to obtain the query ciphertext set.

[0065] In practical implementation, for each ID to be queried, the encoded result x i Calculate the ciphertext E i =s B x i For the encoded results of k IDs to be queried, the query ciphertext set E = {E1, E2, ..., E...} is obtained. k}

[0066] The obfuscation unit 201 is used to generate multiple obfuscated IDs and determine the database retrieval index set of the obfuscated IDs and the ID to be queried.

[0067] In specific implementation, the following operations are performed in the obfuscation unit 201:

[0068] (1) Randomly generate nk obfuscated IDs, and each obfuscated ID is different from the k IDs to be queried.

[0069] (2) Generate a database retrieval index set H = {H1, H2, ..., Hk} with n IDs (including nk obfuscated IDs and k IDs to be queried). n}, where H i This represents the database retrieval index for the i-th ID. The database retrieval index can be one of the following:

[0070] i: User ID string;

[0071] ii: The hash value of the user ID, which may be, but is not limited to, the SHA-256 of the user ID;

[0072] iii: The first m bits of the hash value of the user ID can be, but is not limited to, the first 8 bits of the SHA-256 value of the user ID;

[0073] iv: Other index information that can be used to retrieve user ID data from the database.

[0074] After the first encryption unit 101 and the obfuscation unit 201 complete the above operations, the client can send a query request to the server via the HTTPS transport protocol. The request parameters include: the first public key K. B Second public key K' B The query consists of a ciphertext set E, a random string R, and a database retrieval index set H.

[0075] Furthermore, the query unit 203 is used to: perform data queries in the data storage unit based on the database retrieval index set, obtain multiple matching IDs, and calculate the query result index set of the matching IDs.

[0076] In practice, the following operations can be performed in query unit 203:

[0077] (1) Based on the received database retrieval index set H, send a query instruction to the data storage unit 202 to obtain the query results of the data storage unit 202, namely n′ matching IDs that meet the query conditions.

[0078] (2) For each matching ID, use algorithm h to generate a query result index set H′={H′1,H′2,…,H′ n′}, H′ i This represents the index of the query result for the i-th matching ID. The query result index can be one of the following:

[0079] i: The user ID itself;

[0080] ii: The hash value of the user ID, which may be, but is not limited to, the SHA-256 of the user ID;

[0081] iii: The first m bits of the hash value of the user ID can be, but is not limited to, the first 8 bits of the SHA-256 value of the user ID;

[0082] iv: Salted hash value of user ID, where the salt is a random string R', which can be, but is not limited to, a salted SHA-256 of user ID;

[0083] v: The first m bits of the salted hash value of the user ID, where the salt is a random string R', which can be, but is not limited to, the first 8 bits of the salted SHA-256 of the user ID;

[0084] vi: Other query result indexes that can be used to verify whether the query result data is data for a specified user ID.

[0085] The second encryption unit 103 is used for: (1) determining whether the first public key, the second public key, and the query ciphertext set are valid public key points; if so, encoding each matching ID to obtain a second encoding result, and generating a second private key, a first parameter, and a shared key based on the second encoding result; specifically, determining whether the y-value of the Montgomery curve is a quadratic residue modulo p based on the second encoding result; if the y-value of the Montgomery curve is a quadratic residue modulo p, calculating the first parameter and the shared key based on the second private key and the first public key; if the y-value of the Montgomery curve is not a quadratic residue modulo p, calculating the first parameter and the shared key based on the second private key and the second public key.

[0086] In practical implementation, the received first public key K is determined. B Second public key K' B 1. Check whether the ciphertext set E consists entirely of valid public key points (i.e., judge based on the value space of the aforementioned valid public key points). If there are invalid public key points, throw an exception and end the query.

[0087] If the first public key K B Second public key K' B The ciphertext set E contains only valid public key points. For each matching ID, it is encoded onto the quadratic extension field of the Montgomery curve using the encoding function f. The second encoding result of the i-th matching ID is denoted as x′. i =f(ID′) i , R), and calculate the Montgomery curve. Is it a quadratic residue modulo p?

[0088] Furthermore, a second private key for elliptic curve cryptography is randomly generated for each matching ID. And calculate the first parameter P i and shared key S i Where, if y′ i If the remainder is a quadratic residue modulo p, then otherwise,

[0089] (2) Generate a symmetric encryption key for each matching ID based on the shared key, and encrypt the matching ID based on the symmetric encryption key to obtain the ciphertext of the query result.

[0090] In practical implementation, for each matching ID, based on the shared key S i Generate a symmetric encryption key, and encrypt the query data result corresponding to the matching ID based on the symmetric encryption key to obtain the ciphertext M. i And obtain the ciphertext of the query result M = {M1, M2, ..., M} n′ In this embodiment of the invention, the shared key S i The Salsa20 algorithm can be used to obtain the symmetric encryption key, and the symmetric encryption algorithm used can be Xsalsa20Poly1305.

[0091] (3) Generate a third private key, and calculate the second parameter for each matching ID based on the third private key and the second encoding result, as well as calculate the third parameter based on the first and second parameters, and calculate the fourth parameter based on the third private key and the query ciphertext set.

[0092] In practice, firstly, a third private key s for the elliptic curve cryptography algorithm is randomly generated. C For each matching ID, the second encoded result x′ i Calculate its second parameter Q i =s C x′ i Then, based on the first parameter P i Second parameter Q i The third parameter C is calculated. i =P i +Q i Or C i =P i -Q i Let C = {C1, C2, ..., C} n′ Since the Montgomery step ladder algorithm relies solely on the x-coordinate for calculations, and a point P on an elliptic curve, given only its x-coordinate x, could correspond to either P(x,y) or P(x,-y). Therefore, using the x-coordinate x... p and x q Only the set {x} can be computed p+q x p-q The set has two elements, and it is impossible to determine exactly which element corresponds to x. p+q Which element corresponds to x? p-q C in the embodiments of the present invention i The calculation is equivalent to calculating from set {P} i +Q i P i -Q i If any element is randomly selected from}, it may equal P. i +Q i It may also be equal to P. i -Qi Finally, calculate the fourth parameter D. i =s C E i This yields D = {D1, D2, ..., D} k}

[0093] After the query result data is encrypted in the second encryption unit, the server can return the encrypted data to the client via HTTPS. The returned data includes: the query result index set H′, the ciphertext query result M, the third parameter set C, the fourth parameter set D, and data necessary for verifying the query results, such as a random string R′. H′, M, and C can be transmitted in dictionary format: T = {H′1:(M1, C1), H′2:(M2, C2), ..., H′} n′ :(M n′ C n′ That is, the query result index of each matching ID in the dictionary is matched with the ciphertext of the query result for that matching ID.

[0094] After the client receives the returned data from the server, the verification unit 204 calculates the query result index of the ID to be queried, searches for the target index corresponding to the query result index of the ID to be queried in the set of query result indexes of matching IDs, and determines the corresponding target query result ciphertext and third parameter based on the target index.

[0095] In practical implementation, the verification unit 204 performs the following verification query results operation on the k IDs to be queried in sequence:

[0096] (1) Using algorithm h, calculate the query result index H″ of the i-th ID to be queried. i .

[0097] (2) Check if H′ exists in T. j =H″ i Where 1 ≤ j ≤ n′. If there exists H′ j (i.e., the target index, indicating that there is a query result index in the returned results that has the same query ID as the one to be queried), then obtain the ciphertext of the query result corresponding to the i-th query ID (M). j C j (That is, the target index determines the corresponding target query result ciphertext and the third parameter); if H′ does not exist j If the result is negative, it means that the server's database did not find the data corresponding to the i-th query ID.

[0098] Furthermore, the first decryption unit 102 is used to calculate the decryption key based on the third and fourth parameters corresponding to the target index, and to decrypt the target query result ciphertext based on the decryption key to obtain the query result.

[0099] In practical implementation, the first decryption unit 102 performs the following operations on the retrieved ID in sequence:

[0100] (1) For the i-th ID to be queried, calculate U j =s B C j And calculate the decryption key V j ={U j +D i U j -D i}

[0101] (2) Decryption key V j The two elements in the code are used as the shared key S in sequence. j This generates a symmetric encryption key and decrypts the ciphertext M. j Then the decryption key V j There must be at least one element in M ​​that can be used to decrypt it. j The query data result corresponding to the ID to be queried is obtained. The symmetric encryption algorithm used in this embodiment of the invention may be Xsalsa20Poly1305.

[0102] Decryption key V j There must be at least one element in M ​​that can be used to decrypt it. j The reason is: U j =s B C j =s B P j +s B s c x j Or U j =s B C j =s B P j -s B s c x j D i =s c E i =s B s c x i Because the query result is encrypted (M j C j x corresponds to the i-th ID to be queried, so x i =x j D i =s B s c x j Therefore, V j ={U j+D i U j -D i There must be at least one element in} that equals s. B P j According to P j and s j The calculation process can determine s j =s B P j Therefore, V j There must be at least one element in the set that is the shared key S. j Therefore, M can be decrypted. j .

[0103] The above-mentioned anonymous query system based on data obfuscation provided in the embodiments of the present invention mainly has the following technical effects:

[0104] First, high efficiency.

[0105] (1) The embodiments of the present invention use the Montgomery step algorithm to implement elliptic curve encryption calculation, which has the advantages of being simple, fast, secure and constant time.

[0106] (2) In this embodiment of the invention, the points on the quadratic extension of the Montgomery curve are introduced into the encoding function of the elliptic curve, which greatly simplifies the user ID encoding algorithm and ensures that the encoding can be successful in one attempt. In contrast, for a general form of elliptic curve, if any point is selected, there is only a 50% probability that it can be encoded onto the elliptic curve, and the encoding algorithm is more complex and inefficient.

[0107] Second, versatility.

[0108] (1) The system provided in this embodiment of the invention is based on a data obfuscation method, which can realize anonymous query without encrypting the database in advance, and has wide applicability.

[0109] (2) This embodiment of the invention supports multiple query methods for storing ID data in the database. For example, the database can be allowed to store only the hash value of the ID, without storing the ID itself, as long as both parties agree on the encoding function f to encode the hash value of the ID onto an elliptic curve.

[0110] Third, security.

[0111] (1) Security of the Montgomery Curve. The Montgomery ladder algorithm itself is a constant-time implementation. By selecting appropriate curve parameters, the curve encryption algorithm can resist various attack methods such as small subgroup attacks, invalid curve attacks, and timing attacks on its second extension field. Currently, Montgomery curves such as Curve25519 are widely used in secure communication software such as OpenSSL. In the stealth query system proposed in this invention, low-order public key points that may pose a side channel attack (SCA) risk are eliminated, further enhancing the security of the curve.

[0112] (2) Security of the Anonymous Query Protocol: The protocol protects the privacy of the querying party. First, due to the Elliptic Curve Discrete Logarithm Problem (ECDLP), the data service provider and the third party obtain K... B =s B G or K′ B =s B G' calculates s B It is difficult, therefore it is hard to utilize E. i =s B x i Calculate x i Therefore, user query privacy is protected. Secondly, in this invention, a reasonable encoding function f can be designed based on the data distribution of IDs, such that the ID is encoded as x. i The expected number of attempts is 1, and it is achieved in a constant time, therefore, other parties cannot use timing attacks to narrow down the possible range of the target ID; and the ID is encoded as x. i A random string R was used, making it impossible for the other party to calculate... The quadratic residue property is used to narrow down the possible range of the target ID. Furthermore, this embodiment of the invention supports the querying party sending the first m bits of the ID hash value as a query index, making the distribution of true and false IDs in the database more similar, preventing the data holder from estimating the querying party's target ID based on the query results. Therefore, the process of the querying party encrypting the query for the target ID is secure.

[0113] The protocol protects the privacy of the data output service provider. In the data returned by the data service provider to the querying party, C... i =P i ±Q i =P i ±s C x i D i =s C E i =s C s B x i Take Gi =s B x i Let be the base point of the elliptic curve public-key encryption algorithm, and let Then there is D i =s C G i It can be seen that C i D i It satisfies the form of an elliptic curve public-key encryption algorithm, which encrypts P. i Therefore, a third party without the private key... B At that time, attempting to use C i D i Find P i It is difficult, and therefore it is impossible to further derive the shared key S. i To decrypt ciphertext M i Meanwhile, when j≠i, x j ≠x i For U j ±D i =S j ±s B s C x j ±s C s B x i Regardless of the sign on the right side of the equation, the last two terms cannot be eliminated to obtain the shared key S. j Therefore, the querying party can only obtain the target ID data it wants to query, and cannot obtain other user data from the data service output party.

[0114] The protocol is backwards secure. All private keys in the protocol... s B s C All private keys are generated instantaneously during protocol execution and used only during that specific execution. A completely new private key is used for each subsequent execution. This prevents the decryption of historical encrypted data due to private key leakage, and also avoids the risk of future data decryption due to the reuse of the same key set. Therefore, the stealth query protocol provided by this invention possesses excellent forward and backward security.

[0115] To facilitate understanding, this embodiment of the invention also provides a specific example of data querying based on the above-described anonymous query system based on data obfuscation. In this example, the supplier is the party outputting data in the data exchange, using a server; the demand party is the party receiving data in the data exchange, using a client. The user identifier ID can be a value such as an ID card number or mobile phone number used to uniquely identify a user. The scenario assumes that the demand party queries the supplier's personal credit report using a specified user's 11-digit mobile phone number. The query process mainly includes the following steps:

[0116] 1. The supplier calculates the SHA-256 of all mobile phone numbers in the database and sets the first 8 bits of the calculated SHA-256 value as the index of the corresponding mobile phone number.

[0117] 2. The client wants to query the personal credit report of a user with the mobile phone number 12388888888. The client takes the current timestamp t = 1680142401543, combines it with the mobile phone number to form the string "123888888881680142401543", converts this string to bytecode, and then converts it to an integer using big-endian encoding, resulting in 0x3132333838383838383831363830313432343031353433. This value is within the range of valid public key values ​​on the quadratic extension field of the Curve25519 curve. Therefore, in this query, the encoding of the mobile phone number 12388888888 on the quadratic extended field of the elliptic curve is x = 0x3132333838383838383831363830313432343031353433.

[0118] 3. The buyer randomly generates a private key s using the X25519 algorithm. B Then calculate the public key K. B =s B G and K' B =s B G′, and calculate the ciphertext E = s based on the private key. B x.

[0119] 4. The buyer randomly generates several (assuming 9) fake mobile phone numbers, adds them to the mobile phone number to be queried, calculates SHA-256 for these 10 mobile phone numbers, and removes the last few digits of the calculation result (assuming only the first 8 digits are kept).

[0120] 5. The buyer shall provide the SHA-256 hash of 10 mobile phone numbers containing only the first 8 digits, and the public key K. B K′ B The encrypted text E and the timestamp t are sent to the supplier via the HTTPS transport protocol.

[0121] 6. Upon receiving a query request from the buyer, the supplier first checks the public key K. BK′ B Check whether the ciphertext E consists of legitimate public key points. If an illegitimate public key point exists, stop the query; otherwise, continue with the subsequent steps.

[0122] 7. The supplier generates a random string UUID for this query and searches the database for users whose first 8 SHA-256 characters match any one of the 10 first 8 SHA-256 characters sent by the buyer. Assume a total of 30 users and their corresponding personal credit reports are found.

[0123] 8. For each mobile phone number found, the supplier calculates the SHA-256 hash of (mobile phone number string + UUID), and names the result H′. i .

[0124] 9. The supplier uses the timestamp t provided by the buyer, employing the same encoding method, to sequentially encode each found mobile phone number onto the quadratic extension field of the elliptic curve, and based on the encoding x... i calculate Is it a quadratic residue modulo p? Here, we take the target mobile number 12388888888 as an example; its encoding is: x i =0x3132333838383838383831363830313432343031353433, the curve parameters of Curve25519 are: A=486662, p=2 255 -19, calculated as follows:

[0125]

[0126] This value is a non-quadratic residue modulo p.

[0127] 10. The supplier randomly generates a private key using the X25519 algorithm for each mobile phone number. Calculate P i and shared key S i Taking the target mobile number 12388888888 as an example, its y i The value is a non-quadratic residue modulo p, so

[0128] 11. The supplier provides personal credit report data for each mobile phone number, based on S... i A symmetric encryption key is generated using the Salsa20 algorithm, and the data is encrypted using the Xsalsa20Poly1305 symmetric encryption algorithm to obtain ciphertext M. i .

[0129] 12. The supplier randomly generates a private key s using the X25519 algorithm. C For each mobile phone number, use its encoding x on the elliptic curve. iCalculate Q i =s c x i And further calculate C i =P i +Q i Or C i =P i -Q i .

[0130] 13. The supplier uses the private key s C Calculate D = s C E.

[0131] 14. The supplier will send the UUID, D, and encrypted data of the 30 obtained mobile phone numbers to a table named T = {H′1:(M1, C1), H′2:(M2, C2), ..., H′}. 30 :(M 30 C 30 It is sent to the demand side via the HTTPS transport protocol.

[0132] 15. The buyer calculates the SHA-256 hash of the mobile number and UUID to be queried, and then checks whether H′ exists in T. i It is equal to this value. If such a H′ exists. i Then obtain the corresponding encrypted personal credit report of the user (M i C i If H′ does not exist; i This indicates that no encrypted personal credit report data for the specified mobile phone number was found, and the query has ended.

[0133] 16. The buyer shall follow these steps to decrypt the user's personal credit report data and complete the query:

[0134] ① Calculate U i =s B C i ;

[0135] ② Calculate V i ={U i +D i U i -D i};

[0136] ③ V i The two elements in the ciphertext M are used to generate a symmetric encryption key using the Salsa20 algorithm. An attempt is then made to decrypt the ciphertext M using the Xsalsa20Poly1305 algorithm. i M can be decrypted in a maximum of two attempts. i This allows us to obtain the user's personal credit report data.

[0137] Regarding the aforementioned anonymous query system based on data obfuscation, this invention provides an anonymous query method based on data obfuscation, see [link to relevant documentation]. Figure 5 The flowchart shown illustrates an anonymous query method based on data obfuscation, indicating that the method mainly includes the following steps S501 to S503:

[0138] Step S501: The data encryption / decryption module generates a query key based on the Montgomery curve encryption algorithm, and encrypts the query ID based on the query key to obtain the query ciphertext.

[0139] Step S502: Generate a scrambled ID through the data query and scrambling module, and obtain a matching ID by performing a data query based on the scrambled ID and the ID to be queried.

[0140] Step S503: The data encryption and decryption module generates the query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypts the query result ciphertext to obtain the query result corresponding to the ID to be queried.

[0141] The above-described anonymous query method based on data obfuscation provided in this embodiment of the invention employs the Montgomery curve encryption algorithm for encrypted calculations and performs data queries through data obfuscation, thereby improving query efficiency while ensuring data query security.

[0142] In one implementation, step S501 includes: generating a first private key for the ID to be queried using an elliptic curve cryptography algorithm, and generating a first public key on the Montgomery curve and a second public key on the twist line based on the first private key; generating a random string, and encoding the ID to be queried onto the quadratic extension field of the Montgomery curve based on the random string to obtain a first encoding result, and calculating the ciphertext of the ID to be queried based on the first encoding result and the first private key to obtain a query ciphertext set; wherein the encoding process includes: determining the verification information of the ID to be queried based on the ID string of the ID to be queried; converting the verification information into first bytecode, and converting the random string into second bytecode; generating a target integer based on the first bytecode and the second bytecode, and converting the target integer into a target point of the Montgomery curve on a preset finite prime field based on a preset modulus p; determining a valid public key point on the quadratic extension field of the Montgomery curve based on the target point, and encoding the ID to be queried onto the valid public key point on the quadratic extension field of the Montgomery curve to obtain the first encoding result.

[0143] In one implementation, step S502 includes: generating multiple obfuscated IDs and determining a database retrieval index set for the obfuscated IDs and the ID to be queried; performing a data query in the data storage unit based on the database retrieval index set to obtain multiple matching IDs, and calculating a query result index set for the matching IDs.

[0144] In one implementation, step S503 includes: determining whether the first public key, the second public key, and the query ciphertext set are legitimate public key points; if so, encoding each matching ID to obtain a second encoding result, generating a second private key, a first parameter, and a shared key based on the second encoding result, generating a symmetric encryption key for each matching ID based on the shared key, and encrypting the matching ID based on the symmetric encryption key to obtain the query result ciphertext.

[0145] In one embodiment, step S503 further includes: determining whether the y-value of the Montgomery curve is a quadratic residue modulo p based on the second encoding result; if the y-value of the Montgomery curve is a quadratic residue modulo p, then calculating the first parameter and the shared key based on the second private key and the first public key; if the y-value of the Montgomery curve is not a quadratic residue modulo p, then calculating the first parameter and the shared key based on the second private key and the second public key.

[0146] In one implementation, step S503 further includes: generating a third private key, calculating a second parameter for each matching ID based on the third private key and the second encoding result, calculating a third parameter based on the first and second parameters, and calculating a fourth parameter based on the third private key and the query ciphertext set.

[0147] In one implementation, step S503 further includes: calculating the query result index of the ID to be queried, searching for the target index corresponding to the query result index of the ID to be queried in the set of query result indexes of matching IDs, and determining the corresponding target query result ciphertext and third parameter based on the target index.

[0148] In one implementation, step S503 further includes: calculating a decryption key based on the third and fourth parameters corresponding to the target index, and decrypting the target query result ciphertext based on the decryption key to obtain the query result.

[0149] The method provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned system embodiment. For the sake of brevity, any part not mentioned in the method embodiment can be referred to the corresponding content in the aforementioned system embodiment.

[0150] It should be noted that the specific values ​​provided in the implementation of this invention are merely illustrative and are not intended to be limiting.

[0151] This invention also provides an electronic device, specifically, the electronic device includes a processor and a storage device; the storage device stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.

[0152] Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 100 includes: a processor 60, a memory 61, a bus 62, and a communication interface 63. The processor 60, the communication interface 63, and the memory 61 are connected through the bus 62. The processor 60 is used to execute executable modules, such as computer programs, stored in the memory 61.

[0153] The memory 61 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 63 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0154] Bus 62 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0155] The memory 61 is used to store programs. After receiving an execution instruction, the processor 60 executes the program. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 60 or implemented by the processor 60.

[0156] Processor 60 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 60 or by instructions in software form. Processor 60 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 61. Processor 60 reads the information in memory 61 and, in conjunction with its hardware, completes the steps of the above method.

[0157] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.

[0158] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0159] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A stealth query system based on data obfuscation, characterized in that, include: Data encryption / decryption module and data query / obfuscation module; The data encryption / decryption module is used to generate a query key based on the Montgomery curve encryption algorithm, and to encrypt the query ID based on the query key to obtain the query ciphertext. The data query and obfuscation module is used to generate an obfuscated ID and perform a data query based on the obfuscated ID and the ID to be queried to obtain a matching ID; The data encryption / decryption module is further configured to generate a query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and to decrypt the query result ciphertext to obtain the query result corresponding to the ID to be queried. The data encryption / decryption module includes: a first encryption unit and a second encryption unit; the first encryption unit is used to generate a random string, and based on the random string, encode the ID to be queried onto the quadratic extension field of the Montgomery curve to obtain a first encoding result, and based on the first encoding result and a first private key, calculate the ciphertext of the ID to be queried to obtain a query ciphertext set; wherein, the encoding process includes: determining the verification information of the ID to be queried based on the ID string of the ID to be queried; converting the verification information into a first bytecode, and converting the random string into a second bytecode; generating a target integer based on the first bytecode and the second bytecode, and converting the target integer into a target point of the Montgomery curve on a preset finite prime field based on a preset modulus p; determining a valid public key point on the quadratic extension field of the Montgomery curve based on the target point, and encoding the ID to be queried onto the valid public key point on the quadratic extension field of the Montgomery curve to obtain the first encoding result; The second encryption unit is used to determine whether the y-value of the Montgomery curve is a quadratic residue modulo p based on the second encoding result; wherein, the second encoding result is obtained by encoding each of the matching IDs; if the y-value of the Montgomery curve is a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the first public key; if the y-value of the Montgomery curve is not a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the second public key.

2. The system according to claim 1, characterized in that, The query key includes: a first private key, a first public key, and a second public key; The first encryption unit is used to generate a first private key for the ID to be queried using an elliptic curve cryptography algorithm, and to generate a first public key on a Montgomery curve and a second public key on a twisted line based on the first private key.

3. The system according to claim 1, characterized in that, The data query and obfuscation module includes: an obfuscation unit, a data storage unit, and a query unit; The obfuscation unit is used to generate multiple obfuscated IDs and determine a database retrieval index set for the obfuscated IDs and the ID to be queried. The query unit is used to perform data queries in the data storage unit based on the database retrieval index set, obtain multiple matching IDs, and calculate the query result index set of the matching IDs.

4. The system according to claim 3, characterized in that, The query key includes: a second private key, a shared key, and a symmetric encryption key; The second encryption unit is used to determine whether the first public key, the second public key, and the query ciphertext set are legitimate public key points; if so, it encodes each matching ID to obtain a second encoding result, generates a second private key, a first parameter, and a shared key based on the second encoding result, generates a symmetric encryption key for each matching ID based on the shared key, and encrypts the matching ID based on the symmetric encryption key to obtain the query result ciphertext.

5. The system according to claim 4, characterized in that, The query key includes: a third private key, the second encryption unit, and is further used to generate the third private key, calculate a second parameter for each of the matching IDs based on the third private key and the second encoding result, calculate a third parameter based on the first parameter and the second parameter, and calculate a fourth parameter based on the third private key and the query ciphertext set.

6. The system according to claim 5, characterized in that, The data query and obfuscation module further includes: a verification unit, used to calculate the query result index of the ID to be queried, and to find the target index corresponding to the query result index of the ID to be queried in the set of query result indexes of the matching ID, and to determine the corresponding target query result ciphertext and third parameter based on the target index.

7. The system according to claim 6, characterized in that, The data encryption / decryption module further includes: a first decryption unit, used to calculate a decryption key based on the third parameter and the fourth parameter corresponding to the target index, and to decrypt the target query result ciphertext based on the decryption key to obtain the query result.

8. A method for anonymous querying based on data obfuscation, characterized in that, The method is applied to the data obfuscation-based stealth query system according to any one of claims 1 to 7, comprising: The data encryption / decryption module generates a query key based on the Montgomery curve encryption algorithm, and encrypts the query ID based on the query key to obtain the query ciphertext. An obfuscated ID is generated through the data query and obfuscation module, and a matching ID is obtained by performing a data query based on the obfuscated ID and the ID to be queried. The data encryption / decryption module generates the query result ciphertext corresponding to the matching ID based on the query ciphertext and the query key, and decrypts the query result ciphertext to obtain the query result corresponding to the ID to be queried. The data encryption / decryption module includes a first encryption unit and a second encryption unit. The process of generating a query key using the Montgomery curve encryption algorithm and encrypting the query ID based on the query key to obtain query ciphertext includes: generating a random string using the first encryption unit; encoding the query ID onto the quadratic extension field of the Montgomery curve based on the random string to obtain a first encoding result; and calculating the ciphertext of the query ID based on the first encoding result and a first private key to obtain a query ciphertext set. The encoding process includes: determining verification information for the query ID based on its ID string; converting the verification information into first bytecode and the random string into second bytecode; generating a target integer based on the first bytecode and the second bytecode; converting the target integer into a target point on the Montgomery curve within a preset finite prime field based on a preset modulus p; determining a valid public key point on the quadratic extension field of the Montgomery curve based on the target point; and encoding the query ID onto the valid public key point on the quadratic extension field of the Montgomery curve to obtain the first encoding result. The second encryption unit is used to determine whether the y-value of the Montgomery curve is a quadratic residue modulo p based on the second encoding result; wherein, the second encoding result is obtained by encoding each of the matching IDs; if the y-value of the Montgomery curve is a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the first public key; if the y-value of the Montgomery curve is not a quadratic residue modulo p, then the first parameter and the shared key are calculated based on the second private key and the second public key.

Citation Information

Patent Citations

  • finite field-based SM9 recognition cryptographic algorithm hardware implementation system

    CN113660087A

  • Hidden trace query system and hidden trace query method

    CN115580396A