Database system and database processing method

By using ORE ciphertext as index item in a fully encrypted database, the problem of index performance is solved, and an efficient index search process is realized to maintain data security and performance improvement.

CN115905210BActive Publication Date: 2025-08-26ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210516107.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-12
Publication Date
2025-08-26
Estimated Expiration
2042-05-12

AI Technical Summary

Technical Problem

In a fully encrypted database, ciphertext data processing based on a trusted execution environment leads to a degradation of index performance and cannot effectively improve index search efficiency.

Method used

Using ORE ciphertext as the index item, the ORE ciphertext index item is formed by generating an encryption key in a trusted execution environment and constructing an ORE ciphertext index item to form an index data structure, which realizes encryption comparison without decryption and maintains the integrity of the index data structure.

Benefits of technology

Improve index search performance, reduce modification costs, avoid additional information leakage, and performance is close to plaintext index search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905210B_ABST
    Figure CN115905210B_ABST
Patent Text Reader

Abstract

Disclosed are a database system and a database processing method. The system includes: a key generation server for generating different encryption keys for different indexes in a trusted execution environment; an index encryption server for encrypting the index items of each index using the corresponding encryption keys in the trusted execution environment to obtain the ordered visible encryption (ORE) ciphertext index items of each index; an index data structure construction server for generating an index data structure using the ORE ciphertext index items of each index outside the trusted execution environment; and an index database for storing the generated index data structure. By using ORE ciphertext as an index item, index construction and subsequent index search can achieve encrypted comparison of index items without entering TEE and without decrypting data, thereby being able to quickly locate and search entries with performance close to that of a plaintext index. In addition, the original index data structure of the system can be used, reducing the cost of transforming the fully encrypted database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of databases, and in particular to a database system and a database processing method. Background Art

[0002] A fully encrypted database encrypts data throughout the entire chain (from the client to the database instance, including network, memory, and storage), and is designed to eliminate the risk of data leakage at any time during database operation, eliminating the possibility of the platform and operation and maintenance personnel accessing plaintext data, and ensuring that users have full ownership of their data in the cloud.

[0003] Index lookup is a fundamental database function. While encrypted data processing based on a Trusted Execution Environment (TEE) meets the privacy protection needs of users when using cloud platforms, a large number of comparison operations in the index require calling the TEE and decrypting the data. Limited TEE resources make it difficult to store the entire index data structure within the TEE to reduce the number of calls and decryption times, significantly reducing indexing performance.

[0004] To this end, a solution is needed that can improve indexing efficiency while ensuring data security. Summary of the Invention

[0005] One technical problem addressed by this disclosure is to provide a database processing solution that uses ORE ciphertext as index items. This allows index lookups to perform encrypted comparisons within the index data structure without entering the TEE and decrypting the data. This allows for rapid location of search entries with performance close to that of a plaintext index. Furthermore, because this solution only involves encrypting index items, the existing index data structure of the database system can be used, significantly reducing the cost of retrofitting a fully encrypted database.

[0006] According to a first aspect of the present disclosure, a database system is provided, comprising: a key generation server for generating different encryption keys for different indexes within a trusted execution environment; an index encryption server for encrypting index items of respective indexes using corresponding encryption keys within the trusted execution environment to obtain ORE ciphertext index items of respective indexes; an index data structure construction server for generating index data structures of respective indexes using ORE (sequentially visible encryption) ciphertext index items of respective indexes outside the trusted execution environment; and an index database for storing the generated index data structures of respective indexes.

[0007] Optionally, the database system further includes: a query server, configured to compare the ORE ciphertext of a query condition for a specific index with an ORE ciphertext index item in an index data structure of the specific index outside the trusted execution environment, and return a search result based on the comparison result, wherein the ORE ciphertext of the query condition is obtained by encrypting the query condition by ORE using an encryption key of the specific index within the trusted execution environment or on the client.

[0008] According to a second aspect of the present disclosure, a database processing method is provided, comprising: generating an encryption key for encrypting a current index within a trusted execution environment; encrypting index items of the current index using the encryption key within the trusted execution environment to obtain sequentially visible encrypted ORE ciphertext index items of the current index; and generating an index data structure of the current index using the ORE ciphertext index items outside the trusted execution environment.

