A method, device and system for implementing encrypted database ciphertext index

By using encrypted database ciphertext indexing method and garbled code circuit in the cloud storage system, the problem of security vulnerabilities in the cloud storage system is solved, and the data is high privacy and security is achieved to prevent data leakage and tampering.

CN118898082BActive Publication Date: 2024-12-31HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411388522.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-31
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

Cloud storage systems have potential security vulnerabilities in access control. Storage servers may be attacked and lead to user data leakage or tampering, which requires improving data security.

Method used

The encrypted database ciphertext index method is adopted to transmit encrypted data between the client and the index server, and use garbled code circuits to hide the data size, ensuring that the data does not reveal the true value during query.

Benefits of technology

Improves the privacy and security of data, prevents data leakage and tampering, and enhances the security of cloud storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898082B_ABST
    Figure CN118898082B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device and system for implementing a ciphertext index of an encrypted database, and relate to the field of data processing technology. The above scheme includes: storing first ciphertext data to a storage server to obtain a storage index; sending index ciphertext data to an index server; obtaining a target garbled sequence number; performing XOR logic processing on the target garbled sequence number and a random index key to obtain a processing result as a random number seed, and generating a target garbled label for each element in a binary number according to the random number seed; converting the data to be stored according to the generated target garbled label to obtain the data to be stored represented by the target garbled label; sending the generated target garbled label and the data to be stored represented by the target garbled label to the index server. The implementation scheme for ciphertext indexing of an encrypted database provided by the embodiments of the present application can improve the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device and system for implementing a ciphertext index of an encrypted database. Background Art

[0002] Cloud storage systems are popular among users due to their high scalability, reliability, availability, remote access and sharing functions. Although current cloud storage systems have adopted identity authentication technology for access control and improved the confidentiality of data in the system, cloud storage systems still have potential deficiencies, and storage servers may still be at risk of being attacked, which may lead to user data being leaked or tampered with.

[0003] Therefore, it is necessary to provide an implementation scheme for ciphertext indexing of encrypted databases to improve data security. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device and system for implementing a ciphertext index of an encrypted database to improve the security of data. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for implementing a ciphertext index of an encrypted database, which is applied to a client, and the method includes:

[0006] storing first ciphertext data of the data to be stored in a storage server, and obtaining a storage index of the first ciphertext data in the storage server;

[0007] Sending the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list;

[0008] Obtaining a target garbled sequence number corresponding to the target node, generated by the index server;

[0009] Performing XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generating a target garbled code label for each element in the binary number according to the random number seed;

[0010] According to the generated target garbled code label, the data to be stored is converted to obtain the data to be stored represented by the target garbled code label;

[0011] The generated target garbled code label and the data to be stored represented by the target garbled code label are sent to the index server, so that the index server generates a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label and a garbled code circuit template, and stores the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

[0012] In a second aspect, an embodiment of the present application provides a method for implementing a ciphertext index of an encrypted database, which is applied to an index server, and the method includes:

[0013] Obtaining index ciphertext data of the storage index of the data to be stored in the storage server sent by the client;

[0014] Creating a target node in a target jump list, and storing the index ciphertext data in the target node;

[0015] Generate a target garbled serial number corresponding to the target node, and feed back the target garbled serial number to the client;

[0016] Obtaining the target garbled code tag sent by the client and the data to be stored represented by the target garbled code tag, wherein the target garbled code tag is a tag of each element in a binary number generated by the client according to the target garbled code sequence number and a random index key;

[0017] Generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label;

[0018] The target garbled code circuit is stored in the target node.

[0019] In a third aspect, an embodiment of the present application provides a method for implementing a ciphertext index of an encrypted database, which is applied to a client, and the method includes:

[0020] Generate a second garbled tag according to the data to be queried and the stored query tag;

[0021] Sending the second garbled label to the index server, wherein each node in the target jump table of the index server stores: ciphertext data of a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by the node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key and the data pointed to by the storage index stored in the node;

[0022] Obtaining target ciphertext data stored in a second node that is fed back by the index server and matches the data to be queried in the second garbled tag;

[0023] Decrypting the target ciphertext data to obtain a target storage index;

[0024] Obtaining second ciphertext data pointed to by the target storage index in the storage server;

[0025] The second ciphertext data is decrypted to obtain the data to be queried.

[0026] In a fourth aspect, an embodiment of the present application provides a method for implementing a ciphertext index of an encrypted database, which is applied to an index server, wherein each node in a target jump table of the index server stores: ciphertext data of a storage index in a storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, a random index key, and the data pointed to by the storage index stored in the node;

[0027] The method comprises:

[0028] Obtaining a second garbled tag sent by the client and generated according to the data to be queried and the stored query tag;

[0029] Determine, among the nodes included in the target jump table, a second node that matches the data to be queried in the second garbled label;

[0030] The target ciphertext data stored in the second node is fed back to the client so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

[0031] In a fifth aspect, an embodiment of the present application provides a device for implementing a ciphertext index of an encrypted database, which is applied to a client, and the device includes:

[0032] A storage index obtaining module, used to store first ciphertext data of data to be stored in a storage server, and obtain a storage index of the first ciphertext data in the storage server;

[0033] An index ciphertext data sending module, used for sending the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list;

[0034] A target garbled code sequence number obtaining module, used to obtain a target garbled code sequence number corresponding to the target node, generated by the index server;

[0035] A target garbled code label generation module is used to perform XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generate a target garbled code label for each element in the binary number according to the random number seed;

[0036] A data conversion module, used for converting the data to be stored according to the generated target garbled code label to obtain the data to be stored represented by the target garbled code label;

[0037] A label and index sending module is used to send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server, so that the index server generates a target scrambled code circuit according to the target scrambled code label, the data to be stored represented by the target scrambled code label and the scrambled code circuit template, and stores the target scrambled code circuit in the target node, wherein one input data of the target scrambled code circuit is: the data to be stored represented by the target scrambled code label.

[0038] In a sixth aspect, an embodiment of the present application provides a device for implementing a ciphertext index of an encrypted database, which is applied to an index server, and the device includes:

[0039] A first ciphertext data obtaining module is used to obtain index ciphertext data of a storage index of data to be stored in a storage server sent by a client;

[0040] A target node creation module, used to create a target node in a target jump list and store the index ciphertext data in the target node;

[0041] A target garbled code sequence number generating module is used to generate a target garbled code sequence number corresponding to the target node, and feed back the target garbled code sequence number to the client;

[0042] A label and data acquisition module, used to obtain the target garbled code label sent by the client and the data to be stored represented by the target garbled code label, wherein the target garbled code label is a label of each element in a binary number generated by the client according to the target garbled code sequence number and a random index key;

[0043] A target garbled code circuit generation module is used to generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label;

[0044] A data storage module is used to store the target garbled code circuit in the target node.

[0045] In a seventh aspect, an embodiment of the present application provides a device for implementing a ciphertext index of an encrypted database, which is applied to a client, and the device includes:

[0046] A second garbled label generation module, used to generate a second garbled label according to the data to be queried and the stored query label;

[0047] A second garbled code label sending module is used to send the second garbled code label to the index server, wherein each node in the target jump table of the index server stores: a ciphertext data of a storage index in the storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, the random index key and the data pointed to by the storage index stored in the node;

[0048] A target ciphertext data obtaining module, used to obtain the target ciphertext data stored in the second node that matches the data to be queried in the second garbled tag and is fed back by the index server;

[0049] A ciphertext decryption module, used to decrypt the target ciphertext data to obtain a target storage index;

[0050] A second ciphertext data obtaining module, used to obtain the second ciphertext data pointed to by the target storage index in the storage server;

[0051] The data decryption module is used to decrypt the second ciphertext data to obtain the data to be queried.

[0052] In an eighth aspect, an embodiment of the present application provides an encrypted database ciphertext index implementation device, which is applied to an index server, wherein each node in a target jump table of the index server corresponds to: ciphertext data storing a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by the node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key, and the data pointed to by the storage index stored in the node;

[0053] The device comprises:

[0054] A second garbled label obtaining module, used to obtain a second garbled label sent by the client and generated according to the to-be-queried data and the stored query label;

[0055] A node matching module, used to determine, among the nodes included in the target jump table, a second node matching the data to be queried in the second garbled label;

[0056] A storage index feedback module is used to feed back the target ciphertext data stored in the second node to the client, so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

[0057] In a ninth aspect, an embodiment of the present application provides a system for implementing a ciphertext index of an encrypted database, the system comprising a client, an index server, and a storage server for storing data;

[0058] The client is used to store the first ciphertext data of the storage data to the storage server, obtain the storage index of the first ciphertext data in the storage server, and send the index ciphertext data of the storage index to the index server;

[0059] The index server is used to create a target node in a target jump list after receiving the index ciphertext data, store the index ciphertext data in the target node, generate a target garbled sequence number corresponding to the target node, and feed back the target garbled sequence number to the client;

[0060] The client is further used to perform XOR logic processing on the target scrambled code sequence and the random index key to obtain a processing result as a random number seed, and generate a target scrambled code label for each element in the binary number according to the random number seed, convert the data to be stored according to the generated target scrambled code label to obtain the data to be stored represented by the target scrambled code label, and send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server;

[0061] The index server is further used to generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, and store the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

[0062] In a tenth aspect, an embodiment of the present application provides an electronic device, including:

[0063] Memory, used to store computer programs;

[0064] A processor is used to implement the method of any one of the first to fourth aspects when executing a program stored in a memory.

[0065] In the eleventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of the first to fourth aspects is implemented.

[0066] Beneficial effects of the embodiments of the present application:

[0067] As can be seen from the above, when applying the solution provided in the embodiment of the present application for data storage, the client not only encrypts the data to be stored to obtain the first ciphertext data, and stores the first ciphertext data in the storage server, but also stores the index ciphertext data of the storage index of the first ciphertext data in the storage server in the node of the index server, and uses a garbled circuit to avoid revealing the size of the data to be stored during data query, which can improve the privacy and security of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0069] Figure 1aA schematic diagram of the structure of an ordered linked list provided in an embodiment of the present application;

[0070] Figure 1b A schematic diagram of the structure of a jump table provided in an embodiment of the present application;

[0071] Figure 2 A signaling flow diagram of a first method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0072] Figure 3 A signaling flow diagram of a second method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0073] Figure 4 A schematic diagram of the structure of a garbled code circuit provided in an embodiment of the present application;

[0074] Figure 5 A flowchart of a first method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0075] Figure 6 A flowchart of a second method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0076] Figure 7a A schematic diagram of the structure of a first sub-garbled code circuit provided in an embodiment of the present application;

[0077] Figure 7b A schematic diagram of the structure of a first comparison circuit provided in an embodiment of the present application;

[0078] Figure 8a A schematic diagram of the structure of a second sub-garbled code circuit provided in an embodiment of the present application;

[0079] Figure 8b A schematic diagram of the structure of a second comparison circuit provided in an embodiment of the present application;

