A method and apparatus for constructing a ciphertext spatial index based on hierarchical order-preserving encryption

By constructing an AR+ tree index in a spatial database and generating multi-level keys, layered and order-preserving encryption is performed on the plaintext index data, which solves the security risks caused by plaintext storage of vector data, enables fast retrieval and querying in encrypted form, and improves query efficiency and security.

CN120386786BActive Publication Date: 2025-12-02CHINESE ACAD OF SURVEYING & MAPPING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510873515.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-12-02
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

In existing spatial databases, vector data is stored in plaintext, which poses security risks, and traditional encryption techniques result in low query efficiency.

Method used

A ciphertext spatial index construction method based on hierarchical order-preserving encryption is adopted. By creating an AR+ tree index, embedding a security policy and generating multi-level keys, the plaintext data of the index is encrypted hierarchically and in order, enabling fast retrieval and querying in ciphertext state.

Benefits of technology

It improves data security and query efficiency, ensuring that only authorized users can access spatial data within a specific range, reducing unnecessary data decryption and query operations, and enhancing system efficiency and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386786B_ABST
    Figure CN120386786B_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for constructing a ciphertext spatial index based on hierarchical order-preserving encryption, relating to the field of ciphertext spatial index construction. The method includes: embedding a security policy into the nodes of an R+ tree index to obtain an AR+ tree index; generating multi-level keys based on the AR+ tree index; using the multi-level keys to perform hierarchical order-preserving encryption on the plaintext index data, mapping the plaintext index data to ciphertext intervals; parsing the query statement to obtain a query rectangle and user access permissions; performing hierarchical order-preserving encryption on the query rectangle based on the AR+ tree index and multi-level keys, and finding the intersection with the minimum bounding rectangle of each layer's nodes; verifying user access permissions and filtering out all data IDs that meet the conditions; determining the original data ciphertext based on the filtered data IDs; and decrypting the original data ciphertext using the encryption algorithm used when encrypting the original data to obtain the plaintext data. This application enables fast retrieval and querying of spatial indexes in ciphertext mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ciphertext spatial index construction technology, and in particular to a method and apparatus for constructing a ciphertext spatial index based on hierarchical order-preserving encryption. Background Technology

[0002] In the information age, geospatial data has been applied to all aspects of our lives, subtly changing our lifestyles. Vector spatial data, as an important component of geographic data, has been deeply integrated into daily life and social governance. For example, navigation maps use vector road network data to plan travel routes and modes of transportation; management departments use vector layers such as building outlines and underground pipelines to optimize the layout of smart cities; emergency departments use administrative division vector data to simulate the impact range of disasters and formulate rescue plans. The application of vector data is improving our quality of life and ensuring our safety. However, with the advancement of networking and digitalization, while data is convenient to share and use, it is also more susceptible to theft and tampering during storage and transmission, posing a serious challenge to the security of vector geographic data.

[0003] To ensure the convenience and security of vector data during storage, spatial database technology has been widely adopted. Spatial database systems (such as Oracle Spatial and PostGIS), specifically designed for managing spatial data (e.g., geographic locations, geometric figures), support multi-user concurrent editing and transaction control, are compatible with OGC (Open Geospatial Consortium) standards (such as WKT, Well-Known Text, GeoJSON, and JavaScript Object Notation) to enhance interoperability, and are capable of processing massive amounts of spatiotemporal data. With technological advancements, the functionality of spatial databases themselves is constantly expanding. Database encryption technology emerged in the United States in the 1980s, and subsequently, many mainstream database management software programs added encryption modules to their new versions, allowing users to protect data security using encryption functions provided by the database. However, traditional database encryption often requires encrypting the entire database or table, inadvertently encrypting some ordinary data. When querying data, the entire database or table must be decrypted before the query can be performed, leading to over-encryption and inefficiency, especially for large-scale data where full database or table encryption and decryption consumes a significant amount of time. In order to balance data security and retrieval efficiency, it is urgent to research and apply new data protection methods.

[0004] Currently, commonly used vector data protection methods mainly include encryption, digital watermarking, access control, and confidentiality processing. Encryption is a typical preventative measure; it uses keys and encryption algorithms to obscure the original appearance of the data, making it disorganized, and only users with the key can decrypt it. Digital watermarking is a common technique for post-incident investigation; by embedding user identity, usage period, and other information into the original data, it allows for tracing the source of data dissemination after a data security breach, protecting data copyright. Access control primarily uses specified access policies and verifies the identity, permissions, and environment of accessing personnel to strictly control the range and precision of data accessible to different users; it is also an important preventative measure. Confidentiality processing uses mathematical transformations and other methods to reduce the spatial location and elevation accuracy of data and remove sensitive attribute information, allowing the data to be used in public settings after confidentiality processing.