[0009] Optionally, using the ORE ciphertext to generate the index data structure of the current index includes: constructing the index data structure of the current index according to the comparison result of the ORE ciphertext index items based on the same construction rule as that of plaintext construction.

[0010] Optionally, when the current index includes an index item pointing to a ciphertext data barcode, the ORE ciphertext index item is a key, and the actual ciphertext data corresponding to the ORE ciphertext index item is a value.

[0011] Optionally, the method further includes: encrypting the newly added index item using the current index encryption key to obtain the ORE ciphertext of the newly added index item; and updating the index data structure of the current index using the ORE ciphertext of the newly added index item as the newly added ORE ciphertext index item to obtain an updated index data structure.

[0012] Optionally, the method further includes: obtaining an encryption key for the current index; encrypting the query condition using the encryption key to obtain an ORE ciphertext of the query condition; comparing the ORE ciphertext of the query condition with an ORE ciphertext index item in an index data structure of the current index based on an ORE comparison algorithm without entering a trusted execution environment, wherein the ORE ciphertext index item is obtained by encrypting the index item of the current index using the encryption key; and returning a search result based on the comparison result.

[0013] Optionally, returning the search result based on the comparison result includes at least one of the following: when the ORE ciphertext index item as the comparison result points to a corresponding ciphertext entry, returning the corresponding ciphertext entry data; and when the ORE ciphertext index item as the comparison result points to multiple ciphertext entries, entering the trusted execution environment for subsequent comparison, and returning the ciphertext entry data that meets the query conditions.

[0014] According to a third aspect of the present disclosure, a data query method is provided, comprising: obtaining a current index encryption key of a current index from a trusted execution environment of a server; encrypting a query condition using the current index encryption key within the trusted execution environment of the server or within a client to obtain an ORE ciphertext of the query condition; and obtaining a search result returned by the server outside the trusted execution environment by comparing the ORE ciphertext of the query condition with an ORE ciphertext index item in an index data structure of the current index based on an ORE comparison algorithm.

[0015] According to a fourth aspect of the present disclosure, a computing device is provided, comprising: a processor; and a memory on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method described in the second and / or third aspects above.

[0016] According to a fifth aspect of the present disclosure, a non-transitory machine-readable storage medium is provided, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the method described in the second and / or third aspects above.

[0017] Therefore, the present invention encrypts index items through ORE and constructs an index data structure based on sequential indexes. This allows the index items and query conditions to be directly compared in encrypted form, thereby locating the desired content. Because index searches are performed with both the index items and query conditions encrypted, the need to enter the TEE for decryption and comparison is eliminated, significantly improving the overall performance of fully encrypted databases. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings, wherein like reference numerals generally represent like components in the exemplary embodiments of the present disclosure.

[0019] Figure 1A -B shows an example of a tree index data structure.

[0020] Figure 2 A schematic diagram showing the composition of a database system according to an embodiment of the present invention is shown.

[0021] Figure 3 A schematic flow chart of a database processing method according to an embodiment of the present invention is shown.

[0022] Figure 4 A schematic flow chart of the index query sub-step in the database processing method according to an embodiment of the present invention is shown.

[0023] Figure 5 A schematic flow chart of a database processing method according to an embodiment of the present invention is shown.

[0024] Figure 6 A schematic structural diagram of a computing device that can be used to implement the above database processing method according to an embodiment of the present invention is shown.

[0025] Figure 7 An example of performing index query on the sequential index obtained from the ORE ciphertext is shown. DETAILED DESCRIPTION

[0026] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0027] In order to quickly search through the massive records in a relational database, you need to use an index. An index is a data structure that pre-sorts the values ​​of one or more columns in a relational database. By using an index, the database system does not have to scan the entire table, but can directly locate the records that meet the conditions, which greatly speeds up the query. Sequential indexes maintain the order between data entries and are a common method to speed up comparisons and range queries. Common index data structures used for sequential indexes include binary trees, balanced binary trees, b-trees (i.e., balance-trees), b+ trees (B+trees), and other tree structures. The introduction of index data results can significantly reduce the number of comparisons required to find a data item in a data table. Figure 1A -B shows an example of a tree index data structure. For example, in a data table consisting of IDs and their respective pointing contents, a tree index data structure can be constructed by using the values ​​of the ID column as an index. Figure 1AAn example of a binary tree is shown. A binary tree is the simplest index data structure. Specifically, the IDs can be arranged in sequence (19, 28, 31, 33, 35, 40, 45, and 48 in the figure are ID values) and a binary tree can be constructed from them, so that no more than four comparisons are made for any ID (that is, if you look for the content corresponding to ID 48, four comparisons are required to obtain an equal result). Since the binary tree has the problem of a simple structure but too deep a hierarchy, the B-tree and B+-tree with better query performance can be introduced. The B+-tree is a multi-way balanced search tree. Figure 1B An example of a B+ tree is shown. As shown in the figure, each node can store more than one data value, and each node can have more than two child nodes. All keywords appear at leaf nodes, and each keyword (for example, as an index item ID) can point to the content of the entry to which it belongs.