[0080] Fig. 9 A flowchart of a third method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0081] Fig.10 A flowchart of a fourth method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0082] Fig.11 A schematic diagram of the signaling flow of the third method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0083] Fig.12 A flowchart of a fifth method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0084] Fig.13 A flowchart of a sixth method for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0085] Fig.14 A schematic diagram of the structure of a system for implementing a ciphertext index of an encrypted database provided in an embodiment of the present application;

[0086] Fig.15 A schematic diagram of the structure of a first encrypted database ciphertext index implementation device provided in an embodiment of the present application;

[0087] Fig.16 A schematic diagram of the structure of a second encrypted database ciphertext index implementation device provided in an embodiment of the present application;

[0088] Fig.17 A schematic diagram of the structure of a third encrypted database ciphertext index implementation device provided in an embodiment of the present application;

[0089] Fig.18 A schematic diagram of the structure of a fourth encrypted database ciphertext index implementation device provided in an embodiment of the present application;

[0090] Fig.19 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0092] First, various devices involved in the embodiments of the present application are described.

[0093] 1. Storage Server

[0094] The storage server includes a data table for storing data, wherein the data stored in the data table may be encrypted data or unencrypted data.

[0095] 2. Client

[0096] The client is used to interact with the user and perform operations such as data storage and query according to the user's instructions. In addition, the user can also customize the data table fields in the storage server that use ciphertext indexes in the client. If the location of the data in the data table is in the data table field that uses ciphertext indexes, when storing the data, the storage index of the data fed back by the storage server can also be encrypted. Therefore, when querying the data, it is necessary to first decrypt the storage index of the data, and then query the data based on the decrypted storage index.

[0097] The storage index of the above data may be the primary key of the data in the data table.

[0098] In addition, a circuit generation management module may be integrated into the client to perform operations such as data storage and query on behalf of the client.

[0099] 3. Index Server

[0100] The index server is used to store and manage index information of data in the storage server. For data stored in the storage server and located in fields that require ciphertext indexing, a node in the data storage structure corresponding to the data is created in the index server. The node stores index information of the data, and different nodes store index information of different data.

[0101] In an embodiment of the present application, the index information of the data stored in the node of the index server includes the ciphertext data, the garbled code label and the garbled code circuit corresponding to the storage index of the data.

[0102] When a user needs to query data, the client first obtains the ciphertext data of the storage index stored in the node corresponding to the data from the index server, decrypts it to obtain the storage index, and then queries the data from the storage server based on the decrypted storage index.

[0103] In addition, a circuit operation management module may be integrated in the index server to store and manage index information of data in the storage server on behalf of the index server.

[0104] Next, the data structure of the skip list is explained.

[0105] A skip list adds multi-level indexes to a linked list, which improves the efficiency of search, insertion, and deletion operations. The average time complexity of a skip list can reach O (log n), which is similar to that of a balanced tree.

[0106] See also Figure 1a , Figure 1aIt is a data structure of an ordered linked list. The linked list contains 12 nodes. The first node is the head node. The data in the middle 10 nodes are 3, 6, 7, 9, 12, 17, 19, 21, 25, and 26. The pointer of the last node of the middle 10 nodes points to the NULL node. When searching for data in the linked list, for example, when searching for data 19, you need to search from the head node one by one until you find the 8th node, and then you can find data 19.

[0107] exist Figure 1a By adding multiple levels of indexes to the ordered linked list shown in the figure, a skip list can be obtained, such as Figure 1b As shown, Figure 1b It is a data structure of a skip list, which contains the original ordered linked list and three-level index. It can be understood that the skip list has four-level index, and some nodes have multiple pointers corresponding to different index levels. For example, the third node has four pointers, corresponding to the four-level index, and the four pointers point to different nodes respectively; the fifth node has two pointers, corresponding to the original linked list and the first-level index, and the two pointers also point to different nodes respectively.

[0108] When searching for data 19 in the skip list, first search from the third-level index and compare 6 with 19. 6 is less than 19, which means that the node containing data 19 is behind the node containing data 6. The pointer of the third-level index contained in the third node where data 6 is located can be used to determine the next node to be compared. At this time, the next node determined is a NULL node, which means that the end of the skip list has been indexed. Therefore, the next-level index can be used to search again, that is, the pointer of the second-level index contained in the third node is used to determine the next node, that is, the tenth node where data 25 is located. 19 is compared with 25. 25 is greater than 19, which means that the node containing data 19 is in front of the tenth node and behind the third node. At this time, the next-level index can be used to search again, that is, the pointer of the first-level index contained in the third node is used to determine the next node, that is, data 9 The fifth node where the data is located, compares 9 with 19, 9 is less than 19, which means that the node containing data 19 is behind the fifth node. At this time, the pointer of the first-level index contained in the fifth node can be used to determine the next node to be compared, that is, the seventh node where the data 17 is located, and compares 17 with 19. 17 is less than 19. Similarly, the pointer of the first-level index contained in the seventh node is used to determine the next node to be compared, that is, the tenth node. Since it has been determined that the node where the data 19 is located is before the tenth node, the next-level index can be used to search. At this time, the next-level index is the index where the original linked list is located. According to the pointer of the seventh node in the original linked list, the next node to be compared is determined, that is, the eighth node where the data 19 is located. By comparing 19 with 19, it can be determined that the node where the data 19 is located is the eighth node.

[0109] Below, a data encryption storage and data query method and device provided in an embodiment of the present application are described in detail.

[0110] See also Figure 2 , shows the first interaction process between devices during data encryption and storage, including the following steps S201-S209.

[0111] Step S201: The client sends first ciphertext data of data to be stored to the storage server.

[0112] Specifically, after obtaining the data to be stored, the client may encrypt the data to be stored to obtain first ciphertext data, and send the first ciphertext data to the storage server.

[0113] When encrypting the data to be stored, the client may encrypt the data to be stored according to a pre-acquired data encryption key.

[0114] For example, the data to be stored may be symmetrically encrypted according to the data encryption key to obtain encrypted data.

[0115] The data encryption key may be obtained by the client by applying to a device or system for managing encryption keys. For example, the client may apply to a key management system (KMS) for the data encryption key.

[0116] The data encryption key may also be an encryption key input by a user.

[0117] In one embodiment of the present application, when encrypting the data to be stored, the data to be stored may be encrypted according to the data encryption key and the randomly generated vector to obtain first ciphertext data.

[0118] In this case, each time data encryption is performed, a vector may be randomly generated, and the data to be encrypted may be encrypted according to the pre-acquired data encryption key and the generated vector to obtain ciphertext data.

[0119] For example, the data is symmetrically encrypted according to the data encryption key and the vector to obtain ciphertext data.

[0120] Since the vector is randomly generated each time the data is encrypted, the ciphertext data obtained from multiple encryptions for the same data value may be different and random. In this way, when the ciphertext data corresponding to one of the data is leaked, it will not affect other data, thereby improving the security of data encryption.

[0121] For example, for gender data, the data values ​​of different users under this data may all be male. When encrypting the gender data of different users, vectors can be randomly generated multiple times, and the data can be encrypted according to the randomly generated vectors to obtain ciphertext data.

[0122] Step S202: After storing the first ciphertext data, the storage server feeds back a storage index of the first ciphertext data in the storage server to the client.

[0123] After receiving the first ciphertext data, the storage server may store the first ciphertext data in a data table of a database contained in the storage server, record a storage index of the first ciphertext data in the data table, and feed back the storage index to the client.

[0124] Step S203: The client sends the index ciphertext data storing the index to the index server.

[0125] After obtaining the storage index, the client can encrypt the storage index to obtain the index ciphertext data, and then send the index ciphertext data to the index server.

[0126] Step S204: the index server creates a target node in the target jump list and stores the index ciphertext data in the target node.

[0127] The index server may create a target node, and after obtaining the index ciphertext data, may store the index ciphertext data in the created target node.

[0128] When determining the position of the target node, the index server can query the first adjacent node and the second adjacent node adjacent to the two nodes based on the query mechanism of the jump table, determine that the position between the first adjacent node and the second adjacent node is the position of the target node, and create the target node at the determined position, wherein the data contained in the first adjacent node is smaller than the data to be stored, and the data contained in the second adjacent node is larger than the data to be stored. The specific method for determining the position of the target node can be found in the subsequent embodiments and will not be described in detail here.

[0129] After the target node is created, pointers of one or more index levels from the target node to other nodes may be generated according to the index mechanism of the target skip list, and the generated pointers may be stored in the target node.

[0130] Step S205: the index server generates a target garbled sequence number corresponding to the target node.

[0131] Among them, the number of bits of the target garbled sequence number can be preset, such as 128 bits, 256 bits, etc.

[0132] The index server may randomly generate a set of serial numbers as target garbled serial numbers corresponding to the target nodes.

[0133] Step S206: the index server sends the target garbled sequence number to the client.

[0134] Step S207: The client performs XOR logic processing on the target scrambled code sequence number and the random index key to obtain a processing result, which is used as a random number seed. According to the random number seed and the data to be stored, a target scrambled code label for each element in the binary number is generated, and according to the generated target scrambled code label, the data to be stored is converted to obtain the data to be stored represented by the target scrambled code label.

[0135] The random index key may be randomly generated data of a preset number of bits. For example, the random index key may be randomly generated data of 128 bits.

[0136] Each element in the above binary number is "0" or "1", so the above target garbled code label includes a garbled code label of "0" and a garbled code label of "1".

[0137] Specifically, after the client obtains the target scrambled code serial number, it can perform XOR logic processing on the target scrambled code serial number and the random index key to obtain a processing result, and use the processing result as a random number seed. According to the random number seed and the data to be stored, a data is randomly generated as the target scrambled code label of an element in the binary number; the randomly generated data is transformed to obtain the transformation result as the target scrambled code label of another element in the binary number.

[0138] In one embodiment of the present application, when randomly generated data is transformed, the data and a preset global offset may be subjected to an XOR logic process to obtain the result of the process as a target garbled code label.

[0139] For example, if X is a garbled label of "0", which is a 128-bit random number randomly generated using the aforementioned random number seed and the data to be stored, then X and the preset global offset can be Perform XOR logic processing to obtain the target garbled label of "1" ,in, It can also be a 128-bit random number.

[0140] After obtaining the garbled labels of "0" and "1", each element in the data to be stored can be converted to obtain the data to be stored represented by the target garbled labels.

[0141] Step S208: the client sends the generated target garbled code tag and the data to be stored represented by the target garbled code tag to the index server.

[0142] Step S209: the index server generates a target garbled code circuit according to the target garbled code tag, the data to be stored represented by the target garbled code tag, and the garbled code circuit template, and stores the target garbled code circuit in the target node.

[0143] The garbled code circuit used in the embodiment of the present application has two inputs and two outputs, where the two inputs are referred to as input IN1 and input IN2, and the two outputs are referred to as output OUT1 and output OUT2.

[0144] The garbled code circuit is used to compare the numerical relationship between IN1 and IN2. OUT1 can be used to indicate the size relationship between IN1 and IN2. For example, OUT1 is 0, indicating that IN1 is less than IN2, and OUT1 is 1, indicating that IN1 is greater than IN2. OUT2 can be used to indicate whether IN1 and IN2 are equal. For example, OUT2 is 0, indicating that IN1 and IN2 are not equal, and OUT2 is 1, indicating that IN1 and IN2 are equal.