[0005] Access control models are the foundation for implementing access control. To adapt to the characteristics of vector data, researchers have improved traditional access control models, mainly through extensions based on Discretionary Access Control (DAC), Mandatory Access Control (MAC), Role-based Access Control (RABC), and other access control models for specific scenarios. However, spatial access control primarily restricts data access to individuals; those without access rights cannot view the data, and users with different access rights can view different levels of data. It lacks robust protection measures for the data itself, and the data is still stored in plaintext.

[0006] Therefore, how to solve the problem of plaintext data storage in databases has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0007] The purpose of this application is to provide a method and apparatus for constructing a ciphertext spatial index based on hierarchical order-preserving encryption, which can realize fast retrieval and query of the spatial index in ciphertext state.

[0008] To achieve the above objectives, this application provides the following solution.

[0009] In a first aspect, this application provides a method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption, the method comprising the following steps.

[0010] Acquire spatial vector data; the spatial vector data includes several vector space objects.

[0011] Create an R+ tree index for the spatial vector data; the R+ tree index is used to ensure that the bounding rectangles of each vector spatial object do not overlap and cover all feature instances.

[0012] Based on the R+ tree index, the security policy is embedded into the nodes of the R+ tree index to obtain the AR+ tree index, which is the enhanced R+ (Augmented R+, AR+) tree index.

[0013] Based on the AR+ tree index, multi-level keys are generated; the number of keys is related to the number of parent nodes of the AR+ tree index.

[0014] The index plaintext data is encrypted using the multi-level key in a layered, order-preserving manner, mapping the index plaintext data to the ciphertext range.

[0015] The query statement is parsed to obtain the query rectangle and user access permissions.

[0016] The query rectangle is encrypted using the AR+ tree index and the multi-level key in a hierarchical order-preserving manner, and the intersection of the query rectangle with the minimum bounding rectangle (MBR) of each layer node is obtained to obtain the result.

[0017] Based on the obtained results, the user's access permissions are verified, and all data IDs (Identifications) that meet the conditions are filtered out, that is, all unique identifiers of data that meet the conditions are filtered out and put into the result set.

[0018] Based on the data ID in the result set, the original data (Encrypted Extended Well-KnownBinary, EEWKB) is determined.

[0019] The original data ciphertext is decrypted using the same encryption algorithm used to encrypt the original data, yielding plaintext data.

[0020] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for constructing a ciphertext space index based on hierarchical order-preserving encryption.

[0021] Thirdly, this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method for constructing a ciphertext space index based on hierarchical order-preserving encryption.

[0022] Based on the specific embodiments provided in this application, the following technical effects are disclosed.

[0023] This application provides a method and apparatus for constructing a ciphertext spatial index based on hierarchical order-preserving encryption. By acquiring spatial vector data, an R+ tree index is created for the spatial vector data, which effectively organizes the spatial vector data, ensuring that the bounding rectangles of each vector spatial object do not overlap and cover all feature instances. This allows for rapid location of potentially relevant data areas during subsequent queries, improving the efficiency of spatial data retrieval and laying an efficient data organization foundation for subsequent encryption and query operations, reducing query time complexity and data processing complexity. By embedding security policies into the nodes of the R+ tree index, an AR+ tree index is obtained, achieving a tight integration of security mechanisms and data indexing. This enables automatic control and protection of data according to security policies during data storage, retrieval, and access, enhancing data security. Multi-level keys are generated based on the AR+ tree index, meeting the security requirements of data with different security levels. By employing the multi-level key to perform layered, order-preserving encryption on the plaintext index data, mapping the plaintext data to the ciphertext region, both data confidentiality and the sequential characteristics of the encrypted data are guaranteed. This allows for direct comparison and query operations within the encrypted domain without prior decryption, thus improving query efficiency and avoiding the risk of data exposure in plaintext, enhancing data security and privacy. Parsing the query statement yields the query rectangle and user access permissions, accurately extracting the geometric range of the query (query rectangle) and user access permission information. This provides a clear basis for subsequent data filtering based on security policies and encryption mechanisms, ensuring that only authorized users can access spatial data within a specific range, achieving fine-grained access control and further improving data security. By performing layered, order-preserving encryption on the query rectangle based on the AR+ tree index and the multi-level key, and finding the intersection with the minimum bounding rectangle of each layer's nodes, unnecessary data decryption and query operations are reduced, improving query efficiency while ensuring the security of the query process and preventing the decryption and exposure of large amounts of irrelevant data during the query. By verifying the user's access permissions based on the obtained results, filtering out all data IDs that meet the conditions, and placing them into the result set, and determining the original encrypted data based on the data IDs in the result set, it is possible to ensure that only data IDs that meet the security policy and user permissions are placed into the result set. At the same time, it avoids decryption attempts on a large number of irrelevant encrypted data, thereby improving the efficiency of the system.By decrypting the original encrypted data using the same encryption algorithm employed during encryption, plaintext data is obtained. This achieves a more convenient data usage experience for legitimate users while ensuring data security. Users can obtain the required plaintext spatial vector data within authorized limits, meeting the data availability requirements of practical applications. Furthermore, the entire encryption and decryption process, based on previous multi-level keys and security strategies, ensures the security and reliability of the decryption process. To address the problem of plaintext data storage in databases, this application combines an AR+ tree based on the SV_MAC (spatial vector data mandatory access control model) access control model with a hierarchical order-preserving encryption technique based on hypergeometric distribution. An AR+ tree index structure with embedded access strategies is constructed, and randomness is introduced during encryption to maximize security. This design allows for data manipulation in the encrypted state using order preservation, hiding the original data from users. Simultaneously, the application of the index enables data range filtering and permission verification to be performed concurrently, reducing storage space overhead and improving retrieval efficiency. This achieves fine-grained mandatory access control and efficient encrypted querying of spatial data. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram illustrating the technical process of constructing and applying a ciphertext spatial index that integrates order-preserving encryption and AR+ tree, as provided in an embodiment of this application.