[0028] from Figure 1A and Figure 1B As can be seen from the example, the sequential index maintains the order between data entries, that is, the data increases gradually from left to right in the tree structure, and the query conditions (for example, Figure 1A The ID 40 to be queried is compared with the data in the node level by level to determine the index item, and thereby obtain the entry content pointed to by the index item.

[0029] For plaintext data, simply indexing the data can meet performance requirements due to the low overhead of comparison operations. However, with the prevalence of fully encrypted databases, ensuring that index item information is not leaked during index lookups has become a common requirement. While ciphertext data processing based on a Trusted Execution Environment (TEE) meets the privacy protection needs of users using cloud platforms, it also leads to performance degradation due to the overhead of calling the TEE and decrypting ciphertext.

[0030] This is because in order to perform encrypted queries on encrypted indexes, a large number of comparison operations in the index require calling the TEE and decrypting the data. However, the limited resources of the TEE make it difficult to store the entire index data structure within the TEE to reduce the number of calls and decryption times, which greatly reduces indexing performance. For example, when a database often uses a B+ tree as a sequential index data structure, each node of the B+ tree has a large number of index items that need to be compared. Completing an index usually requires multiple comparisons (which means multiple calls and decryptions of the TEE), which is not conducive to indexing ciphertext data.

[0031] To this end, this paper proposes an improved database processing method. By using ORE ciphertext as index items, the index search process can perform encrypted comparisons within the index data structure without entering the TEE and decrypting the data. This allows for rapid location of search items with performance close to that of a plaintext index. Furthermore, since this solution only involves the encryption of index items, the existing index data structure of the database and other systems can be reused, significantly reducing the cost of retrofitting a fully encrypted database.

[0032] Here, Order Revealing Encryption (ORE) refers to a type of encryption algorithm that allows ciphertext to maintain the same order as the plaintext through a specific comparison method. Compared to Order-Preserving Encryption (OPE), which is a special case of ORE and directly reflects the order of plaintext, ORE allows the use of special comparison functions, is relatively more versatile, and has strong robustness against inference attacks. In one embodiment of the present invention, the AES-CBC encryption algorithm can be used to generate pseudo-random numbers for the implementation of ORE. In other embodiments, other cryptographic algorithms with similar order-revealing properties can also be relied upon, or even algorithms that implement the ORE properties that will be developed in the future.

[0033] This solution proposes to accelerate the ciphertext sequential index through ORE, so that the sequential index search process does not need to call TEE or even decrypt data. Compared with directly using the original ciphertext to build the index, the performance is improved; compared with directly using the original ciphertext to build the sequential index, no additional information is leaked; and it can be implemented without relying on specific data structures and the ORE algorithm.

[0034] The present invention can first be implemented as a database system. Figure 2 The diagram shows the composition of a database system according to an embodiment of the present invention. As shown in the figure, the database system 200 may include a key generation server 210, an index encryption server 220, an index data structure construction server 230 and an index database 240.

[0035] The key generation server 210 is used to generate different encryption keys for different indexes within the trusted execution environment. The generated index encryption keys are then transmitted to the index encryption server 220. The index encryption server 220 is used to encrypt the index items of each index within the trusted execution environment using the corresponding encryption keys to obtain the ORE ciphertext index items of each index. The ORE ciphertext index items of each index can then be transmitted to the index data structure construction server 230. The index data structure construction server 530 is used to use the ORE ciphertext index items of each index outside the trusted execution environment to generate the index data structure of each index, such as a b+ tree in ORE ciphertext form. The index database 240 is used to store the generated index data structures of each index.

[0036] Furthermore, database system 200 may also include a query server 250 configured to compare, outside the trusted execution environment, an ORE ciphertext of a query condition for a specific index with an ORE ciphertext index item in an index data structure for the specific index, and return a search result based on the comparison result. The ORE ciphertext of the query condition is obtained by encrypting the query condition within the trusted execution environment or on a client using an encryption key for the specific index. Specifically, query server 250 may search for an ORE ciphertext b+ tree for the specific index in index database 240, compare it with the ORE ciphertext of the query condition entered by the user, and then return the query result to the user.

[0037] As shown in the figure, in the database system of the present invention, except for the key generation server 510 and the index encryption server 220 which are located in the TEE, the other related servers and databases can be located outside the TEE without additionally leaking user information.

[0038] The present invention may also be implemented as a processing method executed by the above database system. Figure 3 A schematic flow chart of a database processing method according to an embodiment of the present invention is shown.

[0039] In step S310, an encryption key for encrypting the current index may be generated. As previously mentioned, different encryption keys may be generated for different indexes, thereby preventing the ORE ciphertexts of different indexes from being compared with each other, thereby preventing leakage of additional information.

[0040] In step S320, the encryption key is used to encrypt the index items of the current index, thereby obtaining the ORE ciphertext index items of the current index. Here, the current index may be a column selected as an index in the current data table, for example, the ID column of each entry in the current data table. Thus, each ID item in the ID column may be encrypted using the current index encryption key, thereby obtaining the ORE ciphertext for each ID.

[0041] Since ORE encryption can still reveal the size order of data, the ORE ciphertext index item can be used to generate the index data structure of the current index in step S330. For example, the ORE ciphertext index item can be directly used to construct a sequential index, for example, using the ORE encrypted ID column to construct an ORE encrypted b+ tree.

[0042] Here, the key generation operation in step S310 and the ORE ciphertext acquisition operation in step S320 need to be performed within the server's trusted execution environment. This protects the encryption key and index plaintext. The subsequent index data structure generation operation in step S330 does not need to be performed within the trusted execution environment because the index items are already encrypted.

[0043] Furthermore, generating the index data structure of the current index using the ORE ciphertext includes: constructing the index data structure of the current index using the ORE ciphertext index items according to the comparison results based on the same construction rules as the plaintext construction. For example, if the database originally uses a B+ tree when constructing the index data structure for the plaintext, the ORE ciphertext can also construct a B+ tree that is completely consistent with the plaintext structure (this is because ORE encryption can preserve order information).

[0044] Furthermore, a key-value structure may be used for data storage. Thus, when the current index includes an index item pointing to a ciphertext data barcode, the ORE ciphertext index item is the key, and the actual ciphertext data corresponding to the ORE ciphertext index item is the value.

[0045] Regarding the addition of index items, the index construction method of the present invention may further include: encrypting the newly added index item using the current index encryption key to obtain the ORE ciphertext of the newly added index item; and updating the index data structure of the current index using the ORE ciphertext of the newly added index item as the newly added ORE ciphertext index item to obtain an updated index data structure. The addition and deletion of index items may involve changes to the hierarchy and structure of the index data structure (e.g., a b+ tree). However, since ORE ciphertext retains sequentiality, the addition, deletion, and modification of the index data structure for ORE ciphertext index items can be the same as the operations for plaintext.

[0046] After constructing the ORE ciphertext index, you can perform corresponding data queries. Figure 4 A schematic flow chart of the data query sub-steps of a database processing method according to an embodiment of the present invention is shown. The method can be implemented in particular by a database server that encrypts index items into ORE ciphertext index items as described above.

[0047] In step S410, the encryption key for the current index is obtained. In one embodiment, different indexes can be encrypted using different index encryption keys. This prevents comparison of the ORE ciphertexts between different indexes, preventing leakage of additional information. Since the index encryption key is generated when the index item is encrypted to obtain the ORE ciphertext, the current index encryption key previously used to encrypt the current index can be obtained during the data query phase.

[0048] The purpose of obtaining the current index encryption key is to encrypt the query condition based on the same key (and the same encryption algorithm) to generate the ORE ciphertext of the query condition, which is convenient for subsequent comparison. Here, "query condition" can refer to the query information given by the user to query the specific data entries in the current data table, for example, Figure 1A The query condition can be "ID=35", and the purpose is to obtain the content of the entry pointed to by ID 35. Figure 1B The query condition can be "IDs greater than 30 and less than 70", and the entry contents pointed to by IDs 40, 50, 55, 60, and 69 are obtained.

[0049] Therefore, in step S420, the query condition is encrypted using the current index encryption key to obtain the ORE ciphertext of the query condition. To ensure data security, the current index encryption key can be obtained from the server's TEE and sent to the client via encrypted communication, and the ORE encryption of the query condition is completed on the client. Alternatively, the client can send the query condition to the server's TEE via encrypted communication, and directly obtain the current index encryption key in the server's TEE and encrypt the input query condition.

[0050] After obtaining the ORE ciphertext of the query condition, the ORE ciphertext of the query condition can be compared with the ORE ciphertext index items in the index data structure of the current index based on the ORE comparison algorithm in step S430. Since the ORE ciphertext index items are encrypted using the current index encryption key, as previously described, in the index data structure of the current index, although the index items are ciphertext encrypted using the ORE, the individual index items maintain the same order as the plaintext index items. This allows the query condition, also encrypted using the current index encryption key, to be directly compared in its ORE ciphertext form to locate one or more specific items in the index data structure. Subsequently, in step S440, the search result can be returned based on the comparison result.

[0051] Therefore, the present invention utilizes the ORE encrypted index to still reveal the order relationship after encryption, so the ORE ciphertext of the query condition and the ORE ciphertext index item can be compared without entering the trusted execution environment, that is, the encrypted index query can be implemented outside the TEE.

[0052] When the ORE ciphertext index item as the comparison result points to a corresponding ciphertext entry, returning the search result based on the comparison result may include returning the corresponding ciphertext entry data. When the ORE ciphertext index item as the comparison result points to multiple ciphertext entries, returning the search result based on the comparison result may include entering a trusted execution environment for subsequent comparison and returning the ciphertext entry data that meets the query criteria.

[0053] Furthermore, the present invention can also be implemented as a database processing method implemented by a client, wherein the client is used to perform database query. Figure 5 A schematic flow chart of a database processing method according to an embodiment of the present invention is shown.

[0054] In step S510, an encryption key for the current index is obtained from the server's trusted execution environment. In step S520, the query condition is encrypted using the encryption key within the server's trusted execution environment or within the client to obtain an ORE ciphertext of the query condition. In step S530, a search result returned by the server outside the trusted execution environment by comparing the ORE ciphertext of the query condition with the ORE ciphertext index item in the index data structure of the current index using an ORE comparison algorithm is obtained.

[0055] Figure 6 A schematic structural diagram of a computing device that can be used to implement the above-mentioned data query and / or index construction method according to an embodiment of the present invention is shown.

[0056] See also Figure 6, the computing device 600 includes a memory 610 and a processor 620 .

[0057] The processor 620 may be a multi-core processor or may include multiple processors. In some embodiments, the processor 620 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU) or a digital signal processor (DSP). In some embodiments, the processor 620 may be implemented using customized circuits, such as application-specific integrated circuits (ASICs) or field-programmable gate arrays (FPGAs).