[0145] One of the two input data of the target garbled code circuit is: data to be stored represented by the target garbled code label.

[0146] The target garbled code circuit is a logic circuit. For example, the target garbled code circuit may be a logic circuit constructed according to Yao's garbled code circuit technology.

[0147] For further description of the target garbled code circuit, please refer to the subsequent embodiments, which will not be described in detail here.

[0148] Specifically, after obtaining the target garbled code tag and the data to be stored represented by the target garbled code tag, the index server can use the data to be stored as an input in the garbled code circuit template to obtain the target garbled code circuit.

[0149] Subsequently, when another data is input into the target garbled code circuit to compare the numerical relationship between the other data and the data to be stored, the other data represented by the generated target garbled code label can be obtained based on the target garbled code label of each element in the binary number, and then the obtained data can be input into the target garbled code circuit to obtain the output result of the target garbled code circuit.

[0150] After the index server generates the target garbled code circuit, it can store the target garbled code circuit in the target node.

[0151] In one embodiment of the present application, the client, the storage server, and the index server may use serialization technology to transmit data when performing data transmission.

[0152] For example, when a client sends data to an index server, the client can serialize the data to be sent, obtain the processed data, and send the processed data to the index server. After receiving the processed data, the index server can deserialize it to obtain the original data, thereby enabling the client to send data to the index server.

[0153] In one embodiment of the present application, see Figure 3 , shows the second interaction process between the devices in the data encryption storage process. In this embodiment, in addition to the above Figure 2 In addition to the steps in the process shown, Figure 3 The interactive process shown also includes the following steps S210-S213.

[0154] Step S210: the index server feeds back the first garbled label stored in the first node to the client.

[0155] The first node is a node that is after the target node and connected to the target node.

[0156] The first node mentioned above can be understood as the node pointed to by the pointer of the target node. Figure 1bIn the example, if the fifth node is the target node, the fifth node has two pointers, which correspond to two directions, one direction is backward and the other direction is downward. The pointer for backward points to the seventh node, and the pointer for downward points to the sixth node. The sixth node and the seventh node are both the first node mentioned above.

[0157] Specifically, after creating the target node, the index server may determine the first node according to the pointer of the target node, and obtain the garbled label stored in the first node as the first garbled label, thereby sending the obtained garbled label to the client.

[0158] Step S211: the client generates a first label conversion ciphertext according to the target garbled label and the first garbled label.

[0159] Specifically, the client may perform an XOR logic process on the target garbled label and the first garbled label to obtain a label conversion relationship corresponding to the element, and then encrypt the label conversion relationship to obtain a first label conversion ciphertext.

[0160] For example, if the target garbled label is A and the first garbled label is B, then the target garbled label and the first garbled label are subjected to XOR logic processing to obtain the label conversion relationship A corresponding to the element. B, then encrypt the label conversion relationship to obtain the first label conversion ciphertext .

[0161] Step S212: the client sends the first label-converted ciphertext to the index server.

[0162] Step S213: The index server stores the first label ciphertext to the target node.

[0163] There is a corresponding relationship between the output result, pointer and first node of the target garbled code circuit of the target node. When querying data, another input of the target garbled code circuit can be called the data to be queried. When the target garbled code circuit is used to compare the numerical relationship between the data to be stored and the data to be queried, if the output result of the target garbled code circuit is that the data to be queried is greater than the data to be stored, then the backward pointer is called at this time, and the first node corresponding to the pointer is determined to be the next node to be compared; if the output result of the target garbled code circuit is that the data to be queried is less than the data to be stored, then the downward pointer is called at this time, and the first node corresponding to the pointer is determined to be the next node to be compared.

[0164] In view of this, when storing the first label ciphertext, the index server may associate the first label ciphertext with the output result according to the corresponding relationship between the output result and the first node.

[0165] See also Figure 4, a schematic diagram of the structure of a target garbled code circuit is provided. In this embodiment, represents the data to be queried, A represents the target garbled label, Indicates the preset global offset, Indicates the data to be queried represented by the target garbled label. The output "0" of the subcircuit for judging the value size in the target garbled circuit indicates that the data to be queried is smaller than the data to be stored, and the output is associated with the first label conversion ciphertext corresponding to the first node 1 , B represents the garbled label of the first node 1; the output "1" of the subcircuit for judging the value size in the target garbled circuit indicates that the data to be queried is greater than the data to be stored, and the output is associated with the first label conversion ciphertext corresponding to the first node 2 , C represents the garbled label of the first node 2.

[0166] Will Input the target garbled code circuit, and compare the query data with the data to be stored. If the query data is smaller than the data to be stored, the target garbled code circuit outputs 0. At this time, the garbled code label corresponding to "0" can be used as a key to Decrypt and get A B, again and A B performs XOR logic processing, ( ) (A B) = , obtain the data to be queried represented by the garbled label of the first node 1, and then continue to compare in the garbled circuit of the first node 1.

[0167] If the data to be queried is larger than the data to be stored, the target garbled code circuit outputs 1. At this time, the garbled code label corresponding to "1" can be used as a key to Decrypt and get A C, again and A C performs XOR logic processing, ( ) (A C) = , obtain the data to be queried represented by the garbled label of the first node 2, and then continue to compare in the garbled circuit of the first node 2.

[0168] The data storage method applied to the client is described below through a specific embodiment.

[0169] In one embodiment of the present application, see Figure 5, a flow chart of a first method for implementing a ciphertext index of an encrypted database is provided. The method for implementing a ciphertext index of an encrypted database can also be regarded as a data storage method. In this embodiment, the above method is applied to a client, and includes the following steps S501-S505.

[0170] Step S501: Store first ciphertext data of the data to be stored in a storage server, and obtain a storage index of the first ciphertext data in the storage server.

[0171] For instructions on this step, see the previous Figure 2 Steps S201 - S202 in the illustrated embodiment are not described in detail here.

[0172] Step S502: sending index ciphertext data storing the index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list.

[0173] For instructions on this step, see the previous Figure 2 Steps S203 - S204 in the illustrated embodiment will not be described in detail here.

[0174] Step S503: Obtain the target garbled sequence number corresponding to the target node, which is generated by the index server.

[0175] For instructions on this step, see the previous Figure 2 Steps S205-S206 in the illustrated embodiment will not be described in detail here.

[0176] Step S504: Perform XOR logic processing on the target garbled code sequence number and the index key to obtain the processing result, which is used as a random number seed. According to the random number seed, a target garbled code label for each element in the binary number is generated, and according to the target garbled code label, the data to be stored is converted to obtain the data to be stored represented by the target garbled code label.

[0177] For instructions on this step, see the previous Figure 2 Step S207 in the illustrated embodiment will not be described in detail here.

[0178] Step S505: Send the generated target garbled code label and the data to be stored represented by the target garbled code label to the index server, so that the index server generates a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label and the garbled code circuit template, and stores the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

[0179] For instructions on this step, see the previous Figure 2 Steps S208-S209 in the illustrated embodiment will not be described in detail here.

[0180] As can be seen from the above, when applying the solution provided in the embodiment of the present application for data storage, the client not only encrypts the data to be stored to obtain the first ciphertext data, and stores the first ciphertext data in the storage server, but also stores the index ciphertext data of the storage index of the first ciphertext data in the storage server in the node of the index server, and uses a garbled circuit to avoid revealing the size of the data to be stored during data query, which can improve the privacy and security of the data.

[0181] In one embodiment of the present application, see Figure 6 , a flow chart of a second method for implementing a ciphertext index of an encrypted database is provided. In this embodiment, the method further includes the following steps S506-S508.

[0182] Step S506: obtaining a first garbled label stored in a first node fed back by the index server, wherein the first node is a node subsequent to the target node and connected to the target node.

[0183] For instructions on this step, see the previous Figure 3 Step S210 in the illustrated embodiment will not be described in detail here.

[0184] Step S507: Generate a first label conversion ciphertext according to the target garbled label and the first garbled label.

[0185] For instructions on this step, see the previous Figure 3 Step S211 in the illustrated embodiment will not be described in detail here.

[0186] Step S508: Send the first label-converted ciphertext to the index server, so that the index server stores the first label-converted ciphertext in the target node.

[0187] For instructions on this step, see the previous Figure 3 Steps S212-S213 in the illustrated embodiment will not be described in detail here.

[0188] As can be seen from the above, when the scheme provided by the embodiment of the present application is used to store data, the first garbled label is the garbled label stored in the first node, the target garbled label is the garbled label stored in the target node, and the first label conversion ciphertext is generated according to the target garbled label and the first garbled label. The first label conversion ciphertext can be understood as the ciphertext of the conversion relationship between the target garbled label and the first garbled label. In this way, the first label conversion ciphertext is stored in the target node, and when querying data, according to the first label conversion ciphertext, the data represented by the target garbled label can be accurately converted into the data converted by the first garbled label, so that the data represented by the first garbled label can be input into the garbled circuit in the first node, and the garbled circuit in the first node is used to continue the query until the query is completed. Therefore, the data storage scheme provided by the embodiment of the present application can improve the accuracy of data query.

[0189] The above-mentioned target garbled code circuit is further described below.

[0190] In one embodiment of the present application, the target garbled code circuit includes a first sub-garbled code circuit and a second sub-garbled code circuit;

[0191] The first sub-garbled code circuit is used to compare the size relationship of two input data;

[0192] The second sub-garbled code circuit is used to determine whether two input data are equal.

[0193] In this scheme, two sub-scrambling circuits are used to respectively determine the size relationship and the equality relationship of two input data. The two sub-scrambling circuits share the input data, and each sub-scrambling circuit only needs to be designed for one relationship without taking into account the other relationship. This can greatly reduce the design difficulty and circuit complexity of the scrambling circuit. Using a more streamlined scrambling circuit, the circuit output result can be obtained more quickly, thereby improving data storage efficiency.

[0194] See also Figure 7a , provides a schematic diagram of the structure of a first sub-garbled code circuit, from Figure 7a It can be seen that the first sub-garbled code circuit is obtained by connecting multiple first comparison circuits in series, each first comparison circuit corresponds to the bit of the input data one by one, the number of first comparison circuits is the same as the number of bits of the input data, and the target garbled code label corresponding to the value of each bit of the input data is the input of the corresponding first comparison circuit. C0 is a first preset value, such as C0=0. If Ci is 0, IN1 of the target garbled code circuit is less than IN2, and if Ci is 1, IN1 of the target garbled code circuit is greater than IN2.

[0195] For example, if the input data is 4 bits, then there are also 4 first comparison circuits. If the target garbled code label of "0" is K0, the target garbled code label of "1" is K1, one input data of the target garbled code circuit is data 0100 represented by the target garbled code label, and the other input data is data 1001 represented by the target garbled code label, then Figure 7a , m1 to mi are K0, K1, K0, K0 respectively, and n1 to ni are K1, K0, K0, K1 respectively.

