Searchable encryption method, computer device, storage medium and computer program product

Through the model framework of the trusted execution environment and cloud server working together, the problems of low retrieval efficiency and non-support for fuzzy search in existing searchable encryption technologies are solved, efficient and secure data retrieval and fuzzy search are achieved, and computing costs and resource consumption are reduced.

CN119513877BActive Publication Date: 2025-10-03ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411637379.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-10-03
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

Existing searchable encryption technologies have low retrieval efficiency and do not support fuzzy search when faced with massive outsourced data and a large number of on-demand data requests.

Method used

A model framework that uses a trusted execution environment and cloud servers to work together, performs secure keyword matching and index tagging through the trusted execution environment, and combines AES-GCM and RSA algorithms to achieve efficient keyword retrieval and fuzzy search.

Benefits of technology

It improves data retrieval efficiency, supports fuzzy search, reduces computing costs and resource consumption, protects data privacy, prevents data leakage, and enhances security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513877B_ABST
    Figure CN119513877B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a searchable encryption method, computer device, storage medium, and computer program product, relating to the field of searchable encryption technology. The method comprises: a cloud server receives a data outsourcing request from a data provider; sends a keyword set ciphertext to a trusted execution environment; the trusted execution environment uses a keyword set key to obtain a keyword set plaintext; the cloud server forwards a data retrieval request to the trusted execution environment; the trusted execution environment uses a private key in a first key pair to decrypt the combined ciphertext to obtain the keyword to be retrieved and a re-encryption key; the trusted execution environment obtains the file data to be retrieved based on the keyword to be retrieved; the trusted execution environment uses the re-encryption key to obtain the re-encrypted file data and sends the re-encrypted file data to a data acquirer; the data acquirer uses the re-encryption key to obtain the file data to be retrieved. This method improves data retrieval efficiency and supports fuzzy search of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of searchable encryption technology, and in particular to a searchable encryption method, computer device, storage medium, and computer program product. Background Art

[0002] Cloud storage offers a solution for data owners with limited storage and computing capabilities, allowing them to outsource their data to the cloud and gain convenient shared data access. However, when data storage and management services are provided by unreliable third parties, data security issues arise. Therefore, searchable encryption technology is needed to provide ciphertext retrieval services even for servers with low trustworthiness.

[0003] Current searchable encryption technologies preserve server-side search capabilities while effectively preventing data leakage and unauthorized access. However, faced with massive outsourced data files and a large number of users requesting on-demand data, existing searchable encryption technologies still suffer from low retrieval efficiency and a lack of support for fuzzy search. Summary of the Invention

[0004] Based on this, it is necessary to provide a searchable encryption method, computer device, storage medium and computer program product to address the above technical problems.

[0005] In a first aspect, the present application provides a searchable encryption method. The method comprises:

[0006] The cloud server receives a data outsourcing request sent by a data provider; the data outsourcing request includes a first user identifier and a ciphertext of a file to be outsourced; the ciphertext of the file to be outsourced includes a keyword set ciphertext and a file set ciphertext; and there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;

[0007] The cloud server sends the keyword set encrypted text to the trusted execution environment;

[0008] The trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext;

[0009] The cloud server receives a data retrieval request sent by a data acquirer and forwards the data retrieval request to the trusted execution environment; the data retrieval request includes a second user identifier and a ciphertext of a file to be retrieved; the ciphertext of the file to be retrieved includes a ciphertext composed of a keyword to be retrieved and a re-encryption key; the ciphertext composed is encrypted using a public key of a first key generated by the trusted execution environment;

[0010] The trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext;

[0011] The trusted execution environment obtains the to-be-retrieved file data corresponding to the to-be-retrieved keyword according to the to-be-retrieved keyword;

[0012] The trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

[0013] In one embodiment, before the cloud server receives the data outsourcing request sent by the data provider, it also includes: the trusted execution environment receives a second key pair for the file to be outsourced sent by the data provider; the second key pair includes the keyword set key and the file set key.