[0058] The memory 610 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 620 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that retains stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all instructions and data required by the processor during operation. In addition, the memory 610 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks may also be used. In some embodiments, the memory 610 may include a readable and / or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0059] The memory 610 stores executable codes. When the executable codes are processed by the processor 620 , the processor 620 can execute the data query and / or index construction method mentioned above.

[0060] Therefore, the present invention uses ORE ciphertext as an index item. The index search process does not require entering the TEE and decrypting the data. Only when the ciphertext data is finally determined, it may involve entering the TEE and decrypting the ciphertext, and the performance is close to that of plaintext indexing. Therefore, the solution of the present invention does not require modifying the index data structure, only using specific index items, and can use the original index data structure of the database system. The present invention is based on the observation of sequential index data structure and does not rely on a specific sequential index data structure.

[0061] Application Examples

[0062] To deepen our understanding of the principles of this invention, the following describes the solution of this invention in detail from three scenarios: index creation, index query, and index update. In terms of security, the client can be considered a trusted environment under user control, while the server only considers the TEE as a trusted environment.

[0063] I. Create an index

[0064] 1. The server-side TEE generates and records the current index encryption key for the current index (here, the server-side can generate different index encryption keys for each index to be encrypted in the TEE and record them in the key list);

[0065] 2. The server-side TEE decrypts the original ciphertext (the original ciphertext can be encrypted using the original key for the current plaintext index, which is different from the subsequent index encryption key for secure transmission to the TEE). The server-side TEE then uses the generated current index encryption key and the appropriate ORE algorithm to encrypt the corresponding ORE ciphertext.