[0196] See also Figure 7b , a schematic diagram of the structure of a first comparison circuit is provided, from Figure 7b It can be seen that Ci-1 is the first reference value in this circuit, mi and ni are the first comparison value and the second comparison value in this circuit respectively, and Ci is the output of this circuit. The first comparison circuit is used to: perform XOR gate logic processing on the first reference value, the first comparison value and the second comparison value respectively, perform AND gate logic processing on the two processing results, perform XOR gate logic processing on the result and the target comparison value in the first comparison value, and obtain the output result of the first comparison circuit.

[0197] Among them, the first reference value corresponding to the first first comparison circuit is the first preset value, the first reference values ​​corresponding to other first comparison circuits are the output results of the previous first comparison circuit, the first comparison value is: the value of the bit corresponding to the first comparison circuit in the data to be stored represented by the target garbled code label, and the second comparison value is: the value of the bit corresponding to the first comparison circuit in another input data other than the input data corresponding to the first comparison value.

[0198] For example, in the first first comparison circuit, the first reference value is: the first preset value, the first comparison value is: the value of the first bit in the data to be stored represented by the target garbled code label, and the second comparison data is: the value of the first bit in another input data other than the input data corresponding to the first comparison value.

[0199] In the second first comparison circuit, the first reference value is: the output result of the first first comparison circuit, the first comparison value is: the value of the second bit in the data to be stored represented by the target garbled code label, and the second comparison data is: the value of the second bit in another input data other than the input data corresponding to the first comparison value.

[0200] Use Figure 7a , Figure 7b The first sub-garbled code circuit shown in FIG. 1 can accurately compare the size relationship of two input data, thereby converting Figure 7a , Figure 7bThe first sub-garbled code circuit shown as a target garbled code circuit can improve the accuracy of the target garbled code circuit, and further improve the accuracy of data storage.

[0201] See also Figure 8a , provides a schematic diagram of the structure of a second sub-garbled code circuit, from Figure 8a It can be seen that the second sub-garbled code circuit is obtained by connecting multiple second comparison circuits in series, and each second comparison circuit corresponds to the bit of the input data one by one. The number of second comparison circuits is the same as the number of bits of the input data, and the target garbled code label corresponding to the value of each bit of the input data is the input of the corresponding second comparison circuit. eq0 is the second preset value, such as eq0=0. If eqi is 0, IN1 and IN2 of the target garbled code circuit are not equal. If eqi is 1, IN1 and IN2 of the target garbled code circuit are equal.

[0202] See also Figure 8b , a schematic diagram of the structure of a second comparison circuit is provided, from Figure 8b It can be seen that eqi-1 is the second reference value in this circuit, mi and ni are the values ​​of the bits corresponding to this circuit, and eqi is the output of this circuit. The second comparison circuit is used to: perform XOR gate logic processing on the values ​​of the bits corresponding to the second comparison circuit in the two input data, and perform OR gate logic processing on the obtained processing result and the second reference value to obtain the output result of the second comparison circuit.

[0203] The second reference value corresponding to the first second comparison circuit is a second preset value, and the second reference values ​​corresponding to other second comparison circuits are output results of the previous second comparison circuit.

[0204] For example, in the first second comparison circuit, the second reference value is: a second preset value, and the two values ​​subjected to the XOR gate logic processing are: the values ​​of the first bits of the two input data.

[0205] In the second second comparison circuit, the second reference value is: the output result of the first second comparison circuit, and the two values ​​subjected to the XOR gate logic processing are: the values ​​of the second bits of the two input data.

[0206] Use Figure 8a , Figure 8b The second sub-garbled code circuit shown in FIG. 1 can accurately determine whether two input data are equal, thereby Figure 8a , Figure 8b The second sub-garbled code circuit shown as a target garbled code circuit can improve the accuracy of the target garbled code circuit, and further improve the accuracy of data storage.

[0207] The index server may communicate with multiple clients, so the index server may perform data queries for multiple clients at the same time.

[0208] In response to this situation, in one embodiment of the present application, after adding a new target node to the target jump table of the index server, the client can determine the target level of the target node in each node generated by the index server, and determine the number of target scrambled code circuits based on the target level and the preset number of scrambled code circuits contained in the head node, so that when generating the target scrambled code label, first, a determined number of random number seeds are obtained by executing the step of performing XOR logic processing on the target scrambled code sequence number and the random index key a determined number of times, and then a determined number of groups and target scrambled code labels for each element in the binary number are generated based on the determined number of random number seeds, wherein the target scrambled code labels for each element in each binary number generated include scrambled code labels for the two elements "0" and "1", and therefore, the target scrambled code labels for each element in each binary number can be called a group of target scrambled code labels.

[0209] For each set of target garbled labels, the data to be stored is converted according to the set of target garbled labels, so that the data to be stored represented by the set of target garbled labels can be obtained.

[0210] After obtaining the generated number group target garbled labels and the corresponding converted data to be stored, the generated number group target garbled labels, the converted data to be stored and the garbled circuit template can be sent to the index server.

[0211] Thus, according to each set of target garbled code labels and the corresponding converted data to be stored, the index server can generate a target garbled code circuit, a total of the determined number of target garbled code circuits, and each target garbled code label corresponds to a target garbled code circuit. Thus, the index server can store the determined number of target garbled code circuits in the target node.

[0212] Among them, the above-mentioned preset number is a pre-set number, such as 10, 15, 20, etc.

[0213] Specifically, in the index server, a node can store multiple garbled circuits, and the number of garbled circuits in the node is related to the level of the node. For example, with each additional level, the number of garbled circuits stored in the node can be halved. For another example, the number of garbled circuits stored in the node = T / L, where T is the number of garbled circuits stored in the root node, which can be a preset number, and L is the level of the node. In this case, if T / L is not greater than 1, it can be determined that the node stores at least one garbled circuit.

[0214] For example, if the number of target garbled circuits is 4, the client can generate 4 groups of target garbled labels for each element in the preset base number, and convert the data to be stored according to the four groups of target garbled labels to obtain 4 groups of converted data to be stored, and send the 4 groups of target garbled labels and the converted data to be stored to the index server. After receiving the 4 groups of target garbled labels and the converted data to be stored, the index server generates 4 target garbled circuits according to the 4 target garbled labels, the converted data to be stored and the garbled circuit template, thereby storing the 4 target garbled circuits in the target node.

[0215] In the case where a node in the index server stores multiple garbled code circuits, the multiple garbled code circuits can be synchronously applied to data queries of multiple clients, which can improve the concurrency of data queries performed by the index server.

[0216] Corresponding to the above-mentioned data storage method applied to the client, an embodiment of the present application also provides a data storage method applied to the index server.

[0217] In one embodiment of the present application, see Fig. 9 , a flow chart of a third method for implementing a ciphertext index of an encrypted database is provided. In this embodiment, the above method is applied to an index server and includes the following steps S901-S906.

[0218] Step S901: Obtain the index ciphertext data of the storage index of the data to be stored in the storage server sent by the client.

[0219] Step S902: Create a target node in the target jump list, and store the index ciphertext data in the target node.

[0220] Step S903: Generate a target garbled sequence number corresponding to the target node, and feed back the target garbled sequence number to the client.

[0221] Step S904: obtaining the target garbled code tag sent by the client and the data to be stored represented by the target garbled code tag, wherein the target garbled code tag is a tag of each element in a preset base number generated by the client according to the target garbled code sequence number and a random index key.

[0222] Step S905: Generate a target garbled code circuit according to the target garbled code tag, the data to be stored represented by the target garbled code tag, and the garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code tag.

[0223] Step S906: Store the target garbled code circuit in the target node.

[0224] For the description of the above steps S901-S906, please refer to the above Figure 2 Steps S203-S209 in the illustrated embodiment are not described in detail here.

[0225] From the above, it can be seen that when applying the solution provided in the embodiment of the present application to store data, an index server is introduced to manage the storage index of the data in the storage server, and the target garbled circuit and index ciphertext data are stored in the index server. In this way, the client does not need to maintain a large amount of storage index for the data, which reduces the data burden of the client and improves the security of the data.

[0226] The specific method for determining the position of the target node mentioned in the above step S204 is described below.

[0227] In one embodiment of the present application, the index server may obtain an initial garbled label sent by the client.

[0228] The initial garbled label is a label obtained by the client by converting the garbled label in the head node of the target jump table and the data to be stored.

[0229] After obtaining the initial garbled label, the index server can use the head node of the target jump table as the initial first comparison node, the initial garbled label as the initial input garbled label, input the input garbled label into the garbled circuit contained in the first comparison node, and obtain the garbled circuit output result. According to the obtained output result, a new first comparison node is determined in the nodes pointed to by each pointer of the first comparison node, and the label corresponding to the obtained output result is used as a key to decrypt the label conversion ciphertext corresponding to the obtained output result to obtain the decrypted label conversion relationship, perform XOR logic processing on each label conversion relationship of the input garbled label to obtain the input garbled label of the new first comparison node, and return to the step of inputting the input garbled label into the garbled circuit contained in the first comparison node until the child node pointed to by the obtained output result is not determined in the nodes pointed to by each pointer of the first comparison node, and the position of the next node after the first comparison node is determined as the position of the node to be created.

[0230] Specifically, each node in the index server includes a node garbled circuit, a set of node garbled labels, and a node ciphertext data. The storage index after decryption of the node ciphertext data points to a data stored in the storage server, which is called node data. An input of the node garbled circuit is: node data represented by a node garbled label.

[0231] When the input garbled label is input into the garbled circuit included in the first comparison node, one input of the garbled circuit included in the first comparison node is: the node data represented by the node garbled label of the node, and the other input is: the data to be stored represented by the node garbled label of the node, so that the garbled circuit can compare the numerical relationship between the node data and the data to be stored, and the index server can obtain the output result of the garbled circuit.

[0232] The output result of the garbled code circuit represents the numerical relationship between the data to be stored and the data corresponding to the first comparison node. If the output result represents that the data to be stored is smaller than the data corresponding to the first comparison node, the node pointed to by the pointer of the next level of the first comparison node is determined as the new first comparison node. If the output result represents that the data to be stored is larger than the data corresponding to the first comparison node, the node pointed to by the pointer of the current level of the first comparison node is determined as the new first comparison node.

[0233] After determining the new first comparison node, the label conversion ciphertext corresponding to the obtained output result can be decrypted based on the label corresponding to the obtained output result as the key to obtain the decrypted label conversion relationship, and the input garbled label and the label conversion relationship are subjected to XOR logic processing to obtain the input garbled label of the new first comparison node.

[0234] For example, if the output result of the garbled circuit is "0", indicating that the node data is smaller than the data to be stored, the node pointed to by the pointer of the next level of the first comparison node can be determined as the new first comparison node, and the garbled label of "0" is used as the key to decrypt the label conversion ciphertext corresponding to "0" to obtain the decrypted label conversion relationship, and perform XOR logic processing on the input garbled label and the label conversion relationship to obtain the input garbled label of the new first comparison node.