[0014] In one embodiment, before the trusted execution environment receives the data retrieval request sent by the cloud server, it also includes: the trusted execution environment generates the first key pair; the trusted execution environment sends the public key in the first key pair to the data acquirer; the public key is used to encrypt the keyword to be retrieved and the re-encryption key of the data acquirer.

[0015] In one embodiment, the trusted execution environment obtains the file data to be obtained corresponding to the keyword to be retrieved based on the keyword to be retrieved, including: the trusted execution environment obtains the matching keyword index of the keyword to be retrieved in the pre-stored plaintext of the keyword set based on the keyword to be retrieved; and obtains the file data to be obtained corresponding to the keyword to be retrieved based on the matching keyword index.

[0016] In one embodiment, obtaining the file data to be obtained corresponding to the keyword to be retrieved based on the matching keyword index includes: the trusted execution environment sending the matching keyword index to the cloud server; the cloud server determining the corresponding target file index based on the matching keyword index, and obtaining the corresponding file data ciphertext to be obtained of the file data to be obtained based on the target file index; the cloud server sending the file data ciphertext to be obtained to the trusted execution environment; the trusted execution environment decrypting the file data ciphertext to be obtained using the file set key in the second key pair to obtain the file data to be obtained.

[0017] In one embodiment, obtaining the matching keyword index of the keyword to be retrieved in the pre-stored plaintext of the keyword set based on the keyword to be retrieved includes: obtaining the keyword distance between the keyword to be retrieved and each of the multiple file keywords in the plaintext of the keyword set; and determining the matching keyword index among the multiple file keywords based on the keyword distance.

[0018] In one embodiment, determining the matching keyword index among the multiple file keywords based on the keyword distance includes: if the keyword distance is less than a first distance threshold, determining the file keyword corresponding to the keyword distance as the matching keyword index; if there is no keyword distance less than the first distance threshold, determining the file keyword less than or equal to a second distance threshold as the matching keyword index; the second distance threshold is greater than the first distance threshold.

[0019] In a second aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0020] The cloud server receives a data outsourcing request sent by a data provider; the data outsourcing request includes a first user identifier and a ciphertext of a file to be outsourced; the ciphertext of the file to be outsourced includes a keyword set ciphertext and a file set ciphertext; and there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;

[0021] The cloud server sends the keyword set encrypted text to the trusted execution environment;

[0022] The trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext;

[0023] The cloud server receives a data retrieval request sent by a data acquirer and forwards the data retrieval request to the trusted execution environment; the data retrieval request includes a second user identifier and a ciphertext of a file to be retrieved; the ciphertext of the file to be retrieved includes a ciphertext composed of a keyword to be retrieved and a re-encryption key; the ciphertext composed is encrypted using a public key of a first key generated by the trusted execution environment;

[0024] The trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext;

[0025] The trusted execution environment obtains the to-be-retrieved file data corresponding to the to-be-retrieved keyword according to the to-be-retrieved keyword;

[0026] The trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

[0027] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0028] The cloud server receives a data outsourcing request sent by a data provider; the data outsourcing request includes a first user identifier and a ciphertext of a file to be outsourced; the ciphertext of the file to be outsourced includes a keyword set ciphertext and a file set ciphertext; and there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;

[0029] The cloud server sends the keyword set encrypted text to the trusted execution environment;

[0030] The trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext;

[0031] The cloud server receives a data retrieval request sent by a data acquirer and forwards the data retrieval request to the trusted execution environment; the data retrieval request includes a second user identifier and a ciphertext of a file to be retrieved; the ciphertext of the file to be retrieved includes a ciphertext composed of a keyword to be retrieved and a re-encryption key; the ciphertext composed is encrypted using a public key of a first key generated by the trusted execution environment;

[0032] The trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext;

[0033] The trusted execution environment obtains the to-be-retrieved file data corresponding to the to-be-retrieved keyword according to the to-be-retrieved keyword;

[0034] The trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

[0035] In a fourth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0036] The cloud server receives a data outsourcing request sent by a data provider; the data outsourcing request includes a first user identifier and a ciphertext of a file to be outsourced; the ciphertext of the file to be outsourced includes a keyword set ciphertext and a file set ciphertext; and there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;