[0066] 3. Use the ORE ciphertext as the index item based on the comparison result to implement the same index data structure as the plaintext. Note that the index data structure itself does not need to be encrypted, only the ciphertext index item is used;

[0067] 4. The ciphertext data of the original entry content can remain unchanged. When there is an index entry that directly points to the ciphertext data entry, the key is the ORE ciphertext and the value is the actual ciphertext data.

[0068] II. Index Query

[0069] 1. Obtain the key for the index to be queried in an encrypted trusted environment: When encrypting query conditions on the client side, the key must be obtained from the server-side TEE; when encrypting query conditions on the server side, the key must be obtained within the TEE;

[0070] 2. In the client or server TEE, the query condition is encrypted with the obtained key and the appropriate ORE algorithm is selected to obtain the ORE ciphertext corresponding to the condition;

[0071] 3. Use the ORE comparison algorithm to compare the conditional ORE ciphertext and the index item without decryption and entering the TEE;

[0072] 4. Return the search results. When the index ultimately points to an actual ciphertext entry, the ciphertext data pointed to is directly returned; otherwise, when the index points to multiple ciphertext data, it is necessary to enter the TEE for comparison and return the ciphertext data that meets the conditions.

[0073] Figure 7 An example of performing an index query on a sequential index obtained from an ORE ciphertext is shown. As shown, the plaintext query condition 137 (illustrated as a white dotted box) can be ORE encrypted within the trusted environment of the client or TEE to obtain the ORE-encrypted query condition (the ORE ciphertext is illustrated as a gray circular box). The encrypted 137 (it can be understood that although it is still shown as 137 for ease of understanding, the value of the ORE-encrypted 137 in the gray circular box is not equal to 137. Similarly, the various index items in the illustrated b+ tree also represent the various ORE-encrypted values, not the values ​​themselves) can then be directly compared with the ORE ciphertext index items in the b+ tree without entering the trusted environment until the corresponding index item is found.