[0235] In this way, after obtaining the new first comparison node and the input garbled label of the new first comparison node, the step of inputting the input garbled label into the garbled circuit contained in the first comparison node can be re-executed until the child node pointed to by the obtained output result is not determined in the nodes pointed to by the various pointers of the first comparison node, and the position of the next node after the first comparison node is determined as the position of the target node, thereby creating the target node at the determined position.

[0236] From the above, it can be seen that when the solution provided by the embodiment of the present application is used to store data, after the index server obtains the initial garbled label, it can use the initial garbled label as the initial value of the input garbled label and the head node as the initial first comparison node, and use a loop method to accurately determine the position of the target node, so that the index server adds a new target node at the determined node position, which can improve the accuracy of the index server managing the node, and then use the index server for data storage, which can improve the accuracy of data storage.

[0237] In one embodiment of the present application, see Fig.10 , a flowchart of a fourth method for implementing a ciphertext index of an encrypted database is provided. In this embodiment, the method further includes steps S907-S909.

[0238] Step S907: Feedback the first garbled label stored in the first node to the client, wherein the first node is a node subsequent to the target node and connected to the target node.

[0239] Step S908: obtaining a first label conversion ciphertext sent by the client and generated according to the target garbled label and the first garbled label.

[0240] Step S909: Store the obtained first label-converted ciphertext in the target node.

[0241] For the description of the above steps S907-S909, please refer to the above Figure 2 Steps S210 - S213 in the illustrated embodiment are not described in detail here.

[0242] As can be seen from the above, when the scheme provided by the embodiment of the present application is used to store data, the first garbled label is the garbled label stored in the first node, the target garbled label is the garbled label stored in the target node, and the first label conversion ciphertext is generated according to the target garbled label and the first garbled label. The first label conversion ciphertext can be understood as the ciphertext of the conversion relationship between the target garbled label and the first garbled label. In this way, the first label conversion ciphertext is stored in the target node, and when querying data, according to the first label conversion ciphertext, the data represented by the target garbled label can be accurately converted into the data converted by the first garbled label, so that the data represented by the first garbled label can be input into the garbled circuit in the first node, and the garbled circuit in the first node is used to continue the query until the query is completed. Therefore, the data storage scheme provided by the embodiment of the present application can improve the accuracy of data query.

[0243] In order to address the problem that the index server may perform data queries for multiple clients at the same time, in one embodiment of the present application, after adding a new target node, the index server can send the target level of the target node in each generated node to the client; and obtain the target garbled label of the target quantity group sent by the client.

[0244] When the index server generates a target garbled circuit, it can generate a target number of target garbled circuits according to a target number of target garbled tags, data to be stored represented by the target garbled tags, and a garbled circuit template, and store the target number of target garbled circuits in the target node.

[0245] The target number is a number determined by the client according to the target level and the preset number of garbled circuits included in the head node, and each target garbled label corresponds to a target garbled circuit.

[0246] For the description of this embodiment, please refer to the aforementioned embodiment, which will not be repeated here.

[0247] In the case where a node in the index server stores multiple garbled code circuits, the multiple garbled code circuits can be synchronously applied to data queries of multiple clients, which can improve the concurrency of data queries performed by the index server.

[0248] The aforementioned method for implementing a ciphertext index of an encrypted database is equivalent to a data storage method. Correspondingly, an embodiment of the present application also provides another method for implementing a ciphertext index of an encrypted database, which is equivalent to a data query method.

[0249] See also Fig.11 , shows the interaction process between various devices during the data query process, including the following steps S1101-S1108.

[0250] Step S1101: The client generates a second garbled tag according to the data to be queried and the stored query tags.

[0251] The query tag may be a garbled tag stored in the head node of the target jump table of the index server.

[0252] The client can perform XOR logic processing on the query data and the query tag to obtain a processing result as the second garbled tag.

[0253] Step S1102: the client sends a second garbled tag to the index server.

[0254] Among them, each node in the target jump table of the index server stores: a ciphertext data of a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: the data pointed to by the corresponding storage index represented by the node garbled label.

[0255] The node garbled label is generated based on the node garbled sequence number, the random index key, and the data pointed to by the storage index stored by the node.

[0256] The description of the index server can be found in the aforementioned embodiment and will not be repeated here.

[0257] Step S1103: the index server searches the target jump list for target ciphertext data stored in the second node that matches the data to be queried in the second garbled tag.

[0258] The specific query method of the index server querying the second node can refer to the method of determining the location of the target node mentioned in the above embodiment, which will not be repeated here.

[0259] After the index server queries the second node, it can obtain the ciphertext data stored in the second node as the target ciphertext data.

[0260] Step S1104: the index server feeds back the target ciphertext data to the client.

[0261] Step S1105: The client decrypts the target ciphertext data to obtain a target storage index, and sends a data acquisition request including the obtained target storage index to the storage server.

[0262] Step S1106: The storage server responds to the data acquisition request and searches the stored data for the second ciphertext data pointed to by the target storage index carried in the request.

[0263] Step S1107: The storage server feeds back the second ciphertext data to the client.

[0264] Step S1108: The client decrypts the second ciphertext data to obtain the data to be queried.

[0265] During the data storage process, after obtaining the data to be stored, the client can use encryption technology to encrypt the data to be stored to obtain the first ciphertext data. When the client obtains the second ciphertext data, it can use the decryption technology corresponding to the encryption technology used to decrypt the second ciphertext data and accurately obtain the decrypted data.

[0266] The data query method applied to the client is described below through a specific embodiment.

[0267] In one embodiment of the present application, see Fig.12 , a flow chart of a fifth method for implementing a ciphertext index of an encrypted database is provided. In this embodiment, the above method is applied to a client and includes the following steps S1201-S1206.

[0268] Step S1201: Generate a second garbled tag according to the data to be queried and the stored query tags.

[0269] Step S1202: Send the second garbled label to the index server, wherein each node in the target jump table of the index server stores: ciphertext data of a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by the node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key and the data pointed to by the storage index stored in the node.

[0270] Step S1203: Obtain target ciphertext data stored in the second node that is fed back by the storage server and matches the data to be queried in the second garbled tag.

[0271] Step S1204: Decrypt the target ciphertext data to obtain a target storage index.

[0272] Step S1205: Obtain the second ciphertext data pointed to by the target storage index in the storage server.

[0273] Step S1206: Decrypt the second ciphertext data to obtain the data to be queried.

[0274] For the description of the above steps S1201-S1206, please refer to the above steps S1101-S1108, which will not be repeated here.

[0275] As can be seen from the above, when the solution provided in the embodiment of the present application is used to query data, each node in the target jump table of the index server corresponds to a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data. The input of the garbled circuit is replaced by a garbled label. In this way, the actual value of the data will not be exposed when comparing the data, thereby improving the confidentiality and security of the data. Therefore, data query can be realized by using the index server containing the garbled circuit in the node, which can improve the confidentiality and security of the data query.

[0276] In order to ensure data security, after the garbled code circuit stored in the node in the index server is used, the garbled code circuit can be regenerated in the manner of generating the garbled code circuit as described above.

[0277] Corresponding to the data query method applied to the client, the embodiment of the present application also provides a data query method applied to the index server.

[0278] In one embodiment of the present application, see Fig.13, a flow chart of the sixth method for implementing the ciphertext index of an encrypted database is provided. In this embodiment, the above method is applied to an index server, wherein each node in the target jump table of the index server stores: ciphertext data of a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by a node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key and the data pointed to by the storage index stored in the node.

[0279] For the introduction of the index server, please refer to the aforementioned embodiment, which will not be repeated here.

[0280] The above method includes the following steps S1301-S1303.

[0281] Step S1301: obtaining a second garbled tag sent by the client and generated according to the data to be queried and the stored query tags.

[0282] Step S1302: Determine, among the nodes included in the target skip list, a second index node that matches the data to be queried in the second garbled label.

[0283] Step S1303: Feedback the target ciphertext data stored in the second node to the client, so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

[0284] For the description of the above steps S1301-S1303, please refer to the above steps S1101-S1108, which will not be repeated here.

[0285] As can be seen from the above, when the solution provided in the embodiment of the present application is used to query data, each node in the target jump table of the index server corresponds to a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data. The input of the garbled circuit is replaced by a garbled label. In this way, the actual value of the data will not be exposed when comparing the data, thereby improving the confidentiality and security of the data. Therefore, data query can be realized by using the index server containing the garbled circuit in the node, which can improve the confidentiality and security of the data query.

[0286] Corresponding to the aforementioned encrypted database ciphertext index implementation method, the embodiment of the present application also provides an encrypted database ciphertext index implementation system.

[0287] In one embodiment of the present application, see Fig.14, provides a structural diagram of an encrypted database ciphertext index implementation system. In this embodiment, the system includes a client 1401, an index server 1402, and a storage server 1403 for storing data;

[0288] The client 1401 is used to store the first ciphertext data of the storage data to the storage server 1403, obtain the storage index of the first ciphertext data in the storage server 1403, and send the index ciphertext data of the storage index to the index server 1402;

[0289] The index server 1402 is used to create a target node in a target jump list after receiving the index ciphertext data, store the index ciphertext data in the target node, generate a target garbled sequence number corresponding to the target node, and feedback the target garbled sequence number to the client 1401;

[0290] The client 1401 is further used to perform XOR logic processing on the target scrambled code sequence and the random index key to obtain a processing result as a random number seed, and generate a target scrambled code label for each element in the binary number according to the random number seed, convert the data to be stored according to the generated target scrambled code label to obtain the data to be stored represented by the target scrambled code label, and send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server 1402;

[0291] The index server 1402 is also used to generate a target garbled code circuit based on the target garbled code label, the data to be stored represented by the target garbled code label, and the garbled code circuit template, and store the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

[0292] The client 1401, index server 1402 and storage server 1403 perform data interaction to implement encrypted database ciphertext indexing, or the specific implementation of data storage and data query can be found in the aforementioned method embodiment, which will not be repeated here.

[0293] As can be seen from the above, when applying the solution provided in the embodiment of the present application for data storage, the client not only encrypts the data to be stored to obtain the first ciphertext data, and stores the first ciphertext data in the storage server, but also stores the index ciphertext data of the storage index of the first ciphertext data in the storage server in the node of the index server, and uses a garbled circuit to avoid revealing the size of the data to be stored during data query, which can improve the privacy and security of the data.

[0294] Corresponding to the aforementioned encrypted database ciphertext index implementation method, the embodiment of the present application also provides an encrypted database ciphertext index implementation device.

[0295] In one embodiment of the present application, see Fig.15 , a schematic diagram of the structure of a first encrypted database ciphertext index implementation device is provided. In this embodiment, the device is applied to a client and includes:

[0296] A storage index obtaining module 1501 is used to store first ciphertext data of data to be stored in a storage server, and obtain a storage index of the first ciphertext data in the storage server;

[0297] The index ciphertext data sending module 1502 is used to send the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list;

[0298] The target garbled code sequence number obtaining module 1503 is used to obtain the target garbled code sequence number corresponding to the target node and generated by the index server;