[0037] The cloud server sends the keyword set encrypted text to the trusted execution environment;

[0038] The trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext;

[0039] The cloud server receives a data retrieval request sent by a data acquirer and forwards the data retrieval request to the trusted execution environment; the data retrieval request includes a second user identifier and a ciphertext of a file to be retrieved; the ciphertext of the file to be retrieved includes a ciphertext composed of a keyword to be retrieved and a re-encryption key; the ciphertext composed is encrypted using a public key of a first key generated by the trusted execution environment;

[0040] The trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext;

[0041] The trusted execution environment obtains the to-be-retrieved file data corresponding to the to-be-retrieved keyword according to the to-be-retrieved keyword;

[0042] The trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

[0043] The aforementioned searchable encryption method, computer device, storage medium, and computer program product innovatively construct a model framework for collaborative searchable encryption using a trusted execution environment (TEE) and a cloud server, enabling the two to operate as independent entities. This framework delegates the storage of large-scale ciphertext outsourced data to the cloud server, while the TEE performs secure keyword matching and index tagging. This method allows a single data provider to remotely store and manage data on a cloud server, enabling data sharing with multiple authorized data accessors. Leveraging its secure isolation mechanism, the TEE acquires and manages keys through remote authentication, enabling decryption. The TEE then collaborates with the cloud server to perform retrieval operations. Furthermore, proxy re-encryption is implemented for data accessors through the TEE. By using the TEE instead of an additional cloud service provider, collusion between the two servers is prevented. When responding to retrieval requests from multiple users, tagging the target index eliminates the need to repeatedly and sequentially scan all stored ciphertext files, enabling efficient keyword retrieval. The hybrid use of the AES-GCM and RSA algorithms further improves retrieval efficiency in one-to-many scenarios and reduces computational overhead. This method hides the encryption method and content of outsourced data from the cloud server, protecting the privacy of the searchable keywords. The method provided in the embodiments of the present application, on the one hand, can be combined with a trusted execution environment (TEE) and a cloud server to collaboratively implement a searchable encryption model framework. The cloud server can store large amounts of data, and the TEE can assist in retrieval calculations, reducing the computational cost and resource consumption during the searchable encryption process and improving computational efficiency. Furthermore, the cloud server cannot obtain any information about the plaintext data or the searchable keywords during the entire process. Hybrid encryption of file data prevents the leakage of the identity information of the data provider and data acquirer, as well as the leakage of file data, improving the security of the searchable encryption process. Furthermore, it improves data retrieval efficiency and supports fuzzy data searches. Furthermore, it overcomes the limitation of traditional single-keyword support for exact matches, increasing the flexibility of searchable encryption. Specifically, through the joint model framework of the TEE and the cloud server, a fuzzy keyword retrieval scheme is implemented. This scheme uses an edit distance algorithm to measure the similarity between keywords, and can tolerate incomplete matches (such as minor typos or formatting inconsistencies) between the searchable keywords entered by the data acquirer and the preset keywords. By setting the edit distance threshold, a balance between exact matching and fuzzy matching is achieved, and similarity search is supported to meet the complex retrieval needs of multiple users in a cloud environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 A flowchart of a searchable encryption method provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the structure of a searchable encryption system provided in an embodiment of the present application;

[0047] Figure 3 A flowchart of another searchable encryption method provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a process for generating a keyword set ciphertext and a file set ciphertext provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of a process for obtaining file data to be obtained provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of a process for obtaining a matching identifier index based on a matching keyword index provided in an embodiment of the present application;

[0051] Figure 7 A flowchart of a keyword index matching process provided in an embodiment of the present application;

[0052] Figure 8 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0054] In an exemplary embodiment, Figure 1 As shown, a searchable encryption method is provided. This embodiment uses the method applied to a trusted execution environment of a searchable encryption system as an example for illustration. It is understandable that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0055] Step 102: The cloud server receives a data outsourcing request sent by a data provider.