[0026] Figure 2 This is a schematic diagram of AR+ tree index partitioning provided in an embodiment of this application.

[0027] Figure 3 This is a schematic diagram of AR+ tree node information provided in an embodiment of this application.

[0028] Figure 4 This is an application environment diagram of a method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to an embodiment of this application.

[0029] Figure 5 This is a flowchart illustrating a method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption, as provided in an embodiment of this application.

[0030] Figure 6This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0033] Spatial vector geographic data is characterized by high precision, ease of storage, and lossless scaling. High-precision vector geographic data involves the accurate geographical locations of sensitive areas and key targets, requiring reasonable and effective protection. Spatial databases provide crucial support for the storage, querying, analysis, and application of vector geographic data through structured and efficient management methods. While spatial database access control models limit access groups to some extent, the plaintext data stored in the database still carries the risk of leakage. Furthermore, traditional spatial databases have a minimum protection granularity of geographic entities, making it impossible to differentiate and protect entity fragments of the same entity at different security levels.

[0034] Currently, researchers have attempted to address the insecurity of plaintext storage using encryption techniques. For example, they have used Order-Preserving Encryption (OPE) to encrypt plaintext, ensuring the ciphertext maintains the same numerical order as the plaintext, facilitating range lookup operations. However, OPE requires mapping plaintext data to ciphertext ranges with the same data format and corresponding size order, raising applicability issues due to format and order preservation concerns. Traditional OPE processes use a single key; if this key is leaked, all data encrypted with that key will be insecure.