[0074] In addition, it should be understood that although the index items in the illustrated sequential index are increasing numerical items, in other implementations, the index items may also be items other than numerical items, as long as these items themselves can be represented numerically in the database system.

[0075] III. Index Update

[0076] 1. Obtain the key of the index to be updated in the server-side TEE (for example, the "Current Index Encryption Key" of the "Current Index" in Part I);

[0077] 2. The server-side TEE decrypts the newly added ciphertext and uses the obtained key to select the appropriate ORE algorithm to encrypt the corresponding ORE ciphertext;

[0078] 3. Update the data structure using the generated ORE ciphertext as the index item. When adding an index item that directly points to a ciphertext data entry, the key is the ORE ciphertext corresponding to the newly added ciphertext, and the value is the newly added ciphertext data.

[0079] The data query and / or index construction scheme according to the present invention has been described in detail above with reference to the accompanying drawings. The present invention proposes to accelerate the ciphertext sequential indexing through ORE and achieve the following features:

[0080] The sequential index search process does not require calling TEE and decrypting data, which improves performance compared to directly using the original ciphertext to build the index;

[0081] Compared with directly using the original ciphertext to construct the sequential index, no additional information is leaked;

[0082] In this solution, the index search process uses the ORE comparison algorithm, which does not require entering the TEE and decrypting the data. Entering the TEE and decrypting the ciphertext may only be involved when finally determining the returned ciphertext data. The performance is close to that of plaintext indexing.

[0083] For a single index, the sequential index data structure itself exposes the order information, and ORE does not leak additional information;

[0084] For multiple indexes, since different indexes use different keys, ORE ciphertexts cannot be compared with each other and no additional information is leaked;

[0085] Select the appropriate ORE algorithm for different data types and use the latest algorithm to support more data types.

[0086] In addition, the method according to the present invention may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing the above steps defined in the above method of the present invention.