[0056] Among them, such as Figure 2 As shown, the searchable encryption method of the embodiment of the present application can be applied to a searchable encryption system, which may include a cloud server, a trusted execution environment, a data provider, and a data acquirer. The data provider can outsource the data storage to the cloud server, and the data acquirer can be an authorized user of the searchable encryption system and can obtain data from the cloud server. The trusted execution environment can be a Trusted Execution Environment (TEE), which is a security mechanism built into a computing system. TEE creates a secure environment through hardware technology to ensure the security of the code and data running therein, preventing attackers from accessing or tampering. Figure 3 As shown, in one possible way, the searchable encryption technology can be used to complete the searchable encryption method of the embodiment of the present application, so as to realize remote data storage and data management of the data provider's data, and data sharing with the data acquirer. The searchable encryption process may include parts such as the system initialization stage, the data outsourcing stage, the offline loading stage, the online retrieval stage, the proxy re-encryption stage and the result return stage. Among them, in this system initialization stage, the data provider (also referred to as the data owner DO) can use a symmetric key generation algorithm (for example, the AES-GCM algorithm) to generate two symmetric keys, namely a second key pair. The second key pair may include a keyword set key K1 and a file set key K2. The keyword set key K1 can be used to encrypt the keyword set of the outsourced file to obtain the keyword set ciphertext. The file set key K2 can be used to encrypt the file set of the outsourced file to obtain the file set ciphertext. In one possible implementation method,

[0057]

[0058] In addition, the data provider can establish a secure channel with the trusted execution environment TEE through remote authentication and pass the key to the server through the channel. The data acquirer can use a symmetric key generation algorithm (for example, AES-GCM algorithm) to generate a symmetric key K0, and also establish a secure channel with the trusted execution environment TEE through remote authentication. Subsequently, the trusted execution environment will pass the public key to the trusted execution environment TEE. The data is transmitted to the data acquirer through a secure channel. The cloud server does not have any key information and is only responsible for storing and managing outsourced data. The trusted execution environment can use a symmetric key generation algorithm (for example, the RSA algorithm) to generate a first key pair. The first key pair may include a public key and a private key, and the public key is sent to the data acquirer (also called the requesting user RU). Different data acquirers have different public keys, and the private key is sent to the data acquirer. Uniquely and securely stored in its isolated environment. Related parameters The decimal example is as follows:

[0059]

[0060]

[0061]

[0062]

[0063]

[0064] Furthermore, in the key management of the system model, on the one hand: the data provider establishes a secure channel with the trusted execution environment TEE through remote authentication, and transmits the key through the channel. On the other hand: the data acquirer also establishes a secure channel with the trusted execution environment TEE through remote authentication, and then the trusted execution environment The data is transmitted to the data acquirer through a secure channel. The cloud server does not hold any key information and is only responsible for storing and managing outsourced data.

[0065] For ease of demonstration, the offset is shared uniformly between the data provider, cloud server, trusted execution environment TEE and data acquirer. Therefore, in the description of this specific implementation method, the focus of the hybrid encryption algorithm is centered around , , , and In addition, the length of the symmetric key is public in the system, but is only visible to all relevant entities outside the cloud server.

[0066] In the data outsourcing stage, the data provider can build an inverse keyword index (i.e., "keyword-file" mapping) based on the data to be outsourced. The predefined keyword set is denoted as , the file set is recorded as ,For example Represents keywords This file can also be a sub-collection. Figure 4 As shown, the data provider uses the key Calling the encryption algorithm Keyword Set Encrypted , similarly, using the key For file sets Encrypted In one possible implementation, if the length of the keyword set is 8, its content is specifically The corresponding file set is ,include , , , , , , , ,in Indicates keywords The corresponding content, other files are the same. The data provider uses the key Calling the encryption algorithm Keyword Set Encrypted . Similarly, using the key For file sets Encrypted For demonstration purposes, the ciphertext generated by the AES-GCM algorithm is converted to decimal. The specific contents of each ciphertext keyword and its corresponding ciphertext file are as follows:

[0067] , .

[0068] , .

[0069] , .

[0070] , .

[0071] , .

[0072] , .

[0073] , .

[0074] , .

