Searchable encryption method, computer device, storage medium and computer program product
By establishing a collaborative model framework between cloud servers and trusted execution environments, the problems of low search efficiency and no fuzzy search in the existing technology are solved, efficient ciphertext retrieval and secure fuzzy search are achieved, and data security and computing efficiency are improved.
Patent Information
- Application Number
- CN202411637379.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing searchable encryption technology is inefficient in retrieval and does not support fuzzy search when facing massive outsourcing data files and large amounts of on-demand data requests for users.
By establishing a collaborative model framework between cloud servers and trusted execution environments, using trusted execution environments for secure keyword matching and index marking, ciphertext retrieval is realized, and fuzzy search is supported through proxy re-encryption and edit distance algorithms.
It improves data retrieval efficiency, supports fuzzy search, reduces computing costs and resource consumption, enhances data security, and avoids the leakage of identity information between data providers and data acquirers.
Smart Images

Figure CN119513877A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of searchable encryption technology, and in particular to a searchable encryption method, a computer device, a storage medium, and a computer program product. Background Art
[0002] Cloud storage provides a solution for data owners with limited storage and computing power, allowing them to outsource their data to the cloud and obtain convenient shared data access services. However, when the data storage management service is provided by an unreliable third party, data security issues will arise. Therefore, it is necessary to introduce searchable encryption technology to provide ciphertext retrieval services for servers with low credibility.
[0003] The current searchable encryption technology not only retains the search capability of the server side, but also effectively prevents data leakage and unauthorized access. However, in the face of massive outsourced data files and a large number of on-demand data request users, the existing searchable encryption technology still has the problems of low retrieval efficiency and does not support 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; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;
[0007] The cloud server sends the keyword set ciphertext 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 combined ciphertext of a keyword to be retrieved and a re-encryption key; the combined ciphertext is encrypted by 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, and decrypts the combined ciphertext using the private key in the first key pair to obtain 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 of the embodiments, 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 of the embodiments, 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 of the embodiments, the trusted execution environment obtains the file data to be obtained corresponding to the keyword to be retrieved according to 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 according to the keyword to be retrieved; and obtains the file data to be obtained corresponding to the keyword to be retrieved according to the matching keyword index.
[0016] In one of the embodiments, 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 determines the corresponding target file index based on the matching keyword index, and obtains the corresponding file data ciphertext to be obtained of the file data to be obtained based on the target file index; the cloud server sends the file data ciphertext to be obtained to the trusted execution environment; the trusted execution environment decrypts 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 of the embodiments, obtaining a matching keyword index of the keyword to be retrieved in the pre-stored plain text of the keyword set according to the keyword to be retrieved includes: obtaining a keyword distance between the keyword to be retrieved and each of the multiple file keywords in the plain text of the keyword set; and determining the matching keyword index among the multiple file keywords according to the keyword distance.
[0018] In one of the embodiments, 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, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[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; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;
[0021] The cloud server sends the keyword set ciphertext 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 combined ciphertext of a keyword to be retrieved and a re-encryption key; the combined ciphertext is encrypted by 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, and decrypts the combined ciphertext using the private key in the first key pair to obtain 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. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[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; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;
[0029] The cloud server sends the keyword set ciphertext 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 combined ciphertext of a keyword to be retrieved and a re-encryption key; the combined ciphertext is encrypted by 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, and decrypts the combined ciphertext using the private key in the first key pair to obtain 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, and when the computer program is executed by a processor, the following steps are implemented:
[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; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext;
[0037] The cloud server sends the keyword set ciphertext 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 combined ciphertext of a keyword to be retrieved and a re-encryption key; the combined ciphertext is encrypted by 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, and decrypts the combined ciphertext using the private key in the first key pair to obtain 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] In the above-mentioned searchable encryption method, computer device, storage medium and computer program product, a model framework for collaborative searchable encryption using a trusted execution environment and a cloud server is specifically and innovatively constructed, so that the two can perform collaborative operations as independent participants. The framework entrusts the storage task of large-scale ciphertext outsourcing data to the cloud server, and the trusted execution environment is responsible for performing secure keyword matching and index marking tasks. The method allows a single data provider to rely on the cloud server for remote data storage and management so as to share data with multiple authorized data acquirers. The trusted execution environment has the decryption capability by remotely authenticating and managing the key with its security isolation mechanism. Subsequently, the trusted execution environment and the cloud server jointly complete the retrieval operation. In addition, proxy re-encryption for data acquirers is also implemented through the trusted execution environment. By using the trusted execution environment instead of an additional cloud service provider, collusion between the two servers can be prevented. When facing the retrieval requirements of multiple requesting users, by marking the target index, there is no need to repeatedly scan all stored ciphertext files in sequence, and keyword retrieval operations can be efficiently supported. By mixing the AES-GCM algorithm and the RSA algorithm, the retrieval efficiency in one-to-many scenarios is further improved and the computational overhead is reduced. The method makes the encryption mode and content of the outsourced data hidden from the cloud server, and also protects the privacy of the keywords to be retrieved. In the method provided by the embodiment of the present application, on the one hand, the trusted execution environment and the cloud server can be combined to collaboratively complete the searchable encryption model framework, the cloud server can store large-scale massive data, the trusted execution environment can assist in retrieval calculations, reduce the computing cost and resource consumption in the searchable encryption process, and improve the computing efficiency. In addition, the cloud server cannot obtain any information about the plaintext data and the keywords to be retrieved during the entire process, and the file data is mixedly encrypted to avoid the leakage of the identity information of the data provider and the data acquirer, as well as the leakage of the file data, thereby improving the security of the searchable encryption process, thereby improving the data retrieval efficiency and supporting fuzzy search data; on the other hand, it breaks through the limitation that the traditional single keyword only supports exact matching, and increases the flexibility of searchable encryption. Specifically, a fuzzy keyword retrieval scheme is implemented through the joint model framework of the trusted execution environment and the cloud server. The scheme uses the edit distance algorithm to measure the similarity between keywords, and can tolerate incomplete matching between the keywords to be retrieved entered by the data acquirer and the preset keywords (such as slight typos or inconsistent formats). 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 drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. 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 creative work.
[0045] FIG1 is a schematic diagram of a flow chart of a searchable encryption method provided in an embodiment of the present application;
[0046] FIG2 is a schematic diagram of the structure of a searchable encryption system provided in an embodiment of the present application;
[0047] FIG3 is a schematic diagram of a flow chart of another searchable encryption method provided in an embodiment of the present application;
[0048] FIG4 is a schematic diagram of a flow chart of generating a keyword set ciphertext and a file set ciphertext provided in an embodiment of the present application;
[0049] FIG5 is a schematic diagram of a process for obtaining file data to be obtained according to an embodiment of the present application;
[0050] FIG6 is a schematic diagram of a process of obtaining a matching identifier index according to a matching keyword index provided by an embodiment of the present application;
[0051] FIG7 is a schematic diagram of a flow chart of a matching keyword index provided in an embodiment of the present application;
[0052] FIG8 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 solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] In an exemplary embodiment, as shown in FIG1 , 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. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the 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, as shown in FIG2, 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 to the cloud server, and the data acquirer can be an authorized user of the searchable encryption system and can acquire data in the cloud server. The trusted execution environment can be a trusted execution environment (TEE), which is a security mechanism built in a computing system. TEE creates a secure environment through hardware technology to ensure the security of the code and data running therein, and prevent attackers from accessing or tampering. As shown in FIG3, in one possible way, the searchable encryption method of the embodiment of the present application can be completed using searchable encryption technology to realize remote data storage and data management of the data provider's data, as well as data sharing with the data acquirer. The searchable encryption process may include parts such as a system initialization phase, a data outsourcing phase, an offline loading phase, an online retrieval phase, a proxy re-encryption phase, and a result return phase. In the initialization phase of the system, the data provider (also referred to as the data owner DO) can use a symmetric key generation algorithm (e.g., AES-GCM algorithm) to generate two symmetric keys, i.e., a second key pair, which can 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 a keyword set ciphertext, and the file set key K2 can be used to encrypt the file set of the outsourced file to obtain a file set ciphertext. In a possible implementation,
[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 transmits the public key 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. 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. 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.
[0065] For the sake of demonstration, the offset is uniformly shared 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 on , , , and In addition, the length information 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 denoted as ,For example Represents keywords As shown in Figure 4, 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, the same applies to other files. The data provider uses the key Calling the encryption algorithm Keyword Set Encrypted . Similarly, using the key For file sets Encrypted For the convenience of demonstration, the ciphertext generated by the AES-GCM algorithm is converted to decimal. The specific content of each ciphertext keyword and its corresponding ciphertext file is 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 and Outsource storage to the cloud server.
[0076] In the offline loading stage, the cloud server can load the keyword set ciphertext and file set ciphertext from the data provider and construct a reverse keyword index in ciphertext form (i.e., "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 keyword set ciphertext and the file set ciphertext; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext.
[0077] Step 104: The cloud server sends the keyword set ciphertext to the trusted execution environment.
[0078] 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] Among them, further, the cloud server can send the keyword set ciphertext to the trusted execution environment, and the trusted execution environment receives the keyword set ciphertext of the file data to be outsourced of the data provider sent by the cloud server; 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] 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] Among them, the data retrieval request includes the second user identifier and the ciphertext of the file to be retrieved; the ciphertext of the file to be retrieved includes the 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 stage, 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. 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 The 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 Encryption to get the trapdoor
[0082]
[0083] Similarly, Encryption to get the trapdoor
[0084]
[0085] Then, the trap door and Sent as a retrieval request to the cloud server.
[0086] In a 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 is the input, and the plaintext keyword set stored in the isolated space Perform sequence comparison. Call the edit distance algorithm Afterwards, 8 comparison results are obtained: , , , , , , , , 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 is the input, and the plaintext keyword set stored in the isolated space Perform sequence comparison. Call the edit distance algorithm Afterwards, 8 comparison results are obtained: , , , , , , , 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 may use The algorithm uses the public key of the first key pair to encrypt the encapsulated keyword to be searched and the symmetric key K0, which can be used as a secure search request while protecting the privacy of the keyword to be searched. 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, which 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 , so that 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 a possible implementation, the symmetric encryption generation algorithm may include:
[0095] (1) Encryption: via symmetric key Combined with a unique random initialization vector For plain text Encrypt and generate ciphertext , and the ciphertext Contains encrypted data , the length of the encrypted data And certification label ,Right now The encryption process can be formally expressed as: .
[0096] (2) Decryption: Use the same symmetric key and initialization vector , the ciphertext Decrypt to original plaintext , and verify the tag To ensure that the data has not been tampered with. The decryption process can be formally expressed as: .
[0097] Step 110: The trusted execution environment receives a data retrieval request sent by the cloud server, and uses the private key in the first key pair to decrypt the combined ciphertext to obtain a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext.
[0098] 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 re-encrypts the file data to be obtained using the re-encryption key, 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 decrypts the re-encrypted file data using the re-encryption key to obtain the file data to be obtained corresponding to the keyword to be retrieved.
[0100] The keywords for the search request are When: Get the plain text result The keywords for the search request are When: Get the plain text result and .
[0101] In the method of this embodiment, on the one hand, the trusted execution environment and the cloud server can be combined to collaboratively complete the searchable encryption model framework. The cloud server can store large-scale massive data. The trusted execution environment can assist in retrieval calculations, reduce the computing cost and resource consumption in the searchable encryption process, and improve the computing efficiency. In addition, the cloud server cannot obtain any information about the plaintext data and the keywords to be searched during the entire process, and the file data is hybrid encrypted to avoid the leakage of the identity information of the data provider and the data acquirer, as well as the leakage of the file data, thereby improving the security of the searchable encryption process, thereby improving the data retrieval efficiency and supporting fuzzy search data; on the other hand, it breaks through the limitation that the traditional single keyword only supports exact matching, and increases the flexibility of searchable encryption. Specifically, a fuzzy keyword retrieval scheme is implemented through the joint model framework of the trusted execution environment and the cloud server. The scheme uses the edit distance algorithm to measure the similarity between keywords, and can tolerate incomplete matches between the keywords to be searched and the preset keywords entered by the data acquirer (such as minor typos or inconsistent formats). 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.
[0102] In an exemplary embodiment, before step 102, the following 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 keywords to be retrieved and the 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, and the leakage of file data, thereby improving the security of the searchable encryption process.
[0107] In an exemplary embodiment, as shown in FIG5 , step 112 may include steps 502 to 504. Among them:
[0108] 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-searched keyword according to the matching keyword index.
[0110] In an exemplary embodiment, as shown in FIG6 , step 504 may include steps 602 to 608. Among them:
[0111] Step 602: The trusted execution environment sends the matching keyword index to the cloud server.
[0112] Step 604: the cloud server determines the corresponding target file index according to the matching keyword index, and obtains the corresponding ciphertext of the file data to be obtained according to the target file index.
[0113] 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 indexes, and sending them to the cloud server Server. The cloud server Server does not decrypt, according to The target index, that is, the target file index, is queried using the reverse keyword index in ciphertext form, and the ciphertext files corresponding to the target index are found.
[0116] In one possible implementation, when the hour:
[0117] The cloud server will Return to the trusted execution environment TEE. Then, 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 plain text file set Re-encrypt .
[0118] In another possible implementation, the pending hour:
[0119] The cloud server will and Return to the trusted execution environment TEE. Then, 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 plain text file set 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. In addition, 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, as shown in FIG7 , 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 of the multiple 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] In one possible implementation, an edit distance algorithm can be used to obtain the difference between the keyword to be searched and each of the multiple file keywords, and a threshold is set to achieve different degrees of precise matching or fuzzy matching. 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 order , 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 the identification distance between the keyword to be searched and each of the multiple file keywords in the file keyword set; determine the matching identification index among the multiple file keywords according to 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 the second distance threshold as the matching identification index; the second distance threshold is greater than the first distance threshold.
[0128] In the method of this embodiment, the edit distance algorithm is used to measure the similarity between keywords, which can tolerate incomplete matching between the keywords to be searched and the preset keywords entered by the data acquirer (such as minor typos or inconsistent formats). 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 search needs of multiple users in a cloud environment.
[0129] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed 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 part of the steps or stages in other steps.
[0130] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. 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 the 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, a searchable encryption method is implemented.
[0131] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial 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 arrangement of components.
[0132] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, 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 can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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 embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium 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), magnetoresistive 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. As an 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 each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a searchable encryption logic device based on quantum computing, etc., but are not limited to this.
[0137] The technical features of the above embodiments may 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 only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached 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; there is a mapping relationship between the keyword set ciphertext and the file set ciphertext; The cloud server sends the keyword set ciphertext to a 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 combined ciphertext of a keyword to be retrieved and a re-encryption key; the combined ciphertext is encrypted by a public key of a first key generated by the trusted execution environment; The trusted execution environment receives the data retrieval request sent by the cloud server, and decrypts the combined ciphertext using the private key in the first key pair to obtain a keyword to be retrieved and a re-encryption key corresponding to the combined ciphertext; 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; 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 to-be-retrieved keyword and the re-encryption key of the data acquirer.
4. The method according to claim 2, characterized in that: 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, including: The trusted execution environment obtains, according to the keyword to be searched, a matching keyword index of the keyword to be searched in the pre-stored plain text of the keyword set; According to the matching keyword index, the to-be-acquired file data corresponding to the to-be-retrieved keyword is acquired.
5. The method according to claim 4, characterized in that The step of obtaining the to-be-obtained file data corresponding to the to-be-searched 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 file data to be obtained according to the target file index; The cloud server sends the ciphertext of the file data to be obtained to the trusted execution environment; The trusted execution environment decrypts the ciphertext of the file data to be obtained by using the file set key in the second key pair to obtain the file data to be obtained.
6. The method according to claim 4, characterized in that The step of obtaining a matching keyword index of the keyword to be searched from the pre-stored keyword set plain text according to the keyword to be searched includes: Obtaining a keyword distance between the keyword to be searched and each of the file keywords in the plurality of file keywords in plain text of the keyword set; The matching keyword index is determined among the plurality of file keywords according to the keyword distance.
7. The method according to claim 6, characterized in that Determining the matching keyword index among the plurality of file keywords according to 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 the keyword distance less than the first distance threshold does not exist, 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.
8. 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 7 are implemented.
9. 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 7 are implemented.
10. 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 7 are implemented.
Citation Information
Patent Citations
Fuzzy keyword searchable encryption method and system with privacy protection
CN115495792A
Method for Saving Ciphertext and Apparatus
US20230254143A1
Methods and systems for storing and retreiving homomorphically encrypted keywords
WO2024076268A1