A database ciphertext index access method and system based on a trusted execution environment
By performing encryption, decryption, and interaction at the index page level, combined with the caching mechanism of the trusted execution environment, the high overhead and kernel modification problems of encrypted indexes in fully encrypted databases are solved, achieving high-performance and low-intrusion index access.
Patent Information
- Application Number
- CN202611383927.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-11-27
AI Technical Summary
Existing fully encrypted databases suffer from high interaction overhead, high encryption/decryption overhead, and large kernel modifications when building encrypted indexes, resulting in poor performance and poor ecosystem compatibility.
Encryption and decryption are performed at the index page level, combined with the caching mechanism of the trusted execution environment, which reduces the number of interactions and encryption/decryption operations. The original index splitting and concurrency control mechanisms of the database are reused, reducing kernel modifications.
It significantly reduces encryption/decryption and interaction overhead, improves index operation performance, and maintains the ecosystem compatibility of the database system.
Smart Images

Figure CN123178399A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database index operation technology, specifically to a database encrypted index access method, system, computer-readable storage medium, and electronic device based on a trusted execution environment. Background Technology
[0002] Fully encrypted databases are an important technological direction in the field of database security. Their core feature is that data remains encrypted throughout its entire lifecycle, including transmission, computation, and storage, in any untrusted medium or environment.
[0003] Currently, the most mature fully encrypted database implementation solutions in the industry are mainly based on a Trusted Execution Environment (TEE). This solution typically includes two core modules: first, driver encryption, where sensitive data in the SQL statement is automatically encrypted by the application's data driver when the application sends the SQL statement to the database, and the database only receives and processes the encrypted data; second, confidential computation, since the database cannot directly perform computation operations on the encrypted data, the encrypted data needs to be sent to the trusted execution environment, where the trusted module performs decryption and computation.
[0004] In database systems, the B+ tree index is the most commonly used index structure. Taking the TPC-C test model as an example, when the data volume is less than 10 billion records, the height of the B+ tree is usually no more than 4 levels. Each node at each level of the B+ tree is a fixed-size index page, including the root index page, internal index pages, and leaf index pages. Each index page stores several index items. The index items in the root index page and internal index pages store the data and the location information pointing to the next level index page, while the index items in the leaf index pages store the data and the location information of the corresponding table data page.
[0005] During data encryption and decryption, encryption performance is primarily affected by the number of encryption attempts, rather than the length of data encrypted per attempt. Specifically, encrypting 8KB of data in a single attempt yields significantly better performance than encrypting 200 bytes of data 40 times, with a performance difference of more than 10 times.
[0006] In a fully encrypted database, the database only stores encrypted data. To support scenarios such as equality queries and range queries, and to avoid full table scans, indexes (i.e., encrypted indexes) need to be built on the encrypted data. When building an encrypted index, the encrypted data needs to be transmitted to a trusted execution environment, where the data is temporarily decrypted, and the index structure is built by comparing the data sizes.
[0007] However, existing dense-state indexing schemes have the following drawbacks:
[0008] (1) High interaction overhead: Existing solutions usually interact with the trusted execution environment at the index item level, resulting in too many interactions and high interaction overhead;
[0009] (2) High encryption and decryption overhead: When comparing the size of index items within an index page, the index items need to be decrypted multiple times; for the top-level index page of the tree, due to its high access frequency, the corresponding encryption and decryption frequency is also high, which further exacerbates the performance overhead.
[0010] (3) Large amount of kernel modification: In order to adapt to the trusted execution environment, a large number of database kernel modules such as index building, index query, and concurrency control need to be modified, which damages the ecological compatibility of the database system. Summary of the Invention
[0011] To overcome the aforementioned deficiencies in the existing technology, this application proposes a novel database encrypted index access method and system based on a trusted execution environment.
[0012] This invention provides a general, high-performance, and low-modification solution for scenarios involving constructing and scanning indexes on encrypted data. Based on a trusted execution environment, it significantly reduces interaction overhead and encryption / decryption overhead. Furthermore, it fully reuses the index splitting and concurrent access mechanisms to achieve the lowest possible kernel intrusion modification.
[0013] To achieve the above objectives, this application provides the following technical solution:
[0014] The first aspect of this application provides a method for accessing database encrypted indexes based on a trusted execution environment, such as... Figure 1 As shown, it includes the following steps:
[0015] S1. The database driver encrypts the plaintext data to be indexed at the field level, generating ciphertext data;
[0016] S2. The database receives the encrypted data and sends the index pages to the trusted execution environment at the index page level;
[0017] S3. The trusted execution environment decrypts the ciphertext data to obtain plaintext data, and decrypts the index page at the index page level, and performs indexing operations on the decrypted index page according to the plaintext data;
[0018] S4. The trusted execution environment encrypts the index page after the indexing operation is completed at the index page level to obtain the encrypted index page;
[0019] S5. Return the encrypted index page to the database for storage.
[0020] Furthermore, in the method of this application, step S3, which involves decrypting the index page at the index page level, specifically includes:
[0021] The trusted execution environment receives the encrypted index page sent by the database, decrypts the encrypted index page at the granularity of the entire index page, and obtains the plaintext index page; in the plaintext index page, the index entries are stored in plaintext form.
[0022] Furthermore, in the method of this application, step S4, which involves encrypting the index page after the indexing operation is completed at the index page granularity, specifically includes:
[0023] The trusted execution environment encrypts the index page after the indexing operation is completed at the granular level of the entire index page to obtain an encrypted index page. The header and footer of the index page do not contain user data and do not need to be encrypted.
[0024] Furthermore, in the method of this application, in step S3, the trusted execution environment caches the decrypted index page, which includes the root index page and the internal index page.
[0025] Furthermore, in the method of this application, when it is necessary to access the root index page or the internal index page, the trusted execution environment first searches the cache; if the cache is not found, it requests the corresponding encrypted index page from the database, decrypts it, and then caches it.
[0026] Furthermore, in the method of this application, in step S3, the index operation includes index construction, index query, index insertion and index deletion operations; when performing the index operation, the index splitting mechanism and concurrency control mechanism reuse the original implementation logic of the database.
[0027] Furthermore, in the method of this application, step S3, which involves performing an indexing operation on the decrypted index page based on the plaintext data, specifically includes:
[0028] If the trusted execution environment fails to find the root index page in the cache, it requests the database to send the encrypted root index page, which is then decrypted and cached.
[0029] Perform a binary search on the current index page to determine the location of the next level index page;
[0030] If the next level index page is an internal index page, then search for the corresponding internal index page in the cache. If it is not found, request the database to send the encrypted internal index page, decrypt it, cache it, and continue the binary search.
[0031] If the next level index page is a leaf index page, then request the database to send the encrypted leaf index page, and after decryption, execute the index operation on the leaf index page;
[0032] The leaf index pages after the indexing operation is completed are encrypted and returned to the database.
[0033] A second aspect of this application provides a database encrypted index access system based on a trusted execution environment, wherein the system implements the steps of the aforementioned database encrypted index access method based on a trusted execution environment during runtime, such as... Figure 2 As shown, it includes:
[0034] The database driver module is used to encrypt plaintext data to be indexed at the field level, generate ciphertext data and send it to the database, and decrypt the ciphertext data returned by the database.
[0035] The database module is used to receive and store the encrypted data, send index pages to the trusted execution environment module at the index page granularity, and receive and store the encrypted index pages returned by the trusted execution environment module.
[0036] The Trusted Execution Environment module is used to decrypt the encrypted data to obtain plaintext data, decrypt the index page at the index page level, perform indexing operations on the index page according to the plaintext data, encrypt the index page after the indexing operation at the index page level, and return the encrypted index page to the database module.
[0037] Furthermore, in the system of this application, the trusted execution environment module is also used to cache the decrypted index pages, including the root index page and the internal index pages.
[0038] Furthermore, in the system of this application, the database driver module and the trusted execution environment module transmit keys through a secure channel, and the trusted execution environment module caches the keys for decryption and encryption operations.
[0039] A third aspect of this application provides an electronic device, including: a memory and a processor;
[0040] Memory: Used to store computer programs;
[0041] Processor: Used to execute the computer program to implement the steps of the aforementioned database encrypted index access method based on a trusted execution environment.
[0042] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the aforementioned database encrypted index access method based on a trusted execution environment.
[0043] In summary, by performing encryption, decryption, and interaction at the index page level, and combining this with a trusted execution environment's caching mechanism for the root index page and internal index pages, this invention achieves the following technical effects while ensuring data encryption security throughout its entire lifecycle:
[0044] (1) Significantly reduce encryption and decryption overhead: Replace the encryption and decryption method with the index item granularity with the index page granularity, significantly reduce the number of encryption and decryption operations, and improve the performance of indexing operations;
[0045] (2) Significantly reduce interaction overhead: Data is transferred between the database and the trusted execution environment at the index page level, reducing the number of interactions and communication overhead;
[0046] (3) Further reduce decryption and interaction: Taking advantage of the high access frequency and low modification frequency of the root index page and internal index page, the decrypted index page is cached in the trusted execution environment to reduce repeated decryption and interaction with the trusted execution environment;
[0047] (4) Low intrusion and high compatibility: It only interacts with the trusted execution environment when it is necessary to compare data sizes, making full use of the original index splitting and concurrency control mechanisms of the database, requiring minimal kernel modification and good ecosystem compatibility.
[0048] Other features and advantages of this application will be set forth in detail in the following description, or will become apparent through the implementation of the relevant technical solutions of this application. The objectives and other advantages of this application can be achieved through the technical features and means explicitly pointed out in the description, claims, and drawings, and will be obtained through the implementation of these technical contents. Attached Figure Description
[0049] To more clearly illustrate the technical solution of this application, the accompanying drawings involved in the description of this invention will be briefly introduced below. It should be noted that the drawings only show some embodiments of the invention. For those skilled in the art, other related drawings can be derived from these drawings without creative effort.
[0050] Figure 1 This is a schematic diagram illustrating the operation steps of the database encrypted index access method in this application.
[0051] Figure 2 This is a structural diagram of the database encrypted index access system of this application.
[0052] Figure 3 This is a schematic diagram comparing the plaintext index structure and the dense index structure in the embodiments of this application (the diagram uses a 3-level index as an example to illustrate the difference between the two, with the plaintext index structure on the left and the dense index structure on the right).
[0053] Figure 4This is a schematic diagram of the dense state index insertion process in an embodiment of this application (the diagram shows the process based on...). Figure 3 (Example index structure and implementation process for inserting one data record into the index). Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.
[0055] In this document, the term "comprising" and any variations thereof (such as "including," "including," etc.) are open-ended expressions and should be understood as "including but not limited to," meaning that the listed content is not exhaustive and may include other content not explicitly mentioned. The term "based on" should be understood as "at least partially based on," meaning that the basis or condition referred to may not be the only factor and may involve other relevant factors. The term "one embodiment" should be understood as "at least one embodiment," meaning that the described embodiment is not the only possible implementation, and other similar embodiments may exist.
[0056] In this application, the terms "a" and "a plurality of" are used to modify related elements or features, and their expression is illustrative rather than restrictive. Unless otherwise expressly stated in the context, "a" should be understood as "at least one," and "a plurality of" should be understood as "at least two." Those skilled in the art should reasonably interpret these terms based on the semantic and logical relationships of the context to ensure that they cover the possibility of "one or more."
[0057] This application provides the following technical solution:
[0058] A method for accessing database encrypted indexes based on a trusted execution environment
[0059] 1. Index Construction: When data is inserted, the driver encrypts the data at the field level. The database receives the encrypted data, the TEE decrypts the data, constructs the index, and re-encrypts the data at the index page level.
[0060] 2. Accessing the index: Based on the access characteristics of the index, each index-item is not encrypted and decrypted independently. Instead, encryption and decryption are performed at the index-page level each time, reducing the number of encryption and decryption operations.
[0061] 3. Sending indexes: When the database sends an index to the TEE, it sends it at the index-page level each time, reducing the number of interactions.
[0062] 4. Cached Index: In TEE, considering the high access frequency and low modification frequency of root and internal pages in the index, the decrypted pages are cached to reduce the number of decryption times and interactions with TEE.
[0063] 5. Kernel modification: In the database, when accessing an index, interaction with TEE is only required when a large value needs to be compared, while retaining the existing index splitting and concurrent access mechanisms.
[0064] Taking the TPC-C model as an example, when warhouse is 10000:
[0065] The base table, bmsql_customer, contains 300 million rows of data and is approximately 250GB in size.
[0066] Index: In the bmsql_customer primary key index, there are 300 million index-items, the index file size is approximately 9.5GB, and the index has 4 levels. The number of pages in each level is 10,000, 170,000, 44 million, and 1.14 million respectively, with approximately 260 page-items per page. Inserting one record results in an average of 0.0034 index-page splits.
[0067] In this scenario, using the solution of this invention, considering all possible additional interactions, encryption, and decryption scenarios such as index-page splitting and occasional TEE cache misses:
[0068]
[0069] To more clearly illustrate the technical solution of this application, the following will provide further explanation through specific scenario embodiments.
[0070] Figure 3 The example of a simple three-level index illustrates the difference between plaintext and encrypted index structures (the left side of the diagram shows the plaintext index structure, and the right side shows the encrypted index structure). As shown, in the encrypted index, all index-pages store only encrypted data. In the TEE, encryption is performed at the page level; the PageHeader and PageTail do not store user data and therefore do not require encryption.
[0071] (a) Creating a dense index
[0072] 1) Administrator: Create key CREATE DATA KEY dk1(..);
[0073] 2) Database driver: Generate keys through a key service or cryptographic machine, cache keys, and send key information to the database;
[0074] 3) Database: The system tables store key information, including key name, key Oid, etc.
[0075] 4) Administrator: Create encrypted table and index: CREATE TABLE t1(c1 INT ENCRYPTED BY dk1, c2TEXT), CREATE INDEX i1 ON t1(c1);
[0076] 5) Database: Stores encrypted information, including table names, column names, key names, etc.
[0077] (ii) Insert one data record into the index
[0078] Figure 4 The diagram shows the dense index insertion process, based on... Figure 3 The example index structure demonstrates the process of inserting one record into the index as follows:
[0079] 1) Prerequisites: A dense state index has been created;
[0080] 2) Application: Connecting to a database;
[0081] 3) Data-driven: Connect to the database, query encryption information and key information, and cache them;
[0082] 4) Database-driven: Obtain keys from a key service or cryptographic machine, establish a secure channel with the trusted execution environment, and transmit the keys;
[0083] 5) Trusted Execution Environment: Cached Key;
[0084] 6) Application: Storing data in the database: INSERT INTO t1 VALUES (13, 'data1');
[0085] 7) Database driver: Parse the SQL syntax, identify encrypted column fields, encrypt the fields, and rewrite the SQL: INSERT INTO t1 VALUESS (cipher
[13] , 'data1');
[0086] 8) Database: Insert data (cipher
[13] , 'data1') into base table t1 to prepare for index construction;
[0087] 9) Database: Send the ciphertext
[13] to the TEE;
[0088] 10) Trusted execution environment: decrypt cipher
[13] and obtain plaintext(13);
[0089] 11) Trusted execution environment: Locate the cached root page. If not found, request the database to send the root page, decrypt it, and cache the root page.
[0090] 12) Trusted execution environment: In the root page, use a binary search to obtain the location of the internal page;
[0091] 13) Trusted execution environment: Locate the cached internal page; if not found, request the database to send the internal page, decrypt and cache the internal page.
[0092] 14) Trusted execution environment: In the internal page, use binary search to obtain the leaf page location;
[0093] 15) Trusted Execution Environment: Request the database to send a leaf page, and decrypt the leaf page;
[0094] 16) Trusted Execution Environment: If the leaf page is full, trigger the split process;
[0095] 17) Trusted execution environment: In the leaf pag, use binary search to obtain the insertion position;
[0096] 18) Trusted execution environment: In the leaf page, insert data (13, the storage location of 13 in base table t1);
[0097] 19) Trusted execution environment: Encrypt the leaf page and return the encrypted leaf page to the database;
[0098] 20) Database: Restore the encrypted leaf pages.
[0099] In the above process, steps 12) to 20) can be optimized through caching. Taking TPC-C as an example, when the number of index-items is 300 million, the number of index levels is 4, the index file size is approximately 9.5G, the number of root pages is 1, the number of internal pages is 17+4000, and the cache size is 31.38MB.
[0100] (iii) Find one data record from the index
[0101] The query process is largely the same as the insertion process:
[0102] 1) Prerequisites: A dense state index has been created;
[0103] 2) Application: Connecting to a database;
[0104] 3) Data-driven: Connect to the database, query encryption information and key information, and cache them;
[0105] 4) Database-driven: Obtain keys from a key service or cryptographic machine, establish a secure channel with the trusted execution environment, and transmit the keys;
[0106] 5) Trusted Execution Environment: Cached Key;
[0107] 6) Application: Querying data from the database: SELECT * FROM t1 WHERE c1 = 13;
[0108] 7) Database driver: Perform syntax parsing on the SQL, identify encrypted column fields, encrypt the fields, and rewrite the SQL: SELECT * FROM t1 WHERE c1 = cipher
[13] ;
[0109] 8) Database: Send the ciphertext
[13] to the TEE;
[0110] 9) Trusted execution environment: decrypt cipher
[13] and obtain plaintext(13);
[0111] 10) Trusted execution environment: Locate the cached root page. If not found, request the database to send the root page, decrypt it, and cache the root page.
[0112] 11) Trusted execution environment: In the root page, use a binary search to obtain the location of the internal page;
[0113] 12) Trusted Execution Environment: Locate the cached internal page; if not found, request the database to send the internal page, decrypt and cache the internal page.
[0114] 13) Trusted execution environment: In the internal page, use binary search to obtain the leaf page location;
[0115] 14) Trusted execution environment: Request the database to send a leaf page, and decrypt the leaf page;
[0116] 15) Trusted execution environment: In the leaf pag, perform a binary search to obtain the index item corresponding to data (13);
[0117] 16) Trusted execution environment: Obtain the corresponding position in the base table t1 from the index item corresponding to data (13);
[0118] 17) Trusted execution environment: Return the storage location of (13) in base table t1 to the database;
[0119] 18) Database: From base table t1, retrieve the data corresponding to data (13) (cipher
[13] , 'data1');
[0120] 19) Database: Returns data to the database driver (cipher
[13] , 'data1');
[0121] 20) Database driver: Accept (cipher
[13] , 'data1'), decrypt cipher
[13] into data(13);
[0122] 21) Application: Get data (13, 'data1').
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate possible implementations of systems, methods, and computer program products according to various embodiments of this application, including architecture, functionality, and operation. In these figures, each block may represent a module, program segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should be noted that each block in the block diagrams and / or flowcharts, and combinations thereof, can be implemented using either a dedicated hardware-based system or a combination of dedicated hardware and computer instructions to achieve the specified function or operation.
[0124] Embodiments of this application also disclose an electronic device, including: a processor, a communication interface, a memory for storing a processor-executable computer program, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor executes the executable computer program to implement the steps of the aforementioned database encrypted index access method based on a trusted execution environment.
[0125] It is understood that, in addition to memory and a processor, this electronic device may also include input devices (such as a keyboard), output devices (such as a display), and other communication modules. These input devices, output devices, and other communication modules all communicate with the processor through I / O interfaces (i.e., input / output interfaces).
[0126] The operations described in this application can be implemented by writing computer program code using one or more programming languages or a combination thereof. The programming languages include, but are not limited to, the following types:
[0127] Object-oriented programming languages, such as Java, Smalltalk, C++, etc.
[0128] Conventional procedural programming languages, such as "C" or similar programming languages.
[0129] The execution methods of program code include, but are not limited to:
[0130] It runs entirely on the user's computer;
[0131] Part of it executes on the user's computer, and part of it executes on a remote computer;
[0132] Execute as a standalone software package;
[0133] It is executed entirely on a remote computer or server.
[0134] In scenarios involving remote computers, the remote computer can connect to the user's computer via any type of network, including but not limited to local area networks (LANs) or wide area networks (WANs). Furthermore, the remote computer can also connect to external computers through an internet service provider, for example, by utilizing the internet for connection.
[0135] Furthermore, this application also discloses a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the various steps of the database encrypted index access method based on a trusted execution environment disclosed in this application.
[0136] In the context of this application, a computer-readable storage medium refers to a tangible medium capable of storing computer program code and related data. Specific examples include, but are not limited to, the following:
[0137] (1) Portable computer disk: such as floppy disks and other removable magnetic storage media.
[0138] (2) Hard disk: including mechanical hard disks and solid-state hard disks and other fixed storage devices.
[0139] (3) Random Access Memory (RAM): A volatile storage medium used for temporary storage of data and program code.
[0140] (4) Read-only memory (ROM): a non-volatile storage medium used to store fixed programs and data.
[0141] (5) Erasable programmable read-only memory (EPROM) or flash memory: non-volatile storage media that supports multiple erasures and reprogrammings.
[0142] (6) Fiber optic storage devices: storage media based on fiber optic technology.
[0143] (7) Portable compact disc read-only memory (CD-ROM): a read-only medium that stores data in the form of an optical disc.
[0144] (8) Optical storage devices: such as DVDs, Blu-ray discs and other storage media based on optical principles.
[0145] (9) Magnetic storage devices: such as magnetic tapes, disks and other storage media based on magnetic principles.
[0146] (10) Any suitable combination of the above: for example, combining multiple storage media to meet different storage needs.
[0147] These computer-readable storage media can be used to store the program code and related data described in this application to support program execution and persistent data storage.
[0148] Specifically, according to embodiments of this application, the processes described in the flowcharts can be implemented as computer software programs. For example, embodiments of this application relate to a computer program product comprising a computer program carried on a non-transitory computer-readable medium. This computer program contains program code for executing the database encrypted index access method based on a trusted execution environment disclosed in this application. When this computer program is executed by a processing system, it can achieve the functions defined in the embodiments of this application.
[0149] While the foregoing discussion contains several specific implementation details, these details should not be construed as limiting the scope of this application. The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features. Furthermore, this application should also cover other technical solutions formed by any combination of the above-described technical features or their equivalents without departing from the foregoing disclosed concept.
[0150] Those skilled in the art should also understand that modifications can be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features, without departing from the spirit and scope of the technical solutions of the embodiments of this application. These modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the core spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A database encrypted index access method based on a trusted execution environment, characterized in that, Includes the following steps: S1. The database driver encrypts the plaintext data to be indexed at the field level, generating ciphertext data; S2. The database receives the encrypted data and sends the index pages to the trusted execution environment at the index page level; S3. The trusted execution environment decrypts the ciphertext data to obtain plaintext data, and decrypts the index page at the index page level, and performs indexing operations on the decrypted index page according to the plaintext data; S4. The trusted execution environment encrypts the index page after the indexing operation is completed at the index page level to obtain the encrypted index page; S5. Return the encrypted index page to the database for storage.
2. The method according to claim 1, characterized in that, In step S3, the step of decrypting the index page at the index page level specifically includes: The trusted execution environment receives the encrypted index page sent by the database, decrypts the encrypted index page at the granularity of the entire index page, and obtains the plaintext index page; in the plaintext index page, the index entries are stored in plaintext form.
3. The method according to claim 1, characterized in that, In step S4, the encryption of the index pages after the indexing operation is completed, using the index pages as the granularity, specifically includes: The trusted execution environment encrypts the index page after the indexing operation is completed at the granular level of the entire index page to obtain an encrypted index page. The header and footer of the index page do not contain user data and do not need to be encrypted.
4. The method according to claim 1, characterized in that, In step S3, the trusted execution environment caches the decrypted index pages, including the root index page and the internal index pages.
5. The method according to claim 4, characterized in that, When access to the root index page or an internal index page is required, the trusted execution environment first checks the cache; if the cache is not found, it requests the corresponding encrypted index page from the database, decrypts it, and then caches it.
6. The method according to claim 1, characterized in that, In step S3, the index operation includes index construction, index query, index insertion and index deletion operations; when performing index operation, the index splitting mechanism and concurrency control mechanism reuse the original implementation logic of the database.
7. The method according to claim 1, characterized in that, In step S3, the indexing operation performed on the decrypted index page based on the plaintext data specifically includes: If the trusted execution environment fails to find the root index page in the cache, it requests the database to send the encrypted root index page, which is then decrypted and cached. Perform a binary search on the current index page to determine the location of the next level index page; If the next level index page is an internal index page, then search for the corresponding internal index page in the cache. If it is not found, request the database to send the encrypted internal index page, decrypt it, cache it, and continue the binary search. If the next level index page is a leaf index page, then request the database to send the encrypted leaf index page, and after decryption, execute the index operation on the leaf index page; The leaf index pages after the indexing operation is completed are encrypted and returned to the database.
8. A database encrypted index access system based on a trusted execution environment, characterized in that, The system implements the steps of the database encrypted index access method based on a trusted execution environment as described in any one of claims 1 to 7 during runtime, and the system includes: The database driver module is used to encrypt plaintext data to be indexed at the field level, generate ciphertext data and send it to the database, and decrypt the ciphertext data returned by the database. The database module is used to receive and store the encrypted data, send index pages to the trusted execution environment module at the index page granularity, and receive and store the encrypted index pages returned by the trusted execution environment module. The Trusted Execution Environment module is used to decrypt the encrypted data to obtain plaintext data, decrypt the index page at the index page level, perform indexing operations on the index page according to the plaintext data, encrypt the index page after the indexing operation at the index page level, and return the encrypted index page to the database module.
9. The system according to claim 8, characterized in that, The trusted execution environment module is also used to cache the decrypted index pages, including the root index page and internal index pages.
10. The system according to claim 8, characterized in that, The database driver module and the trusted execution environment module transmit keys through a secure channel, and the trusted execution environment module caches the keys for decryption and encryption operations.