[0035] To address this, this application proposes a ciphertext spatial index construction scheme based on order-preserving encryption and Access R+ Tree. This scheme combines BCLO (a order-preserving encryption algorithm proposed by Boldyreva, Chenette, Lee, and O'Neill in 2009) order-preserving encryption with the SV_MAC access control model, thereby achieving fine-grained mandatory access control and efficient encrypted querying of spatial index data. The technical process of constructing and applying the ciphertext spatial index integrating order-preserving encryption and AR+ Tree is described below. (e.g.) Figure 1 (As shown).

[0036] Step 1: Create a regular R+ tree index for the spatial vector geographic data, ensuring that the minimum bounding rectangle of each spatial vector object does not overlap and that it covers all feature instances.

[0037] Step 2: Based on the index partitioning in Step 1, taking into account the data range of R+ tree nodes and the coverage of security policies, decompose and embed the security policies into the nodes of the R+ tree to complete the construction of the AR+ tree.

[0038] Step 3: Based on the AR+ tree index structure created in Step 2, generate multi-level keys and perform hierarchical BCLO order-preserving encryption on the index plaintext data to satisfy the hierarchical partitioning characteristics of the tree index structure and realize the mapping of the index plaintext data to the ciphertext range.

[0039] Step 4: Parse the SQL query statement to obtain the range of the query rectangle and user access permissions, which will be used in Step 5 to match it with the minimum bounding rectangle of the node and the set of security policies.

[0040] Step 5: Based on the index structure generated in Step 2 and the multi-level key generated in Step 3, perform hierarchical order-preserving encryption on the query rectangle and find the intersection with the minimum bounding rectangle of each layer node to verify user permissions, filter out all data IDs that meet the conditions and put them into the result set; perform decryption operation on the original data EEWKB ciphertext corresponding to the ID and return the result to the user.

[0041] Furthermore, in step 2, the security policy embedding specifically includes the following.

[0042] An R+Tree node stores two pieces of information: the node's minimum bounding rectangle and pointers to child nodes or leaf node data items. An AR+Tree is an extension of the R+Tree, introducing access control information into the index node to facilitate subsequent query operations. It can simultaneously perform data retrieval and permission verification, improving query efficiency. During construction, an AR+Tree adds a set of security policies to each node (the specific security policies are defined by the user). The root node receives all policies and stores them in its `label_set`. Intermediate and leaf nodes generate their own policy sets by recursively decomposing the `label_set` of their parent nodes. Parent nodes store all policies, and child nodes obtain the appropriate security policy for the current node by performing an intersection operation between their minimum bounding rectangle and the policy coverage area. Figure 2Taking child node R1 as an example. R1 contains three leaf nodes: R3, R4, and R5. Leaf nodes R4 and R5 are within the coverage of policy M2 and have a secret level. R3 is within the coverage of policy M1 and also has a secret level. The difference is that policy M2 only contains leaf nodes R4 and R5, and M2 is completely within the coverage of R1. Policy M1, in addition to leaf node R3, also contains leaf node R6, and the coverage of M1 spans two child nodes. During policy decomposition, the intersection of policy M1 and child node R1 is needed to obtain the security policy of R1 itself. The index partitioning and node information (including policy decomposition examples) of the AR+ tree are as follows: Figure 2 and Figure 3 As shown. The root node is defined by its minimum bounding rectangle (MBR). The root node contains two child nodes, R1 and R2, and three security regions cover all data. The root node index stores the node's MBR, child node numbers, and policy set `label_set`. The policies of intermediate nodes are inherited from their parent nodes and decomposed based on the security label range covering the current region. The leaf nodes store the identifier of the space element instance, its minimum bounding rectangle, and the associated policy number.

[0043] Furthermore, in step 3, the multi-level key generation specifically includes the following steps.

[0044] To enhance the security of order-preserving encryption, this application utilizes the hierarchical nature of index trees to design a multi-level key generation method. Multi-level means that different keys are generated based on the parent node; different levels use different keys, and even within the same level, different parent nodes use different encryption keys. This ensures that even if one key is cracked, an attacker cannot obtain all the plaintext data, and data encrypted with other keys remains secure. The key at the root node is randomly generated, and the keys for child nodes are derived using a pseudo-random function (PRF). The number of child node keys is the same as the number of parent node keys, specifically generated using the following formula.

[0045] (1).

[0046] in, The encryption key for the current node. It is a pseudo-random function. The parent node key. The ID of the current node. For the set of strategies for a node.

[0047] Key at the root node The keys are randomly generated, and the keys of child nodes are derived from the keys of parent nodes. The keys generated at each level are recorded in the KeyMap table. Subsequent query operations can retrieve the corresponding level's key from the KeyMap table to encrypt the range data of the query rectangle.

[0048] Furthermore, in step 3, the parameter passing mechanism specifically includes the following:

[0049] Each level of node requires four input parameters when performing BCLO order-preserving encryption: key K, plaintext range of the parent node, ciphertext range of the parent node, and data to be encrypted. Therefore, the corresponding parameters need to be passed to the data node to be encrypted. The key can be generated by formula (1). The ciphertext range of the parent node is known data after encryption, while the plaintext range of the parent node needs to be obtained through the reverse order-preserving encryption process, as shown in formula (2).

[0050] (2).

[0051] in, The plaintext range for the intermediate nodes; The ciphertext range of the parent node; The ciphertext range of the intermediate node; It is an order-preserving encryption algorithm based on hypergeometric distribution.

[0052] Furthermore, in step 3, the layered order-preserving encryption specifically includes the following:

[0053] Order-preserving encryption maintains the same numerical order as plaintext. While this facilitates data retrieval in ciphertext, it exposes the plaintext order. Because ciphertext strictly preserves the plaintext order, attackers can infer plaintext information by analyzing its statistical characteristics (such as numerical distribution and spacing patterns), potentially leading to information leakage. To address this issue and maximize the security of order-preserving encryption, this application employs the BCLO order-preserving encryption algorithm. The BCLO algorithm uses the pseudo-random function TapeGen to generate a pseudo-random bitstream, introducing randomness into the encryption process and preventing attackers from inferring the key or plaintext by observing the ciphertext pattern.

[0054] To dynamically adapt to the hierarchical partitioning characteristics of tree-based index structures, this application proposes a hierarchical order-preserving encryption (HOPE) method based on the construction of elastic order-preserving ciphertext mapping intervals. Its core idea is to recursively encrypt layer by layer, using the ciphertext range of the parent node as the input domain for the encryption of child nodes, thereby maintaining a spatial partitioning logic consistent with the plaintext index in the ciphertext space. The specific implementation steps of HOPE are shown below.

[0055] (1) Root node encryption: The root node represents the range of all data to be encrypted. Let its plaintext coordinate range be... The order-preserving encryption algorithm BCLO based on hypergeometric distribution can map data from plaintext intervals to ciphertext intervals, and the mapping formula is shown below.

[0056] (3).

[0057] in, The root node is the ciphertext space; This is the key at the root node; This is the plaintext space for the root node.

[0058] In the plaintext state, the smallest bounding rectangle represented by each level node is a subset of its parent node at the next higher level, and sibling nodes do not overlap. To ensure that the ciphertext intervals at each level maintain the same hierarchical relationship after encryption, the length of the ciphertext interval must satisfy the following condition. ,in As the expansion factor, in this embodiment, let .

[0059] (2) Dynamic recursive encryption of child nodes: The encryption formula for child nodes is shown below.

[0060] (4).

[0061] in, For the ciphertext space of child nodes; This is the encryption key for the current node; This represents the plaintext range of the current node.

[0062] The encryption key for child nodes is generated according to formula (1). Based on the property that the ciphertext and plaintext are in the same order after encryption, the encrypted child nodes should satisfy the constraint. To enhance security, the length of the ciphertext interval in the child node should meet the following requirements. Through the expansion factor Resist frequency analysis attacks.

[0063] (3) Leaf Node Layered Encryption: Before the leaf node, there are several intermediate nodes in addition to the root node. Each intermediate node recursively executes the encryption operation of the previous step, generating the corresponding encryption key. Assume the path from the root node to a certain leaf node is... The corresponding key sequence is The formula for calculating the ciphertext at the leaf node is as follows.

[0064] (5).

[0065] in, For leaf node ciphertext space; The key at the leaf node; The x-coordinate value of the coordinate to be encrypted; For the plaintext range of the parent node, by... Substituting into formula (2) yields The ciphertext range of the parent node.

[0066] (4) Order Preservation and Ciphertext Mapping Interval Consistency Verification: In order to ensure that the encrypted data at each level conforms to the characteristics of order preservation encryption, it is necessary to verify the constraints layer by layer. This ensures that the numerical order of the plaintext interval is correctly mapped to the ciphertext interval. If a node violates this constraint after encryption, a dynamic re-encryption process is triggered, adjusting the key or expansion factor until the condition is met.

[0067] Furthermore, in step 5, the query rectangle encryption specifically includes the following:

[0068] Through steps 1 to 3, the AR+ tree has been constructed and the plaintext has been encrypted in order-preserving manner. Based on this, the encrypted data can be queried for its ciphertext status. To adapt to the AR+ tree construction method and order-preserving encryption method described above, and to achieve efficient and secure querying, this application specifically designs a range retrieval method, mainly including layer-by-layer encryption of the query window and matching verification of security policies and user permissions. The query rectangle in the user-submitted query conditions... It is a two-dimensional spatial range, let its range be . When executing the retrieval logic, the system needs to decompose it into independent coordinate intervals along the x and y axes. and Each part is encrypted separately. The specific operation process for spatial retrieval is shown below.

[0069] (1) Root node processing: To complement the hierarchical logic of the aforementioned method, range queries also need to be executed in hierarchical order. First, verify whether the user has permission to access the data in the data table. Check the root node. policy_map Does it contain the user permission tag? The access policy allows for the immediate termination of queries if a user lacks sufficient permissions, preventing subsequent operations from being executed ineffectively. Secondly, if the data table contains data that the user has the right to access, the root node encryption key is retrieved from the KeyMap key table. and For the root node ciphertext space Performing reverse order-preserving mapping yields the plaintext space. Again, for the query rectangle Find the intersection of the plaintext MBR with the root node. If there is no intersection, return an empty result; if there is an intersection, return the intersection result. ,make The overlapping area between the query rectangle and the root node MBR is obtained and used as the next level query window for further retrieval. Finally, the encryption key of the child node corresponding to the root node is obtained from the KeyMap. and The trimmed query window, user permission label, and root node encrypted space will be... Root node plaintext space Key and Pass it to the next level node.

[0070] (2) Recursive processing of child nodes: Assume the current processing node is located at the th node. i First, the query rectangle after recursive trimming is encrypted using the key passed from the previous level. and Parent node MBR ciphertext He Mingwen As input, encrypted query window Get the corresponding ciphertext window The encrypted window is then compared with the encrypted MBR of the current node to select the set of intersecting child nodes. Then, iterate through the set. Each node policy_map Verify whether the user permission tag is included. The access policy allows nodes with matching permissions to be retained, while nodes with insufficient access permissions are removed from the set. Delete them. Finally, iterate through the set of child nodes that have passed the filtering. Retrieve the keys corresponding to each child node from the KeyMap. and And crop the overlapping area between the query rectangle and the encrypted MBR of the child node. As a next-level query window. For collections For each element in the stack, the corresponding key, the plaintext space of the parent node, and the ciphertext space of the parent node are pushed onto the stack as function inputs. The operation of the child node is repeated until the child node is a leaf node.

[0071] (3) Leaf node processing: Through the above query window comparison and clipping and permission verification, it can be determined that the leaf node meets the query conditions. Therefore, there is no need to perform window clipping and permission verification operations in the leaf node. The data ID corresponding to the leaf node that meets the conditions is directly included in the result set.

[0072] (4) Decryption of results: Traverse the result set obtained in the previous step, find the corresponding original data ciphertext for each data ID, execute the encryption algorithm used when encrypting the original data to decrypt and obtain the plaintext data, and return the queried plaintext data to the user.

[0073] This application realizes fine-grained access control for the ciphertext state of database index fields by integrating AR+trees and hierarchical order-preserving encryption. Compared with existing methods, it has the following two advantages.

[0074] (1)It solves the risk of plaintext exposure when the database stores spatial vector data, allowing users to perform data query operations in the ciphertext state.

[0075] Spatial vector data is characterized by large data volume and complex structure and is often stored in a spatial database. In addition to storing vector data, the spatial database also supports indexing and query operations on vector data. Storing data in the database enables multi-person sharing of data. Through the API (Application Programming Interface), spatial data can be queried in real time without the need to perform data transmission operations for each user. To ensure the secure storage of vector data in the database, numerous access control models have been designed to restrict users' query permissions, departments, locations, query times, etc., strictly limiting the data content that different users can access and effectively guaranteeing the security during the storage process of vector data. However, the data stored in the database is raw data, and users can see the true appearance of the data, still posing a risk of data leakage.

[0076] To solve the problem of plaintext storage in the database, this application introduces order-preserving encryption technology. Order-preserving encryption is a special encryption technology whose core feature is that the ciphertext after encryption can maintain the same order relationship as the plaintext. For example, if the plaintext numbers satisfy a < b, then E(a) < E(b) still holds for the encrypted ciphertext. This feature is achieved through specific mathematical algorithms, allowing range queries, sorting, etc. to be directly performed on the ciphertext without decryption, especially suitable for scenarios that require protecting data privacy but rely on order analysis (such as index queries in the database). This application combines AR+trees with order-preserving encryption, uses indexes to improve retrieval efficiency, and realizes fine-grained access to data through the AR+tree and SV_MAC mandatory access control model. By integrating spatial retrieval and permission verification, subtrees or data items that users have no right to access can be filtered in real time during the query process, avoiding the establishment of an R+tree for security policies, and improving both time and space efficiency. SV_MAC achieves fine-grained access control by splitting the geometric distribution of spatial objects into multiple sub-blocks and assigning independent security labels to each sub-block. This mechanism not only covers all vector data but also avoids redundant authorization determination through dynamic cropping technology, thus taking into account system performance while ensuring security.

[0077] (2)This application proposes a multi-level key generation method for the security requirements of order-preserving encryption and the tree-shaped index structure, making the encrypted data more secure.

[0078] Data is divided into multiple encryption units according to the hierarchical structure of the index tree and its parent node. Each encryption unit requires a dedicated encryption key during encryption, meaning each key is only responsible for encrypting a portion of the data. The theft of a single key only exposes a portion of the data, avoiding the "total loss" security risk inherent in traditional single-key systems. Attackers must crack all keys simultaneously to obtain complete information, significantly increasing the cost of attacks and ensuring overall data security.

[0079] Points on the plane are represented by binary coordinates, with spatial coordinates consisting of x and y coordinate values. During encryption, x and y are encrypted separately, and the x-axis key and y-axis key are generated from different PRF branches to ensure that the encryption processes of the two dimensions are independent of each other and to avoid the risk of key cross-leakage.

[0080] The ciphertext space index construction method based on hierarchical order-preserving encryption provided in this application can be applied to, for example... Figure 4In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on other servers. Terminal 102 can send acquired spatial vector data to server 104, the spatial vector data including several vector spatial objects; after receiving the spatial vector data, server 104 creates an R+ tree index for the spatial vector data; the R+ tree index is used to ensure that the bounding rectangles of each vector spatial object do not overlap and cover all feature instances; based on the R+ tree index, security policies are embedded into the nodes of the R+ tree index to obtain an AR+ tree index; based on the AR+ tree index, multi-level keys are generated; the number of keys is related to the number of parent nodes of the AR+ tree index; using the multi-level keys... The system performs hierarchical order-preserving encryption on the plaintext index data using a multi-level key, mapping the plaintext index data to a ciphertext region. The query statement is parsed to obtain the query rectangle and user access permissions. Based on the R+ tree index and the multi-level key, the query rectangle is subjected to hierarchical order-preserving encryption, and its intersection with the minimum bounding rectangle of each layer's nodes is calculated to obtain the result. Based on the result, the user access permissions are verified, all matching data IDs are filtered out, and added to the result set. Based on the data IDs in the result set, the original data ciphertext is determined. The original data ciphertext is decrypted using the encryption algorithm used during the original data encryption to obtain the plaintext data. The server 104 can then feed the obtained plaintext data back to the terminal 102. Furthermore, in some embodiments, the method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly construct a ciphertext spatial index based on hierarchical order-preserving encryption for spatial vector data, or the server 104 can obtain spatial vector data from the data storage system and construct a ciphertext spatial index based on hierarchical order-preserving encryption for the spatial vector data.

[0081] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, and tablets. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.

[0082] In one exemplary embodiment, such as Figure 5 As shown, a method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 4Taking server 104 as an example, the explanation includes the following steps S1 to S10.

[0083] S1: Obtain spatial vector data; the spatial vector data includes several vector space objects.

[0084] S2: Create an R+ tree index for the spatial vector data; the R+ tree index is used to ensure that the bounding rectangles of each vector spatial object do not overlap and cover all feature instances.

[0085] S3: Based on the R+ tree index, the security policy is embedded into the nodes of the R+ tree index to obtain the AR+ tree index.

[0086] S4: Generate multi-level keys based on the AR+ tree index; the number of keys is related to the number of parent nodes of the AR+ tree index.

[0087] S5: The index plaintext data is encrypted using the multi-level key in a layered and order-preserving manner, and the index plaintext data is mapped to the ciphertext range.

[0088] S6: Parse the query statement to obtain the query rectangle and user access permissions.

[0089] S7: Based on the AR+ tree index and the multi-level key, perform hierarchical order-preserving encryption on the query rectangle, and find the intersection with the minimum bounding rectangle of each layer node to obtain the result.

[0090] S8: Based on the obtained results, verify the user's access permissions, filter out all data IDs that meet the conditions, and put them into the result set.

[0091] S9: Determine the original encrypted data based on the data ID in the result set.

[0092] S10: Decrypt the original data ciphertext using the encryption algorithm used when encrypting the original data to obtain plaintext data.

[0093] As an optional implementation, in step S3, based on the R+ tree index, the security policy is embedded into the nodes of the R+ tree index to obtain the AR+ tree index, which specifically includes the following:

[0094] S31: Determine the node data range and security policy coverage of the R+ tree index.

[0095] S32: Based on the coverage of the security policy, decompose the security policy to obtain several security policies.

[0096] S33: Based on the node data range of the R+ tree index, the security policy is embedded into the nodes of the R+ tree index to obtain the AR+ tree index.

[0097] As an optional implementation, in step S4, a multi-level key is generated based on the AR+ tree index, specifically including the following:

[0098] S41: Based on the AR+ tree index, a number of pseudo-random bit streams are generated using a pseudo-random function.

[0099] S42: Generate a multi-level key based on the aforementioned pseudo-random bit streams.

[0100] As an optional implementation, in step S5, the index plaintext data is encrypted using the multi-level key in a layered and order-preserving manner, mapping the index plaintext data to the ciphertext range, specifically including the following:

[0101] S51: Based on the index plaintext data, determine the plaintext range of the root node, the plaintext range of the child nodes, and the plaintext range of the leaf nodes; the plaintext range of the root node is directly defined by global parameters; the plaintext ranges of the child nodes and the plaintext ranges of the leaf nodes are both ranges obtained by decrypting the ciphertext range of the parent node; the ciphertext range of the parent node is known data after encryption.

[0102] S52: The order-preserving encryption algorithm based on hypergeometric distribution encrypts the root node, mapping the plaintext range of the root node to the ciphertext range.

[0103] S53: Employ a dynamic recursive algorithm to encrypt child nodes, mapping the plaintext range of the child nodes to the ciphertext range.

[0104] S54: Based on the path from the root node to the leaf node, encrypt the leaf node and map the plaintext range of the leaf node to the ciphertext range.

[0105] This application also provides an application scenario in which the above-described method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption is applied. Specifically, the method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption provided in this embodiment can be applied in a ciphertext spatial index construction scenario. The encrypted spatial index construction scenario includes: AR+ tree construction, hierarchical BCLO order-preserving encryption, query rectangle range determination, user access permission determination, and matching. First, a regular R+ tree index is created for the spatial vector geographic data, ensuring that the minimum bounding rectangle of each spatial vector object does not overlap and covers all feature instances. Based on the index partitioning, considering the data range of R+ tree nodes and the coverage of security policies, the security policies are decomposed and embedded into the nodes of the R+ tree, completing the AR+ tree construction. Second, based on the created AR+ tree index structure, multi-level keys are generated, and hierarchical BCLO order-preserving encryption is applied to the plaintext index data to satisfy the hierarchical partitioning characteristics of the tree index structure, thus mapping the plaintext index data to the encrypted range. Then, the SQL query statement is parsed to obtain the range of the query rectangle and user access permissions. Finally, based on the generated index structure and the generated multi-level keys, hierarchical order-preserving encryption is applied to the query rectangle, and the intersection with the minimum bounding rectangle of each layer node is calculated to verify user permissions. All data IDs that meet the conditions are filtered and placed into the result set. The original encrypted data corresponding to the ID is decrypted using the same algorithm used for encryption, and the result is returned to the user.

[0106] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores spatial vector data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption.

[0107] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0108] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method embodiments.