[0075] Next, the data provider sends a data storage request to the cloud server. If the data storage request is approved, the encrypted result will be and Outsource storage to the cloud server.

[0076] During the offline loading phase, the cloud server can load the ciphertexts of the keyword set and the file set from the data provider and construct a reverse keyword index in ciphertext form (i.e., a "ciphertext keyword - ciphertext file" mapping). The data outsourcing request includes the first user identifier and the ciphertext of the file to be outsourced; the ciphertext of the file to be outsourced includes the ciphertext of the keyword set and the ciphertext of the file set; there is a mapping relationship between the ciphertext of the keyword set and the ciphertext of the file set.

[0077] In step 104, the cloud server sends the encrypted keyword set to the trusted execution environment.

[0078] In step 106, the trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext.

[0079] Furthermore, the cloud server can send the keyword set ciphertext to the trusted execution environment, which receives the keyword set ciphertext of the file data to be outsourced sent by the data provider and decrypts the keyword set ciphertext using the keyword set key in the second key pair to obtain the keyword set plaintext corresponding to the keyword set ciphertext (i.e. ), and store it securely in an isolated space for subsequent retrieval; there is a corresponding relationship between the keyword set key and the keyword set ciphertext.

[0080] In step 108 , the cloud server receives the data retrieval request sent by the data acquirer and forwards the data retrieval request to the trusted execution environment.

[0081] The data retrieval request includes a second user identifier and a ciphertext of the file to be retrieved; the ciphertext of the file to be retrieved includes a combined ciphertext of the keyword to be retrieved and the re-encryption key; the combined ciphertext is encrypted by the public key of the first key generated by the trusted execution environment. In the request initiation phase, the data acquirer, that is, the requesting user, can encapsulate the keyword to be retrieved, which can be the keyword to be retrieved and the symmetric key K0, and use the public key in the first key pair to encrypt the encapsulated keyword to be retrieved and the symmetric key K0 to obtain the corresponding encrypted file information to be retrieved, and then, a data acquisition request can be sent to the cloud server. The data acquisition request can also be a data retrieval request, and the data acquisition request can include the encrypted file information to be retrieved, and the encrypted file information to be retrieved can be called a trapdoor. After that, the cloud server can send the encrypted file information to be retrieved to the trusted execution environment. Specifically, the data acquirer will perform two retrieval request tasks: ① Select the keyword to be retrieved ②Select the keywords to be searched These two keywords are respectively related to the key Encapsulation and . Then, request the user RU to use the public key locally Calling the encryption algorithm right Encrypt to get the trapdoor

[0082]

[0083] Similarly, Encrypt to get the trapdoor

[0084]

[0085] Then, the trap door and Sent to the cloud server as a retrieval request.

[0086] In one possible implementation, when the trapdoor to be processed is hour:

[0087] Trusted Execution Environment TEE uses private keys Calling the decryption algorithm Decryption get , and separate the keywords to be searched from them and re-encryption key . Specify the edit distance , Trusted Execution Environment TEE to be searched for keywords As input, the plaintext keyword set stored in the isolated space Perform sequence alignment. Call the edit distance algorithm Afterwards, the 8 comparison results are as follows: , , , , , , , , where each result contains four sets of information, which (from left to right) represent: the position index in the entire keyword set, the input keyword, the matching keyword, and the number of operations (denoted as ). Due to the existence , that is, it can be matched exactly, and its position index is known to be , so we get .

[0088] In another possible implementation, when the trapdoor to be processed is hour:

[0089] Trusted Execution Environment TEE uses private keys Calling the decryption algorithm Decryption get , and separate the keywords to be searched from them and re-encryption key . Specify the edit distance , Trusted Execution Environment TEE to be searched for keywords As input, the plaintext keyword set stored in the isolated space Perform sequence alignment. Call the edit distance algorithm Afterwards, the 8 comparison results are as follows: , , , , , , , Since there is no If The conditions are the first and second groups, that is, considering fuzzy matching, it is known that their position indexes are and , so we get .