[0299] The target garbled code label generation module 1504 is used to perform XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generate a target garbled code label for each element in the binary number according to the random number seed;

[0300] The data conversion module 1505 is used to convert the data to be stored according to the generated target garbled code label to obtain the data to be stored represented by the target garbled code label;

[0301] The label and index sending module 1506 is used to send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server, so that the index server generates a target scrambled code circuit according to the target scrambled code label, the data to be stored represented by the target scrambled code label and the scrambled code circuit template, and stores the target scrambled code circuit in the target node, wherein one input data of the target scrambled code circuit is: the data to be stored represented by the target scrambled code label.

[0302] As can be seen from the above, when applying the solution provided in the embodiment of the present application for data storage, the client not only encrypts the data to be stored to obtain the first ciphertext data, and stores the first ciphertext data in the storage server, but also stores the index ciphertext data of the storage index of the first ciphertext data in the storage server in the node of the index server, and uses a garbled circuit to avoid revealing the size of the data to be stored during data query, which can improve the privacy and security of the data.

[0303] In one embodiment of the present application, the device further includes:

[0304] A first garbled label obtaining module, configured to obtain a first garbled label stored in the first node fed back by the index server, wherein the first node is a node after the target node and connected to the target node;

[0305] A ciphertext generation module, used to generate a first label conversion ciphertext according to the target garbled label and the first garbled label;

[0306] The ciphertext sending module is used to send the first label-converted ciphertext to the index server, so that the index server stores the first label-converted ciphertext in the target node.

[0307] As can be seen from the above, when the scheme provided by the embodiment of the present application is used to store data, the first garbled label is the garbled label stored in the first node, the target garbled label is the garbled label stored in the target node, and the first label conversion ciphertext is generated according to the target garbled label and the first garbled label. The first label conversion ciphertext can be understood as the ciphertext of the conversion relationship between the target garbled label and the first garbled label. In this way, the first label conversion ciphertext is stored in the target node, and when querying data, according to the first label conversion ciphertext, the data represented by the target garbled label can be accurately converted into the data converted by the first garbled label, so that the data represented by the first garbled label can be input into the garbled circuit in the first node, and the garbled circuit in the first node is used to continue the query until the query is completed. Therefore, the data storage scheme provided by the embodiment of the present application can improve the accuracy of data query.

[0308] In one embodiment of the present application, the target garbled code circuit includes a first sub-garbled code circuit and a second sub-garbled code circuit;

[0309] The first sub-garbled code circuit is used to compare the size relationship of two input data;

[0310] The second sub-garbled code circuit is used to determine whether two input data are equal.

[0311] In this scheme, two sub-scrambling circuits are used to respectively determine the size relationship and equality relationship of two input data. Each sub-scrambling circuit only needs to be designed for one relationship without taking into account the other relationship, thereby greatly reducing the design difficulty and circuit complexity of the scrambling circuit. By using a more streamlined scrambling circuit, the circuit output result can be obtained more quickly, thereby improving data storage efficiency.

[0312] In one embodiment of the present application, the first sub-garbled code circuit is obtained by connecting a plurality of first comparison circuits in series, and each first comparison circuit corresponds to a bit of the input data one by one;

[0313] The first comparison circuit is used to: perform XOR gate logic processing on the first reference value, the first comparison value and the second comparison value respectively, perform AND gate logic processing on the two processing results, and perform XOR gate logic processing on the result and the target value to be compared in the first comparison value to obtain the output result of the first comparison circuit, wherein the first reference value corresponding to the first first comparison circuit is the first preset value, and the first reference values ​​corresponding to other first comparison circuits are the output results of the previous first comparison circuit, the first comparison value is: the value of the bit corresponding to the first comparison circuit in the data to be stored represented by the target garbled code label, and the second comparison value is: the value of the bit corresponding to the first comparison circuit in another input data other than the input data corresponding to the first comparison value.

[0314] In this solution, the first sub-garbled code circuit is used to accurately compare the size relationship of two input data, so that the first sub-garbled code circuit is used as the target garbled code circuit, which can improve the accuracy of the target garbled code circuit and further improve the accuracy of data storage.

[0315] In one embodiment of the present application, the second sub-garbled code circuit is obtained by connecting a plurality of second comparison circuits in series, and each second comparison circuit corresponds to a bit of the input data one by one;

[0316] The second comparison circuit is used to: perform XOR gate logic processing on the values ​​of the bits corresponding to the second comparison circuit in the two input data, and perform OR gate logic processing on the obtained processing result and the second reference value to obtain the output result of the second comparison circuit, wherein the second reference value corresponding to the first second comparison circuit is the second preset value, and the second reference values ​​corresponding to the other second comparison circuits are the output results of the previous second comparison circuit.

[0317] In this solution, the second sub-garbled code circuit is used to accurately determine whether two input data are equal, so that the second sub-garbled code circuit is used as the target garbled code circuit, which can improve the accuracy of the target garbled code circuit and further improve the accuracy of data storage.

[0318] In one embodiment of the present application, the above device further includes:

[0319] A target level determination module, used to determine the target level of the target node among the nodes generated by the index server;

[0320] A circuit quantity determination module, used to determine the quantity of the target garbled code circuits according to the preset quantity of garbled code circuits included in the target level and the head node;

[0321] The target garbled label generation module is specifically used for:

[0322] Execute the step of performing XOR logic processing on the target scrambled code sequence number and the random index key for a determined number of times to obtain a determined number of random number seeds; generate a determined number of groups and target scrambled code labels for each element in the binary number according to the determined number of random number seeds;

[0323] The data conversion module is specifically used for:

[0324] For each group of target garbled labels, convert the data to be stored according to the group of target garbled labels to obtain the data to be stored represented by the group of target garbled labels;

[0325] The label and index sending module is specifically used for:

[0326] Send the generated determined number of groups of target garbled code labels and their corresponding converted data to be stored to the index server, so that the index server generates a determined number of target garbled code circuits according to the determined number of groups of target garbled code labels, the converted data to be stored and the garbled code circuit template, and stores the determined number of target garbled code circuits in the target node, wherein each target garbled code label corresponds to a target garbled code circuit.

[0327] In this solution, when a node in the index server stores multiple garbled code circuits, the multiple garbled code circuits can be synchronously applied to data queries of multiple clients, which can improve the concurrency of data queries performed by the index server.

[0328] In one embodiment of the present application, see Fig.16 , a schematic diagram of the structure of a second encrypted database ciphertext index implementation device is provided. In this embodiment, the device is applied to an index server, including:

[0329] The first ciphertext data obtaining module 1601 is used to obtain the index ciphertext data of the storage index of the data to be stored in the storage server sent by the client;

[0330] A target node creation module 1602 is used to create a target node in a target jump list and store the index ciphertext data in the target node;

[0331] The target garbled code sequence number generating module 1603 is used to generate a target garbled code sequence number corresponding to the target node, and feed back the target garbled code sequence number to the client;

[0332] The label and data acquisition module 1604 is used to obtain the target garbled code label sent by the client and the data to be stored represented by the target garbled code label, wherein the target garbled code label is a label of each element in the binary number generated by the client according to the target garbled code sequence number and the random index key;

[0333] The target garbled code circuit generating module 1605 is used to generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and the garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label;

[0334] The data storage module 1606 is used to store the target garbled code circuit in the target node.

[0335] From the above, it can be seen that when applying the solution provided in the embodiment of the present application to store data, an index server is introduced to manage the storage index of the data in the storage server, and the target garbled circuit and index ciphertext data are stored in the index server. In this way, the client does not need to maintain a large amount of storage index for the data, which reduces the data burden of the client and improves the security of the data.

[0336] In one embodiment of the present application, the device further includes:

[0337] A first garbled label sending module, configured to feed back to the client a first garbled label stored in a first node, wherein the first node is a node after the target node and connected to the target node;

[0338] A ciphertext obtaining module, used for obtaining a first label conversion ciphertext sent by the client and generated according to the target garbled label and the first garbled label;

[0339] The ciphertext storage module is used to store the obtained first label-converted ciphertext in the target node.

[0340] As can be seen from the above, when the scheme provided by the embodiment of the present application is used to store data, the first garbled label is the garbled label stored in the first node, the target garbled label is the garbled label stored in the target node, and the first label conversion ciphertext is generated according to the target garbled label and the first garbled label. The first label conversion ciphertext can be understood as the ciphertext of the conversion relationship between the target garbled label and the first garbled label. In this way, the first label conversion ciphertext is stored in the target node, and when querying data, according to the first label conversion ciphertext, the data represented by the target garbled label can be accurately converted into the data converted by the first garbled label, so that the data represented by the first garbled label can be input into the garbled circuit in the first node, and the garbled circuit in the first node is used to continue the query until the query is completed. Therefore, the data storage scheme provided by the embodiment of the present application can improve the accuracy of data query.

[0341] In one embodiment of the present application, the target node creation module is specifically used to:

[0342] Obtaining an initial garbled label sent by the client, wherein the initial garbled label is a label obtained by converting the data to be stored according to the garbled label in the head node of the target jump table;

[0343] Input the input garbled label into the garbled circuit included in the first comparison node to obtain the output result of the garbled circuit; determine a new first comparison node in the nodes pointed to by each pointer of the first comparison node according to the obtained output result; decrypt the label conversion ciphertext corresponding to the obtained output result according to the label corresponding to the obtained output result as a key to obtain a decrypted label conversion relationship; perform XOR logic processing on the input garbled label and the label conversion relationship to obtain the input garbled label of the new first comparison node; and return to the step of inputting the input garbled label into the garbled circuit included in the first comparison node until the child node pointed to by the obtained output result is not determined in the nodes pointed to by each pointer of the first comparison node, and determine the position of the next node of the first comparison node as the position of the target node, wherein the initial value of the input garbled label is the initial garbled label, and the initial node of the first comparison node is the head node; create the target node at the determined position.

[0344] From the above, it can be seen that when the solution provided by the embodiment of the present application is used to store data, after the index server obtains the initial garbled label, it can use the initial garbled label as the initial value of the input garbled label and the head node as the initial first comparison node, and use a loop method to accurately determine the position of the target node, so that the index server adds a new target node at the determined node position, which can improve the accuracy of the index server managing the node, and then use the index server for data storage, which can improve the accuracy of data storage.

[0345] In one embodiment of the present application, the device further includes:

[0346] A target level sending module, used for sending the target level of the target node in each generated node to the client;

[0347] The label and data acquisition module is specifically used for:

[0348] Obtaining a target quantity group target garbled code label sent by the client, wherein the target quantity is a quantity determined by the client according to the target level and a preset quantity of garbled code circuits included in the head node;

[0349] The target garbled code circuit generation module is specifically used for:

[0350] The target number of target garbled code circuits are generated according to the target number of target garbled code tags, the data to be stored represented by the target garbled code tags, and a garbled code circuit template, wherein each target garbled code tag corresponds to a target garbled code circuit.

[0351] In this solution, when a node in the index server stores multiple garbled code circuits, the multiple garbled code circuits can be synchronously applied to data queries of multiple clients, which can improve the concurrency of data queries performed by the index server.