[0087] Alternatively, the present invention can also be implemented as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or computing device, server, etc.), the processor executes the various steps of the above-mentioned method according to the present invention.

[0088] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.

[0089] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems and methods according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to existing technologies, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A database system comprising: A key generation server, configured to generate different encryption keys for different indexes within the trusted execution environment; An index encryption server is configured to perform order-visible encryption (ORE) on the index items of the respective indexes using corresponding encryption keys within the trusted execution environment to obtain ORE ciphertext index items of the respective indexes, wherein the ORE ciphertext index items can reveal the size order of the data; An index data structure construction server, configured to generate an index data structure for each index using the ORE ciphertext index items of each index outside the trusted execution environment; the index data structure is a tree structure in the form of ORE ciphertext; wherein the index data structure is constructed based on the same construction rules as the plaintext construction, and the ORE ciphertext index items are constructed according to the comparison results; An index database, used to store the index data structure of each generated index; A query server is configured to compare, outside the trusted execution environment, an ORE ciphertext of a query condition for a specific index with an ORE ciphertext index item in an index data structure for the specific index, and return a search result based on the comparison result, wherein the ORE ciphertext of the query condition is obtained by encrypting the query condition by ORE using an encryption key for the specific index within the trusted execution environment or on a client.

2. A database processing method, comprising: generating an encryption key for encrypting the current index within the trusted execution environment; Performing ORE encryption on the index item of the current index using the encryption key in the trusted execution environment to obtain an ORE ciphertext index item of the current index, where the ORE ciphertext index item can reveal the size order of data; generating an index data structure for the current index using the ORE ciphertext index item outside the trusted execution environment, wherein the index data structure is a tree structure in ORE ciphertext form; wherein the index data structure is constructed based on the same construction rules as the plaintext construction, and the ORE ciphertext index item is constructed according to the comparison result; The method further comprises: Obtaining an encryption key for the current index; encrypting a query condition using the encryption key to obtain an ORE ciphertext of the query condition; comparing the ORE ciphertext of the query condition with an ORE ciphertext index item in an index data structure of the current index outside the trusted execution environment based on an ORE comparison algorithm, wherein the ORE ciphertext index item is obtained by encrypting the index item of the current index using the encryption key; and returning a search result based on the comparison result.

3. The method according to claim 2, wherein: When the current index includes an index item pointing to a ciphertext data barcode, the ORE ciphertext index item is a key, and the actual ciphertext data corresponding to the ORE ciphertext index item is a value.

4. The method of claim 2, further comprising: Encrypt the newly added index item using the encryption key to obtain the ORE ciphertext of the newly added index item; The ORE ciphertext of the newly added index item is used as the newly added ORE ciphertext index item to update the index data structure of the current index, thereby obtaining an updated index data structure.

5. The method according to claim 2, wherein: The search results returned based on the comparison result include at least one of the following: When the ORE ciphertext index item as the comparison result points to a corresponding ciphertext entry, returning the corresponding ciphertext entry data pointed to; and When the ORE ciphertext index item as the comparison result points to multiple ciphertext entries, a trusted execution environment is entered for subsequent comparison, and ciphertext entry data that meets the query condition is returned.

6. A database processing method, comprising: Get the encryption key for the current index from the server's trusted execution environment; Performing ORE encryption on the query condition using the encryption key in the trusted execution environment of the server or in the client to obtain an ORE ciphertext of the query condition; The server compares the ORE ciphertext of the query condition with the ORE ciphertext index items in the index data structure of the current index based on the ORE comparison algorithm outside the trusted execution environment, wherein the ORE ciphertext index items are obtained by encrypting the index items of the current index using the encryption key; the ORE ciphertext index items can reveal the size order of data, and the index data structure is a tree structure in the form of ORE ciphertext; the index data structure is constructed based on the same construction rules as the plaintext, and the ORE ciphertext index items are constructed according to the comparison results; Obtain a search result returned by the server based on the comparison result.

7. A computing device comprising: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to perform the method according to any one of claims 2 to 6.

8. A non-transitory machine-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method according to any one of claims 2 to 6.

Citation Information

Patent Citations

  • Ciphertext search method based on trusted execution environment

    CN113949701A

  • Data processing method and device, equipment and storage medium

    CN114117528A