[0090] In one possible implementation, the data acquirer can use The algorithm uses the public key of the first key pair to encrypt the encapsulated search keyword and the symmetric key K0, which can be used as a secure search request while protecting the privacy of the search keyword. Specifically, the public key encryption algorithm used is the RSA algorithm. The core of the algorithm is to use a pair of public and private keys for data encryption and decryption respectively, and specifically includes the following three steps:

[0091] (1) Key generation: Select two large prime numbers and , taking their product as the modulus Next, calculate the Euler function Then, randomly select an integer , making and and Coprime. Calculation , satisfying the constraints Finally, output the public key , private key .

[0092] (2) Encryption: with a public key and a plaintext data As input, output ciphertext , the specific calculation process is: .

[0093] (3) Decryption: with a private key and a ciphertext As input, output plaintext , the specific calculation process is: The trapdoor in this step That is, the ciphertext generated by using the RSA algorithm.

[0094] In one possible implementation, the symmetric encryption generation algorithm may include:

[0095] (1) Encryption: via symmetric key Combined with a unique random initialization vector Plaintext Encrypt and generate ciphertext , and the ciphertext Contains encrypted data , the length of the encrypted data and certification labels ,Right now The encryption process can be formally expressed as: .

[0096] (2) Decryption: Use the same symmetric key and initialization vector , the ciphertext Decrypted to original plaintext , and verify the label To ensure that the data has not been tampered with. The decryption process can be formally expressed as: .

[0097] In step 110, the trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains the keyword to be retrieved and the re-encryption key corresponding to the combined ciphertext.

[0098] In step 112, the trusted execution environment obtains the to-be-retrieved file data corresponding to the to-be-retrieved keyword according to the to-be-retrieved keyword.

[0099] In step 114, the trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

[0100] The keywords requested for retrieval are When: Get the plain text result The keywords requested for retrieval are When: Get the plain text result and .

[0101] The method of this embodiment, on the one hand, can collaborate with a trusted execution environment (TEE) and a cloud server to implement a searchable encryption model framework. The cloud server can store large amounts of data, and the TEE can assist in retrieval calculations, reducing computational costs and resource consumption during the searchable encryption process and improving computational efficiency. Furthermore, the cloud server cannot obtain any information about the plaintext data or the search keywords during the entire process. Hybrid encryption of file data prevents the leakage of the identities of the data provider and data acquirer, as well as the leakage of the file data. This improves the security of the searchable encryption process, thereby enhancing data retrieval efficiency and supporting fuzzy data searches. Furthermore, it overcomes the limitation of traditional single-keyword support for exact matches, increasing the flexibility of searchable encryption. Specifically, through the joint model framework of the TEE and the cloud server, a fuzzy keyword search solution is implemented. This solution uses an edit distance algorithm to measure the similarity between keywords, which can tolerate incomplete matches between the search keywords entered by the data acquirer and the preset keywords (such as minor typos or formatting inconsistencies). By setting an edit distance threshold, a balance is achieved between exact and fuzzy matching, supporting similarity searches to meet the complex search needs of multiple users in a cloud environment.

[0102] In an exemplary embodiment, before step 102, the following steps may also be included:

[0103] The trusted execution environment receives a second key pair for the file to be outsourced sent by the data provider; the second key pair includes a keyword set key and a file set key.

[0104] In an exemplary embodiment, before step 110, the following steps may also be included:

[0105] The trusted execution environment generates a first key pair; the trusted execution environment sends a public key in the first key pair to the data acquirer; the public key is used to encrypt the data acquirer's to-be-retrieved keyword and re-encryption key.

[0106] In the method of this embodiment, during the system initialization phase, key interaction between the trusted execution environment and the data provider and data acquirer can be completed, facilitating subsequent hybrid encryption of file data, avoiding the leakage of identity information of the data provider and data acquirer, as well as the leakage of file data, thereby improving the security of the searchable encryption process.

[0107] In an exemplary embodiment, Figure 5 As shown, step 112 may include steps 502 to 504. Among them:

[0108] In step 502, the trusted execution environment obtains a matching keyword index of the keyword to be searched from a pre-stored keyword set plain text according to the keyword to be searched.

[0109] Step 504: Obtain the to-be-obtained file data corresponding to the to-be-retrieved keyword according to the matching keyword index.