[0352] In one embodiment of the present application, see Fig.17 , a schematic diagram of the structure of a third encrypted database ciphertext index implementation device is provided. In this embodiment, the device is applied to a client and includes:

[0353] The second garbled label generation module 1701 is used to generate a second garbled label according to the to-be-queried data and the stored query label;

[0354] The second garbled code label sending module 1702 is used to send the second garbled code label to the index server, wherein each node in the target jump table of the index server stores: a ciphertext data of a storage index in the storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: the data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, the random index key and the data pointed to by the storage index stored in the node;

[0355] The target ciphertext data obtaining module 1703 is used to obtain the target ciphertext data stored in the second node that matches the data to be queried in the second garbled tag and is fed back by the index server;

[0356] The ciphertext decryption module 1704 is used to decrypt the target ciphertext data to obtain a target storage index;

[0357] The second ciphertext data obtaining module 1705 is used to obtain the second ciphertext data pointed to by the target storage index in the storage server;

[0358] The data decryption module 1706 is used to decrypt the second ciphertext data to obtain the data to be queried.

[0359] As can be seen from the above, when the solution provided in the embodiment of the present application is used to query data, each node in the target jump table of the index server corresponds to a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data. The input of the garbled circuit is replaced by a garbled label. In this way, the actual value of the data will not be exposed when comparing the data, thereby improving the confidentiality and security of the data. Therefore, data query can be realized by using the index server containing the garbled circuit in the node, which can improve the confidentiality and security of the data query.

[0360] In one embodiment of the present application, see Fig.18 , a structural schematic diagram of a fourth encrypted database ciphertext index implementation device is provided. In this embodiment, the device uses an index server, and each node in the target jump table of the index server corresponds to: a ciphertext data storing a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by the node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key and the data pointed to by the storage index stored in the node;

[0361] The device comprises:

[0362] The second garbled label obtaining module 1801 is used to obtain the second garbled label sent by the client and generated according to the to-be-queried data and the stored query label;

[0363] A node matching module 1802 is used to determine, among the nodes included in the target jump list, a second node that matches the data to be queried in the second garbled label;

[0364] The storage index feedback module 1803 is used to feedback the target ciphertext data stored in the second node to the client, so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

[0365] As can be seen from the above, when the solution provided in the embodiment of the present application is used to query data, each node in the target jump table of the index server corresponds to a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data. The input of the garbled circuit is replaced by a garbled label. In this way, the actual value of the data will not be exposed when comparing the data, thereby improving the confidentiality and security of the data. Therefore, data query can be realized by using the index server containing the garbled circuit in the node, which can improve the confidentiality and security of the data query.

[0366] The present application also provides an electronic device, such as Fig.19 As shown, including:

[0367] Memory 1901, used for storing computer programs;

[0368] The processor 1902 is used to implement the following steps when executing the program stored in the memory 1901:

[0369] storing first ciphertext data of the data to be stored in a storage server, and obtaining a storage index of the first ciphertext data in the storage server;

[0370] Sending the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list;

[0371] Obtaining a target garbled sequence number corresponding to the target node, generated by the index server;

[0372] Performing XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generating a target garbled code label for each element in the binary number according to the random number seed;

[0373] According to the generated target garbled code label, the data to be stored is converted to obtain the data to be stored represented by the target garbled code label;

[0374] The generated target garbled code label and the data to be stored represented by the target garbled code label are sent to the index server, so that the index server generates a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label and a garbled code circuit template, and stores the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

[0375] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1902, the communication interface, and the memory 1901 communicate with each other via the communication bus.

[0376] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0377] The communication interface is used for communication between the above electronic device and other devices.

[0378] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0379] The above-mentioned processor 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, discrete hardware components.

[0380] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned encrypted database ciphertext index implementation methods are implemented.

[0381] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the encrypted database ciphertext indexing implementation methods in the above embodiments.

[0382] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.

[0383] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0384] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, system, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0385] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for implementing a ciphertext index of an encrypted database, characterized in that: Applied to a client, the method comprises: storing first ciphertext data of the data to be stored in a storage server, and obtaining a storage index of the first ciphertext data in the storage server; Sending the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list; Obtaining a target garbled sequence number corresponding to the target node, generated by the index server; Performing XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generating a target garbled code label for each element in the binary number according to the random number seed; According to the generated target garbled code label, the data to be stored is converted to obtain the data to be stored represented by the target garbled code label; The generated target garbled code label and the data to be stored represented by the target garbled code label are sent to the index server, so that the index server generates a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label and a garbled code circuit template, and stores the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining a first garbled label stored in a first node fed back by the index server, wherein the first node is a node subsequent to the target node and connected to the target node; Generate a first label conversion ciphertext according to the target garbled label and the first garbled label; The first label-converted ciphertext is sent to the index server, so that the index server stores the first label-converted ciphertext in the target node.

3. The method according to claim 1, characterized in that The target garbled code circuit includes a first sub-garbled code circuit and a second sub-garbled code circuit; The first sub-garbled code circuit is used to compare the size relationship of two input data; The second sub-garbled code circuit is used to determine whether two input data are equal.

4. The method according to claim 3, characterized in that The first sub-garbled code circuit is obtained by connecting a plurality of first comparison circuits in series, and each first comparison circuit corresponds to a bit of the input data one by one; The first comparison circuit is used to: perform XOR gate logic processing on the first reference value, the first comparison value and the second comparison value respectively, perform AND gate logic processing on the two processing results, and perform XOR gate logic processing on the result and the target value to be compared in the first comparison value to obtain the output result of the first comparison circuit, wherein the first reference value corresponding to the first first comparison circuit is the first preset value, and the first reference values ​​corresponding to other first comparison circuits are the output results of the previous first comparison circuit, the first comparison value is: the value of the bit corresponding to the first comparison circuit in the data to be stored represented by the target garbled code label, and the second comparison value is: the value of the bit corresponding to the first comparison circuit in another input data other than the input data corresponding to the first comparison value.

5. The method according to claim 3, characterized in that: The second sub-garbled code circuit is obtained by connecting a plurality of second comparison circuits in series, and each second comparison circuit corresponds to a bit of the input data one by one; The second comparison circuit is used to: perform XOR gate logic processing on the values ​​of the bits corresponding to the second comparison circuit in the two input data, and perform OR gate logic processing on the obtained processing result and the second reference value to obtain the output result of the second comparison circuit, wherein the second reference value corresponding to the first second comparison circuit is the second preset value, and the second reference values ​​corresponding to the other second comparison circuits are the output results of the previous second comparison circuit.

6. The method according to any one of claims 1 to 5, characterized in that Also includes: Determine a target level of the target node among the nodes generated by the index server; Determining the number of the target garbled code circuits according to the target level and the preset number of garbled code circuits included in the head node; The XOR logic processing is performed on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, including: Execute the step of performing XOR logic processing on the target garbled code sequence number and the random index key a determined number of times to obtain a determined number of random number seeds; The step of generating a target garbled label for each element in a binary number according to the random number seed and the data to be stored comprises: Generate a target garbled label for each element in a determined number of groups and binary numbers according to a determined number of random number seeds; The step of converting the data to be stored according to the generated target garbled code label to obtain the data to be stored represented by the target garbled code label includes: For each group of target garbled labels, convert the data to be stored according to the group of target garbled labels to obtain the data to be stored represented by the group of target garbled labels; The step of sending the generated target garbled code tag and the data to be stored represented by the target garbled code tag to the index server, so that the index server generates a target garbled code circuit according to the target garbled code tag, the data to be stored represented by the target garbled code tag, and a garbled code circuit template, and stores the target garbled code circuit in the target node, includes: Send the generated determined number of groups of target garbled code labels and their corresponding converted data to be stored to the index server, so that the index server generates a determined number of target garbled code circuits according to the determined number of groups of target garbled code labels, the converted data to be stored and the garbled code circuit template, and stores the determined number of target garbled code circuits in the target node, wherein each target garbled code label corresponds to a target garbled code circuit.

7. A method for implementing a ciphertext index of an encrypted database, characterized in that: Applied to an index server, the method comprises: Obtaining index ciphertext data of the storage index of the data to be stored in the storage server sent by the client; Creating a target node in a target jump list, and storing the index ciphertext data in the target node; Generate a target garbled sequence number corresponding to the target node, and feed back the target garbled sequence number to the client; Obtaining the target garbled code tag sent by the client and the data to be stored represented by the target garbled code tag, wherein the target garbled code tag is a tag of each element in a binary number generated by the client according to the target garbled code sequence number and a random index key; Generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label; The target garbled code circuit is stored in the target node.

8. The method according to claim 7, characterized in that The method further comprises: Feedback to the client a first garbled label stored in a first node, wherein the first node is a node after the target node and connected to the target node; Obtaining a first label conversion ciphertext sent by the client and generated according to the target garbled label and the first garbled label; The obtained first label conversion ciphertext is stored in the target node.

9. The method according to claim 7 or 8, characterized in that: The step of creating a target node in a target jump table includes: Obtaining an initial garbled label sent by the client, wherein the initial garbled label is a label obtained by converting the data to be stored according to the garbled label in the head node of the target jump table; Input the input garbled label into the garbled circuit included in the first comparison node to obtain the output result of the garbled circuit, determine a new first comparison node in the nodes pointed to by each pointer of the first comparison node according to the obtained output result, decrypt the label conversion ciphertext corresponding to the obtained output result according to the label corresponding to the obtained output result as a key, obtain the decrypted label conversion relationship, perform XOR logic processing on the input garbled label and the label conversion relationship to obtain the input garbled label of the new first comparison node, and return to the step of inputting the input garbled label into the garbled circuit included in the first comparison node until the child node pointed to by the obtained output result is not determined in the nodes pointed to by each pointer of the first comparison node, and determine the position of the next node of the first comparison node as the position of the target node, wherein the initial value of the input garbled label is the initial garbled label, and the initial node of the first comparison node is the head node; Creates a target node at the determined position.

10. The method according to claim 7 or 8, characterized in that: The method further comprises: Sending the target level of the target node in each generated node to the client; The obtaining of the target garbled label sent by the client comprises: Obtaining a target quantity group target garbled code label sent by the client, wherein the target quantity is a quantity determined by the client according to the target level and a preset quantity of garbled code circuits included in the head node; The step of generating a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template comprises: The target number of target garbled code circuits are generated according to the target number of target garbled code tags, the data to be stored represented by the target garbled code tags, and a garbled code circuit template, wherein each target garbled code tag corresponds to a target garbled code circuit.

11. A method for implementing a ciphertext index of an encrypted database, characterized in that: Applied to a client, the method comprises: Generate a second garbled tag according to the data to be queried and the stored query tag; Sending the second garbled label to the index server, wherein each node in the target jump table of the index server stores: ciphertext data of a storage index in the storage server and a node garbled circuit for comparing the numerical relationship between two input data, and one input data of the node garbled circuit is: data pointed to by the corresponding storage index represented by the node garbled label, and the node garbled label is generated according to the node garbled sequence number, the random index key and the data pointed to by the storage index stored in the node; Obtaining target ciphertext data stored in a second node that is fed back by the index server and matches the data to be queried in the second garbled tag; Decrypting the target ciphertext data to obtain a target storage index; Obtaining second ciphertext data pointed to by the target storage index in the storage server; The second ciphertext data is decrypted to obtain the data to be queried.