[0109] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the above-described method embodiments.

[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0111] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0112] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption, characterized in that, The method for constructing a ciphertext space index based on hierarchical order-preserving encryption includes: Acquire spatial vector data; the spatial vector data includes several vector space objects; Create an R+ tree index for the spatial vector data; the R+ tree index is used to ensure that the bounding rectangles of each vector spatial object do not overlap and cover all feature instances; Based on the R+ tree index, security policies are embedded into the nodes of the R+ tree index to obtain the AR+ tree index. During the construction process, the AR+ tree adds a set of security policies to each node. The root node receives all policies and stores them in the root node's label_set. Intermediate nodes and leaf nodes generate their own policy sets by recursively decomposing the label_set set of the parent node. The parent node stores all policies. The child node obtains the security policy suitable for the current node by performing an intersection operation based on its own minimum bounding rectangle range and the policy coverage range. Based on the AR+ tree index, multi-level keys are generated; the number of keys is related to the number of parent nodes in the AR+ tree index. The index plaintext data is encrypted using the multi-level key in a layered, order-preserving manner, mapping the index plaintext data to the ciphertext range; The query statement is parsed to obtain the query rectangle and user access permissions; Based on the AR+ tree index and the multi-level key, the query rectangle is encrypted in a hierarchical order-preserving manner, and the intersection with the minimum bounding rectangle of each layer node is calculated to obtain the result. Based on the obtained results, verify the user's access permissions, filter out all data IDs that meet the conditions, and put them into the result set; Based on the data IDs in the result set, the original encrypted data is determined; The original ciphertext is decrypted using the encryption algorithm used during encryption to obtain plaintext data.

2. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 1, characterized in that, Based on the R+ tree index, security policies are embedded into the nodes of the R+ tree index to obtain the AR+ tree index, specifically including: Determine the node data range and security policy coverage of the R+ tree index; Based on the coverage of the security policy, the security policy is decomposed to obtain several security policies; Based on the node data range of the R+ tree index, the security policy is embedded into the nodes of the R+ tree index to obtain the AR+ tree index.

3. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 1, characterized in that, Based on the AR+ tree index, a multi-level key is generated, specifically including: Based on the AR+ tree index, a number of pseudo-random bit streams are generated using a pseudo-random function; Based on the aforementioned pseudo-random bit streams, a multi-level key is generated.

4. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 3, characterized in that, The expression for generating the multi-level key is: ; in, The encryption key for the current node. It is a pseudo-random function. The parent node key. The ID of the current node. This is the set of strategies for a node.

5. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 1, characterized in that, The index plaintext data is encrypted using the multi-level key in a layered, order-preserving manner, mapping the index plaintext data to a ciphertext region. Specifically, this includes: Based on the index plaintext data, the plaintext range of the root node, the plaintext range of the child nodes, and the plaintext range of the leaf nodes are determined; the plaintext range of the root node is directly defined by global parameters; the plaintext ranges of the child nodes and the plaintext ranges of the leaf nodes are both obtained by decrypting the ciphertext range of the parent node; the ciphertext range of the parent node is known data after encryption. The order-preserving encryption algorithm based on hypergeometric distribution encrypts the root node, mapping the plaintext range of the root node to the ciphertext range. A dynamic recursive algorithm is used to encrypt child nodes, mapping the plaintext range of the child nodes to the ciphertext range; Based on the path from the root node to the leaf node, the leaf node is encrypted, mapping the plaintext range of the leaf node to the ciphertext range.

6. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 5, characterized in that, The order-preserving encryption algorithm based on hypergeometric distribution encrypts the root node. The formula for mapping the plaintext interval of the root node to the ciphertext interval is: ; in, The root node is the ciphertext space; It is an order-preserving encryption algorithm based on hypergeometric distribution; This is the key at the root node; This is the plaintext space for the root node.

7. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 5, characterized in that, The encryption formula for encrypting child nodes using a dynamic recursive algorithm is as follows: ; in, For the ciphertext space of child nodes; It is an order-preserving encryption algorithm based on hypergeometric distribution; This is the encryption key for the current node; This represents the plaintext range of the current node.

8. The method for constructing a ciphertext spatial index based on hierarchical order-preserving encryption according to claim 5, characterized in that, The encryption formula for encrypting leaf nodes is: ; in, For leaf node ciphertext space; It is an order-preserving encryption algorithm based on hypergeometric distribution; The key at the leaf node; The x-coordinate value of the coordinate to be encrypted; The plaintext range of the parent node; The ciphertext range of the parent node.

9. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method for constructing a ciphertext space index based on hierarchical order-preserving encryption as described in any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method for constructing a ciphertext space index based on hierarchical order-preserving encryption as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Average-complexity ideal-security order-preserving encryption

    CN104657673A

  • Security semantic perception search method for dynamic spatial data in Internet of Vehicles

    CN113254743A