[0110] In an exemplary embodiment, Figure 6 As shown, step 504 may include steps 602 to 608. Among them:

[0111] In step 602, the trusted execution environment sends the matching keyword index to the cloud server.

[0112] In step 604 , the cloud server determines the corresponding target file index based on the matching keyword index, and obtains the corresponding ciphertext of the file data to be obtained based on the target file index.

[0113] In step 606, the cloud server sends the encrypted file data to be obtained to the trusted execution environment.

[0114] Step 608: The trusted execution environment decrypts the ciphertext of the file data to be obtained using the file set key in the second key pair to obtain the file data to be obtained.

[0115] Among them, during the proxy re-encryption stage, the trusted execution environment TEE will match the index position of the keyword , that is, matching keyword index, and sending it to the cloud server. The cloud server will The target index, that is, the target file index, is searched by the inverse keyword index in ciphertext form, and the ciphertext file corresponding to the target index is found.

[0116] In one possible implementation, when the hour:

[0117] The cloud server will file Return to the Trusted Execution Environment TEE. Subsequently, the Trusted Execution Environment TEE uses the key Calling the decryption algorithm Decryption Get the plaintext file set , and then use the key Calling the encryption algorithm For plaintext file sets Re-encrypt .

[0118] In another possible implementation, hour:

[0119] The cloud server will file and Return to the Trusted Execution Environment TEE. Subsequently, the Trusted Execution Environment TEE uses the key Calling the decryption algorithm Decryption and Get the plaintext file set and , and then use the key Calling the encryption algorithm For plaintext file sets and Re-encrypt

[0120]

[0121] In the method of this embodiment, a trusted execution environment and a cloud server can be combined to collaboratively complete a searchable encryption model framework. The cloud server can store large-scale massive data, and the trusted execution environment can assist in retrieval calculations, reducing the computing cost and resource consumption in the searchable encryption process and improving computing efficiency. Moreover, the cloud server cannot obtain any information about plaintext data and keywords to be retrieved during the entire process, and performs hybrid encryption on file data to avoid the leakage of identity information of data providers and data acquirers, as well as the leakage of file data, thereby improving the security of the searchable encryption process, thereby improving data retrieval efficiency and supporting fuzzy search data.

[0122] In an exemplary embodiment, Figure 7 As shown, step 502 may include steps 702 to 704. Among them:

[0123] Step 702: Obtain the keyword distance between the keyword to be searched and each file keyword in the plurality of file keywords in the plain text of the keyword set.

[0124] Step 704: Determine a matching keyword index among multiple file keywords based on the keyword distance.

[0125] In an exemplary embodiment, step 704 may include:

[0126] If the keyword distance is less than the first distance threshold, the file keyword corresponding to the keyword distance is determined as the matching keyword index; if there is no keyword distance less than the first distance threshold, the file keyword less than or equal to the second distance threshold is determined as the matching keyword index; the second distance threshold is greater than the first distance threshold.

[0127] Among them, in a possible implementation, the edit distance algorithm can be used to obtain the degree of difference between the keyword to be searched and each of the multiple file keywords, and by setting a threshold, different degrees of accurate matching or fuzzy matching can be achieved. The edit distance in the edit distance algorithm can represent the minimum number of operations required to convert one keyword into another keyword, and the operation includes the insertion, deletion and replacement of characters. Specifically, the keyword to be searched As input, traverse the entire set of loaded keywords in sequence , the matching satisfies the edit distance Keywords , if it can accurately match the keywords to be searched, that is , then return the index , otherwise (i.e. ), perform fuzzy matching, and find Keywords, and finally form a result set , and record the index position of the matching keyword in the entire keyword set, and return Obtain an identification distance between the keyword to be retrieved and each file keyword in a plurality of file keywords in the file keyword set; determine a matching identification index among the plurality of file keywords based on the identification distance. If the identification distance is less than a first distance threshold, determine the file keyword corresponding to the identification distance as the matching identification index; if there is no identification distance less than the first distance threshold, determine the file keyword less than or equal to a second distance threshold as the matching identification index; the second distance threshold is greater than the first distance threshold.