12. A method for implementing a ciphertext index of an encrypted database, characterized in that: Applied to an index server, each node in the target jump table of the index server stores: a ciphertext data of a storage index in the storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, the random index key and the data pointed to by the storage index stored in the node; The method comprises: Obtaining a second garbled tag sent by the client and generated according to the data to be queried and the stored query tag; Determine, among the nodes included in the target jump table, a second node that matches the data to be queried in the second garbled label; The target ciphertext data stored in the second node is fed back to the client so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

13. A device for implementing encrypted database ciphertext index, characterized in that: Applied to a client, the device comprises: A storage index obtaining module, used to store first ciphertext data of data to be stored in a storage server, and obtain a storage index of the first ciphertext data in the storage server; An index ciphertext data sending module, used for sending the index ciphertext data of the storage index to the index server, so that the index server stores the index ciphertext data in the target node after creating the target node in the target jump list; A target garbled code sequence number obtaining module, used to obtain a target garbled code sequence number corresponding to the target node, generated by the index server; A target garbled code label generation module is used to perform XOR logic processing on the target garbled code sequence number and the random index key to obtain a processing result as a random number seed, and generate a target garbled code label for each element in the binary number according to the random number seed; A data conversion module, used for converting the data to be stored according to the generated target garbled code label to obtain the data to be stored represented by the target garbled code label; A label and index sending module is used to send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server, so that the index server generates a target scrambled code circuit according to the target scrambled code label, the data to be stored represented by the target scrambled code label and the scrambled code circuit template, and stores the target scrambled code circuit in the target node, wherein one input data of the target scrambled code circuit is: the data to be stored represented by the target scrambled code label.

14. The device according to claim 13, characterized in that The device further includes: a first garbled label obtaining module, used to obtain a first garbled label stored in a first node fed back by the index server, wherein the first node is a node after the target node and connected to the target node; a ciphertext generating module, used to generate a first label conversion ciphertext according to the target garbled label and the first garbled label; a ciphertext sending module, used to send the first label conversion ciphertext to the index server, so that the index server stores the first label conversion ciphertext in the target node; and / or The target garbled code circuit comprises a first sub-garbled code circuit and a second sub-garbled code circuit; the first sub-garbled code circuit is used to compare the size relationship of two input data; the second sub-garbled code circuit is used to determine whether the two input data are equal; and / or The first sub-garbled code circuit is obtained by connecting a plurality of first comparison circuits in series, and each first comparison circuit corresponds to a bit of the input data one by one; the first comparison circuit is used to: perform XOR gate logic processing on the first reference value, the first comparison value and the second comparison value respectively, perform AND gate logic processing on the two obtained processing results, perform XOR gate logic processing on the obtained result and the target value to be compared in the first comparison value, and obtain the output result of the first comparison circuit, wherein the first reference value corresponding to the first first comparison circuit is the first preset value, and the first reference values ​​corresponding to the other first comparison circuits are the output results of the previous first comparison circuit, the first comparison value is: in the data to be stored represented by the target garbled code tag, the value of the bit corresponding to the first comparison circuit, and the second comparison value is: in another input data other than the input data corresponding to the first comparison value, the value of the bit corresponding to the first comparison circuit; and / or The second sub-garbled code circuit is obtained by connecting a plurality of second comparison circuits in series, and each second comparison circuit corresponds to a bit of the input data one by one; the second comparison circuit is used to: perform XOR gate logic processing on the value of the bit corresponding to the second comparison circuit in the two input data, and perform OR gate logic processing on the obtained processing result and the second reference value to obtain the output result of the second comparison circuit, wherein the second reference value corresponding to the first second comparison circuit is the second preset value, and the second reference values ​​corresponding to the other second comparison circuits are the output results of the previous second comparison circuit; and / or The device also includes: a target level determination module, which is used to determine the target level of the target node in each node generated by the index server; a circuit quantity determination module, which is used to determine the number of target garbled code circuits according to the preset number of garbled code circuits contained in the target level and the head node; the target garbled code label generation module, which is specifically used to: execute the step of performing XOR logic processing on the target garbled code sequence number and the random index key for a determined number of times to obtain a determined number of random number seeds; generate a determined number of groups, target garbled code labels for each element in the binary number according to the determined number of random number seeds; the data conversion module is specifically used to : For each group of target garbled labels, the data to be stored is converted according to the group of target garbled labels to obtain the data to be stored represented by the group of target garbled labels; the label and index sending module is specifically used to: send the generated determined number of groups of target garbled labels and their corresponding converted data to be stored to the index server, so that the index server generates a determined number of target garbled circuits according to the determined number of groups of target garbled labels, the converted data to be stored and the garbled circuit template, and stores the determined number of target garbled circuits in the target node, wherein each target garbled label corresponds to a target garbled circuit.

15. A device for implementing encrypted database ciphertext index, characterized in that: Applied to an index server, the device comprises: A first ciphertext data obtaining module is used to obtain index ciphertext data of a storage index of data to be stored in a storage server sent by a client; A target node creation module, used to create a target node in a target jump list and store the index ciphertext data in the target node; A target garbled code sequence number generating module is used to generate a target garbled code sequence number corresponding to the target node, and feed back the target garbled code sequence number to the client; A label and data acquisition module, used to obtain the target garbled code label sent by the client and the data to be stored represented by the target garbled code label, wherein the target garbled code label is a label of each element in a binary number generated by the client according to the target garbled code sequence number and a random index key; A target garbled code circuit generation module is used to generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label; A data storage module is used to store the target garbled code circuit in the target node.

16. The device according to claim 15, characterized in that The device further includes: a first garbled label sending module, used to feed back to the client a first garbled label stored in a first node, wherein the first node is a node after the target node and connected to the target node; a ciphertext obtaining module, used to obtain a first label conversion ciphertext sent by the client and generated according to the target garbled label and the first garbled label; a ciphertext storage module, used to store the obtained first label conversion ciphertext in the target node; and / or The target node creation module is specifically used to: obtain an initial garbled label sent by the client, wherein the initial garbled label is a label obtained by converting the data to be stored according to the garbled label in the head node of the target jump table; input the input garbled label into the garbled circuit included in the first comparison node to obtain the garbled circuit output result, and according to the obtained output result, determine a new first comparison node in the nodes pointed to by each pointer of the first comparison node, and use the label corresponding to the obtained output result as a key to decrypt the label conversion ciphertext corresponding to the obtained output result to obtain the decrypted label conversion relationship, performing XOR logic processing on the input garbled code label and the label conversion relationship to obtain the input garbled code label of the new first comparison node, and returning to the step of inputting the input garbled code label into the garbled code circuit contained in the first comparison node, until the child node pointed to by the obtained output result is not determined in the nodes pointed to by the various pointers of the first comparison node, and determining the position of the next node of the first comparison node as the position of the target node, wherein the initial value of the input garbled code label is the initial garbled code label, and the initial node of the first comparison node is the head node; creating the target node at the determined position; and / or The device also includes: a target level sending module, used to send the target level of the target node in each generated node to the client; the label and data acquisition module, specifically used to: obtain the target quantity group target garbled code label sent by the client, wherein the target quantity is the quantity determined by the client according to the target level and the preset number of garbled code circuits included in the head node; the target garbled code circuit generation module, specifically used to: generate the target number of target garbled code circuits according to the target number of target garbled code labels, the data to be stored represented by the target garbled code label and the garbled code circuit template, and each target garbled code label corresponds to a target garbled code circuit.

17. A device for implementing a ciphertext index of an encrypted database, characterized in that: Applied to a client, the device comprises: A second garbled label generation module, used to generate a second garbled label according to the data to be queried and the stored query label; A second garbled code label sending module is used to send the second garbled code label to the index server, wherein each node in the target jump table of the index server stores: a ciphertext data of a storage index in the storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, the random index key and the data pointed to by the storage index stored in the node; A target ciphertext data obtaining module, used to obtain the target ciphertext data stored in the second node that matches the data to be queried in the second garbled tag and is fed back by the index server; A ciphertext decryption module, used to decrypt the target ciphertext data to obtain a target storage index; A second ciphertext data obtaining module, used to obtain the second ciphertext data pointed to by the target storage index in the storage server; The data decryption module is used to decrypt the second ciphertext data to obtain the data to be queried.

18. A device for implementing a ciphertext index of an encrypted database, characterized in that: Applied to an index server, each node in the target jump table of the index server corresponds to: a ciphertext data of a storage index in the storage server and a node garbled code circuit for comparing the numerical relationship between two input data, and one input data of the node garbled code circuit is: data pointed to by the corresponding storage index represented by the node garbled code label, and the node garbled code label is generated according to the node garbled code sequence number, the random index key and the data pointed to by the storage index stored in the node; The device comprises: A second garbled label obtaining module, used to obtain a second garbled label sent by the client and generated according to the to-be-queried data and the stored query label; A node matching module, used to determine, among the nodes included in the target jump table, a second node matching the data to be queried in the second garbled label; A storage index feedback module is used to feed back the target ciphertext data stored in the second node to the client, so that the client decrypts the target ciphertext data, obtains the target storage index, obtains the second ciphertext data pointed to by the target storage index in the storage server, and decrypts the second ciphertext data to obtain the data to be queried.

19. A system for implementing encrypted database ciphertext index, characterized in that: The system includes a client, an index server, and a storage server for storing data; The client is used to store first ciphertext data of the data to be stored in the storage server, obtain the storage index of the first ciphertext data in the storage server, and send the index ciphertext data of the storage index to the index server; The index server is used to create a target node in a target jump list after receiving the index ciphertext data, store the index ciphertext data in the target node, generate a target garbled sequence number corresponding to the target node, and feed back the target garbled sequence number to the client; The client is further used to perform XOR logic processing on the target scrambled code sequence and the random index key to obtain a processing result as a random number seed, and generate a target scrambled code label for each element in the binary number according to the random number seed, convert the data to be stored according to the generated target scrambled code label to obtain the data to be stored represented by the target scrambled code label, and send the generated target scrambled code label and the data to be stored represented by the target scrambled code label to the index server; The index server is further used to generate a target garbled code circuit according to the target garbled code label, the data to be stored represented by the target garbled code label, and a garbled code circuit template, and store the target garbled code circuit in the target node, wherein one input data of the target garbled code circuit is: the data to be stored represented by the target garbled code label.

20. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, when used to execute a program stored in a memory, implements the method described in any one of claims 1 to 6, or implements the method described in any one of claims 7 to 10, or implements the method described in claim 11, or implements the method described in claim 12.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method described in any one of claims 1 to 6, or the method described in any one of claims 7 to 10, or the method described in claim 11, or the method described in claim 12.