[0128] The method in this embodiment uses an edit distance algorithm to measure the similarity between keywords. This algorithm can tolerate incomplete matches between the keywords entered by the data acquirer and the preset keywords (such as minor typos or formatting inconsistencies). By setting an edit distance threshold, a balance is achieved between exact and fuzzy matching, supporting similarity searches and meeting the complex search needs of multiple users in cloud environments.

[0129] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0130] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store searchable encryption-related data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a searchable encryption method.

[0131] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0132] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0134] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0135] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0136] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, 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 be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit (CPU), a graphics processor (GPU), a digital signal processor (DSP), a programmable logic device (PLD), a searchable encryption logic device based on quantum computing, and the like.

[0137] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, 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.

[0138] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A searchable encryption method, characterized in that: The method comprises: The cloud server receives a data outsourcing request sent by a data provider; the data outsourcing request includes a first user identifier and a ciphertext of a file to be outsourced; the ciphertext of the file to be outsourced includes a keyword set ciphertext and a file set ciphertext; and there is a mapping relationship between the keyword set ciphertext and the file set ciphertext; The cloud server sends the keyword set encrypted text to the trusted execution environment; The trusted execution environment decrypts the keyword set ciphertext using the keyword set key provided by the data provider to obtain the keyword set plaintext corresponding to the keyword set ciphertext; The cloud server receives a data retrieval request sent by a data acquirer and forwards the data retrieval request to the trusted execution environment; the data retrieval request includes a second user identifier and a ciphertext of a file to be retrieved; the ciphertext of the file to be retrieved includes a ciphertext of a keyword to be retrieved and a re-encryption key; the ciphertext is encrypted using a public key in a first key pair generated by the trusted execution environment; The trusted execution environment receives the data retrieval request sent by the cloud server, decrypts the combined ciphertext using the private key in the first key pair, and obtains a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext; The trusted execution environment obtains a keyword distance between the keyword to be searched and each of the file keywords in the plurality of file keywords in the plain text of the keyword set; if the keyword distance is less than a first distance threshold, the file keyword corresponding to the keyword distance is determined as a matching keyword index; if there is no keyword distance less than the first distance threshold, the file keyword less than or equal to a second distance threshold is determined as the matching keyword index; the second distance threshold is greater than the first distance threshold; and according to the matching keyword index, the to-be-acquired file data corresponding to the keyword to be searched is obtained; The trusted execution environment uses the re-encryption key to re-encrypt the file data to be obtained, obtains the re-encrypted file data corresponding to the file data to be obtained, and sends the re-encrypted file data to the data acquirer; the data acquirer uses the re-encryption key to decrypt the re-encrypted file data to obtain the file data to be obtained corresponding to the keyword to be retrieved.

2. The method according to claim 1, characterized in that Before the cloud server receives the data outsourcing request sent by the data provider, the method further includes: The trusted execution environment receives a second key pair for the file to be outsourced sent by the data provider; the second key pair includes the keyword set key and the file set key.

3. The method according to claim 1, characterized in that Before the trusted execution environment receives the data retrieval request sent by the cloud server, the method further includes: The trusted execution environment generates the first key pair; The trusted execution environment sends the public key in the first key pair to the data acquirer; the public key is used to encrypt the keyword to be retrieved and the re-encryption key of the data acquirer.

4. The method according to claim 2, characterized in that The step of obtaining the to-be-obtained file data corresponding to the to-be-retrieved keyword according to the matching keyword index includes: The trusted execution environment sends the matching keyword index to the cloud server; The cloud server determines a corresponding target file index according to the matching keyword index, and obtains the corresponding ciphertext of the to-be-obtained file data according to the target file index; The cloud server sends the encrypted file data to be obtained to the trusted execution environment; The trusted execution environment decrypts the ciphertext of the file data to be obtained using the file set key in the second key pair to obtain the file data to be obtained.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Fuzzy keyword searchable encryption method and system with privacy protection

    CN115495792A

  • Methods and systems for storing and retreiving homomorphically encrypted keywords

    WO2024076268A1