A file encryption method, retrieval method, and deletion method

By using the public key PK and the private part Pri of the hidden structure to generate searchable ciphertext, the problem of difficult to take into account in the existing technology of rapid retrieval and dynamic update in the cloud storage environment, and rapid retrieval and secure file management are achieved.

CN119449314BActive Publication Date: 2025-07-25HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411529262.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-07-25
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

Existing searchable public key encryption algorithms are difficult to take into account both rapid retrieval and dynamic updates, especially in cloud storage environments, resulting in inefficient retrieval efficiency and insufficient security.

Method used

The public key PK and the private part Pri of the hidden structure encrypts the keywords and identifiers of the uploaded files, and generates a searchable ciphertext C=(Lw,Lid,Lr,Dw,Did), which supports dynamic addition and deletion of ciphertexts and fast keyword and file identifier search on the ciphertext, and realizes sublinear level retrieval complexity and dynamic updates through iterative search and logical deletion.

Benefits of technology

It realizes the sublinear level retrieval complexity of fast keyword and file identifier retrieval in a cloud storage environment, ensures semantic security and retrieval efficiency, and maintains the security and privacy of searchable ciphertexts through logical deletion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449314B_ABST
    Figure CN119449314B_ABST
Patent Text Reader

Abstract

The present invention discloses a file encryption method, a retrieval method and a deletion method, belonging to the technical fields of cryptography and cloud storage. The file encryption method encrypts the keywords and identifiers of the file to be uploaded using a public key and the private part of a hidden structure, generates a searchable ciphertext carrying the keywords and identifiers, supports dynamic addition and deletion of ciphertexts, and fast keyword retrieval and fast file identifier retrieval on the ciphertexts. The retrieval complexity of keyword retrieval is only linearly related to the number of searchable ciphertexts containing the keyword, and the retrieval complexity of file identifier retrieval is only linearly related to the number of searchable ciphertexts containing the file identifier. This solves the problem that existing searchable public key encryption technologies are difficult to balance fast keyword retrieval and dynamic update, and enables searchable public key encryption to have the characteristics of sub-linear retrieval complexity and dynamic deletion at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of cryptography and cloud storage, and more specifically, relates to a file encryption method, a retrieval method, and a deletion method. Background Art

[0002] With the rapid progress of cloud computing technology, cloud service providers provide users with convenient storage and computing services, meeting the growing service demand for data. To maintain the confidentiality and availability of user data in the cloud, searchable encryption (SE) technology has rapidly emerged. Searchable encryption is a cryptographic primitive developed in recent years that supports users in performing keyword searches on ciphertexts, which can save users a large amount of network and computing overheads and make full use of the huge computing resources of cloud servers to perform keyword searches on ciphertexts.

[0003] This technology is mainly divided into two categories, namely searchable symmetric encryption and searchable public key encryption. Among them, most of the SE mechanisms based on public key cryptography are constructed based on bilinear pair technology, and the security is established on difficult problems (such as DLP, CDH, DDH, BDH, etc.). During the execution process, there is no need for the encryptor and the decryptor to negotiate keys in advance. The encryptor can directly use the public key to encrypt the keyword set, and the decryptor can use the private key to generate a search credential (Token) for ciphertext keyword search. Group element calculations, bilinear pair mappings, and operations on bilinear pairs are required during the search process, resulting in relatively large overheads. Due to the characteristics of bilinear pairs and the existence of difficult problems, the SE mechanism based on public key cryptography supports more complex search statements and is more suitable for insecure networks. That is, searchable public key encryption is suitable for non-interactive storage and retrieval due to the characteristics of the public key system and is widely used in scenarios such as cloud storage, cloud mail, and electronic health records.

[0004] However, it is difficult to balance fast retrieval and dynamic update when using existing searchable public key encryption algorithms to encrypt files and store them on a cloud server. Summary of the Invention

[0005] In view of the above-mentioned deficiencies or improvement requirements of the prior art, the present invention provides a file encryption method, a retrieval method, and a deletion method, aiming to solve the technical problem that it is difficult to balance keyword retrieval and dynamic update when using existing searchable public key encryption algorithms to encrypt files and store them on a cloud server.

[0006] To achieve the above object, according to one aspect of the present invention, there is provided a file encryption method, including:

[0007] S1: Using the keyword space carried and the file identifier space The public key PK generates the private part Pri and the public part Pub of the hidden structure, Pub = g u , u is a preset variable, w' is a preset keyword, and id' is a preset file identifier; Pt[,] represents the variable related to the binary tuple [,]; is the keyword space, is the file identifier space;

[0008] S2: Generate the identifier id of the file to be uploaded and the searchable ciphertext C corresponding to each keyword w in the keyword set WSet i = i =(L w , L id , L r , D w , D id ), which includes steps A1 to A3:

[0009] A1: Select a random value r from the multiplicative group of order q and calculate the first ciphertext element L r = g r ;

[0010] A2: Query whether w i exists in the private part Pri; if not, calculate and add (w i , Pt[u, w i ) to Pri, calculate the second ciphertext element L w = H2(e(h, H1(w i ))) u ), the third ciphertext element If it exists, calculate and replace Pt[u, w i in Pri with P w , calculate L w = Pt[u, w i , ∥ represents concatenation; represents random sampling and assignment, H1, H2, and H3 are three hash functions, e(,) represents the bilinear mapping operation, k is the security parameter, and g is a preset variable in the public key PK;

[0011] A3: Query whether id exists in the private part Pri, if not, calculate and add (id, Pt[u, id]) to Pri, calculate the fourth ciphertext element L id = H2(e(h, H1(id)) u ), the fifth ciphertext element If it exists, calculate and replace Pt[u, id] in Pri with variable P id , calculate L id = Pt[u, id],

[0012] S3: Combine the ciphertext file obtained by encrypting the file to be uploaded and the set of searchable ciphertexts CSet = {C1,..., C |WSet|} corresponding to all keywords of the file to be uploaded as the target ciphertext.

[0013] In one embodiment, before the S1, it further includes: generating at least one pair of private and public parts (Pri, Pub) of a hidden structure, where the private part Pri is held by oneself for the file encryption process; the public part Pub is given to the access execution entity for the file retrieval process and the file deletion process;

[0014] Among them, the process of generating a pair of private and public parts (Pri, Pub) of a hidden structure is as follows: Select a random value u from the multiplicative group of order q , that is Calculate the public part Pub = g u , the private part Pri = {u}, the private part Pri is a set, and the encryption process will add or update the elements (w, Pt[u, w]), (id, Pt[u, id]) to Pri, and Pt[,] represents the variable related to the binary tuple [,].

[0015] In one embodiment, the public key PK is expressed as: Group and group are elliptic curve groups, the orders q of the two elliptic curve groups are the same, e is a bilinear mapping g is a generator, is the searchable ciphertext space, The three hash functions are respectively expressed as:

[0016] According to another aspect of the present invention, there is provided an electronic device including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above file encryption method are implemented.

[0017] According to another aspect of the present invention, there is provided a file retrieval method applied to a cloud server, including:

[0018] After uploading the target ciphertext obtained by the file encryption method to the cloud server, when the cloud server receives a retrieval request carrying a retrieval keyword from the access party, according to the retrieval request and the set of public parts PubSet of the hidden structure related to the access party, retrieve the corresponding target ciphertext from all searchable ciphertexts and feedback the corresponding ciphertext file to the access party; PubSet contains at least one public part Pub;

[0019] Among them, the retrieval request is generated by the access party using the private key SK corresponding to the public key PK and the retrieval keyword w'.

[0020] In one embodiment, the retrieval request is the file retrieval trapdoor T w = H1(w″) s , s represents the private key, and w″ represents the retrieval keyword.

[0021] In one embodiment, retrieving the corresponding target ciphertext from all searchable ciphertexts and feedbacking the corresponding ciphertext file to the access party includes:

[0022] Step B-1. Initialize an empty set For each public part Pub of the hidden structure i ∈PubSet, execute steps B-2 to B-5;

[0023] Step B-2. Initialize two variables i = 0 and j = 0, and two temporary pointers Pt = H2(e(Pub i , T w )) and Pt ′ = NULL;

[0024] Step B-3. Let i = i + 1, and query for the searchable ciphertext that satisfies If it exists, execute step B-4; if not, end the retrieval based on Pub in this round; i ;

[0025] Step B-4. Calculate

[0026] Step B-5. If tag = 0, add id to I, let j = i, Pt ′ = Pt, and return to step B-3; if tag = 1 and i = 1, let j = i, Pt ′ = Pt, and return to step B-3; if tag = 1 and i > 1, update the previously retrieved searchable ciphertext such that Physically delete the corresponding searchable ciphertext C i , and perform step B-3;

[0027] Step B-6. When the retrieval for all Pub i ∈PubSet is completed, return the ciphertext file corresponding to I obtained by the retrieval to the access party.

[0028] According to another aspect of the present invention, there is provided a file deletion method applied to a cloud server, including: after uploading the target ciphertext obtained by the file encryption method to the cloud server, when the cloud server receives a deletion request from an access party, according to the deletion request and the public part set PubSet of the hidden structure related to the access party, retrieve the corresponding target ciphertext from all searchable ciphertexts , logically delete the searchable ciphertext related to the target ciphertext, and delete the ciphertext file corresponding to the target ciphertext; PubSet contains at least one public part Pub;

[0029] The deletion request is generated by the access party using the private key SK corresponding to the public key PK and the identifier id″ of the file to be deleted.

[0030] In one embodiment, the deletion request is the file deletion trapdoor T id =(H1(id″) s , id″); s represents the private key SK, and id″ represents the identifier of the file to be deleted.

[0031] In one embodiment, the logically deleting the searchable ciphertext related to the target ciphertext and deleting the ciphertext file corresponding to the target ciphertext includes:

[0032] Step C-1. Parse the deletion request T id to obtain the retrieval trapdoor H1(id″) s and the identifier id″ of the file to be deleted, and delete the ciphertext file corresponding to id″; for each public part Pub of the hidden structure i ∈PubSet, perform steps C-2 to C-3;

[0033] Step C-2. Initialize the temporary pointer Pt = H2(e(Pub i , H1(id″) s ));

[0034] Step C-3. Query for the searchable ciphertext C = (L id = Pt w , L id , L r , D w , Did ); If there is a need to update logically delete the corresponding searchable ciphertext, and let and execute step C-3, ∥ represents concatenation; if not, end this round of deletion based on Pub i .

[0035] Generally speaking, compared with the prior art, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0036] (1) The present invention provides a file encryption method, which encrypts the keywords and identifiers of the file to be uploaded using the public key PK and the private part Pri of the hidden structure, and generates the corresponding searchable ciphertext C = (L w , L id , L r , D w , D id ). It supports dynamic addition and deletion of ciphertexts, as well as fast keyword retrieval and fast file identifier retrieval on ciphertexts. The retrieval complexity of keyword retrieval is only linearly related to the number of searchable ciphertexts containing the keyword, and the retrieval complexity of file identifier retrieval is only linearly related to the number of searchable ciphertexts containing the file identifier. It solves the problem that the existing searchable public key encryption technology is difficult to balance fast keyword retrieval and dynamic update, and enables searchable public key encryption to have the characteristics of sub-linear retrieval complexity and dynamic deletion at the same time.

[0037] (2) The present invention provides a file retrieval method, which calculates and performs iterative retrieval according to Pt until all target ciphertext files that meet the retrieval requirements are found. The advantage is that there is no explicit association between the searchable ciphertext and the ciphertext file, and the server cannot distinguish the unretrieved searchable ciphertext, ensuring semantic security. Specifically, in traditional searchable public key encryption, there is an explicit association between the searchable ciphertext and the ciphertext file, and semantic information such as the number of keywords contained in a file will also be leaked before the retrieval is executed, while this is not the case in the present invention.

[0038] (3) The present invention provides a file deletion method, query for the searchable ciphertext C = (L id = Pt, i.e., C = (L w , L id , L r , D w , D id ); If there is a need to update logically delete the corresponding searchable ciphertext, and let And perform step C-3, ∥ represents concatenation; if not, end the deletion. After retrieving the file identifier, first logically delete the corresponding searchable ciphertext, and during the subsequent related keyword retrieval process, calculate Identify the searchable ciphertext that has been logically deleted according to the tag and perform physical deletion; this method of deleting searchable ciphertext by combining logical deletion and physical deletion maintains the hidden structure between searchable ciphertexts and ensures retrieval efficiency and security. Brief Description of the Drawings

[0039] Figure 1 is a schematic diagram of an application scenario of a file retrieval and file deletion method based on searchable public key encryption provided by an embodiment of the present invention;

[0040] Figure 2 is a flowchart of a file retrieval and file deletion method based on searchable public key encryption provided by an embodiment of the present invention;

[0041] Figure 3 is a schematic diagram of the hidden structure between searchable ciphertexts provided by an embodiment of the present invention, including the searchable ciphertexts corresponding to 4 keyword-file identifier pairs (w1, id1), (w2, id1), (w1, id2), (w2, id2) and their hidden relationships. Detailed Embodiments

[0042] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0043] Embodiment 1

[0044] This embodiment provides a file encryption method, including:

[0045] S1: Use the public key PK carrying the keyword space and the file identifier space to generate the private part Pri and the public part Pub of the hidden structure, Pub = g u , u is a preset variable, w' is a preset keyword, id' is a preset file identifier; Pt[,] represents the variable related to the binary tuple [,]; is the keyword space, is the file identifier space, and g is a preset variable in the public key PK;

[0046] S2: Generate the identifier id of the file to be uploaded and each keyword w in the keyword set WSet i The corresponding searchable ciphertext C i =(L w ,L id ,L r ,D w ,D id ), including steps A1 to A3:

[0047] A1: From the q factorial group Select a random value r from the ciphertext and calculate the first ciphertext element L r =g r ;

[0048] A2: Query w i exists in the private part Pri; if not, calculate And add (w i ,Pt[u,w i ]) to Pri, calculate the second ciphertext element L w =H2(e(h,H1(w i )) u ), the third ciphertext element If it exists, calculate And Pt[u,w i ] is replaced by P w , calculate L w =Pt[u,w i ], ∥ indicates splicing; represents random sampling and assignment, H1, H2, H3 are three hash functions, e(,) represents bilinear mapping operation, r is a random number, k is a security parameter, h = g s , s is the private key SK corresponding to the public key PK;

[0049] A3: Check whether id exists in the private part Pri. If not, calculate And add (id, Pt[u, id]) to Pri, calculate the fourth ciphertext element L id =H2(e(h,H1(id)) u ), the fifth ciphertext element If it exists, calculate And replace Pt[u,id] in Pri with variable P id , calculate L id =Pt[u,id],

[0050] S3: Merge the ciphertext file obtained by encrypting the file to be uploaded and the set of searchable ciphertexts CSet = {C1, …, C |WSet|} corresponding to all keywords of the file to be uploaded as the target ciphertext.

[0051] Furthermore, before the S1, it also includes:

[0052] Generate at least one pair of private and public parts (Pri, Pub) of the hidden structure, where the private part Pri is held by oneself and is used in the file encryption process; the public part Pub is given to the access execution entity and is used in the file retrieval process and the file deletion process;

[0053] Among them, the process of generating a pair of private and public parts (Pri, Pub) of the hidden structure is as follows: Select a random value u from the multiplicative group of order q That is, Calculate the public part Pub = g u , the private part Pri = {u}, the private part Pri is a set, and the encryption process will add or update the elements (w, Pt[u, w]), (id, Pt[u, id]) to Pri, and Pt[,] represents the variable related to the binary tuple [,].

[0054] Furthermore, the public key PK is: Among them, the group and the group are elliptic curve groups, the orders q of the two elliptic curve groups are the same, e is a bilinear mapping g is a generator, is the searchable ciphertext space, Furthermore, the three hash functions are respectively expressed as:

[0055] Embodiment 2

[0056] This embodiment provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the above file encryption method are implemented.

[0057] Embodiment 3

[0058] This embodiment provides a file retrieval method, including: After uploading the target ciphertext obtained by the above file encryption method to the cloud server, when the cloud server receives a retrieval request carried with a retrieval keyword from the access party, according to the retrieval request and the set PubSet of public parts of the hidden structure related to the access party, from all searchable ciphertexts Retrieve the corresponding target ciphertext from it, and feed back the corresponding ciphertext file to the access party; PubSet contains at least one public part Pub; among them, the retrieval request is generated by the access party using the private key SK corresponding to the public key PK and the retrieval keyword w'.

[0059] Further, the retrieval request is the file retrieval trapdoor T w = H1(w″) s , where s represents the private key and w″ represents the retrieval keyword.

[0060] Further, retrieve the corresponding target ciphertext from all searchable ciphertexts and feed back the corresponding ciphertext file to the access party, including:

[0061] Step B-1. Initialize an empty set For each hidden structure public part Pub i ∈PubSet, execute steps B-2 to B-5;

[0062] Step B-2. Initialize two variables i = 0 and j = 0, and two temporary pointers Pt = H2(e(Pub i , T w )) and Pt ′ = NULL;

[0063] Step B-3. Let i = i + 1, query for the searchable ciphertext that satisfies If it exists, execute step B-4; if not, end the current round of retrieval based on Pub i ;

[0064] Step B-4. Calculate

[0065] Step B-5. If tag = 0, add id to I, let j = i, Pt ′ = Pt, and return to step B-3; if tag = 1 and i = 1, let j = i, Pt ′ = Pt, and return to step B-3; if tag = 1 and i > 1, update the previously retrieved searchable ciphertext such that Physically delete the corresponding searchable ciphertext C i , and execute step B-3;

[0066] Step B-6. After the retrieval for all Pub i ∈PubSet is completed, return the ciphertext file corresponding to the retrieved I to the access party.

[0067] Example 4

[0068] This embodiment provides a file deletion method applied to a cloud server, including: after uploading the target ciphertext obtained by the above file encryption method to the cloud server, when the cloud server receives a deletion request from an access party, according to the deletion request and the public part set PubSet of the hidden structure related to the access party, retrieve the corresponding target ciphertext from all searchable ciphertexts and logically delete the searchable ciphertext related to the target ciphertext, and delete the ciphertext file corresponding to the target ciphertext; PubSet contains at least one public part Pub;

[0069] The deletion request is generated by the access party using the private key SK corresponding to the public key PK and the identifier id″ of the file to be deleted.

[0070] Further, the deletion request is the file deletion trapdoor T id =(H1(id″) s ,id″); s represents the private key SK, and id″ represents the identifier of the file to be deleted.

[0071] Further, logically deleting the searchable ciphertext related to the target ciphertext and deleting the ciphertext file corresponding to the target ciphertext includes:

[0072] Step C-1. Parse the deletion request T id to obtain the retrieval trapdoor H1(id″) s and the identifier id″ of the file to be deleted, and delete the ciphertext file corresponding to id″; for each public part Pub of the hidden structure i ∈PubSet, execute steps C-2 to C-3;

[0073] Step C-2. Initialize the temporary pointer Pt = H2(e(Pub i ,H1(id″) s ));

[0074] Step C-3. Query for the searchable ciphertext C = (L id ,L w ,L id ,L r ,D w ,D id ) that satisfies L = Pt; if there is one, logically delete the corresponding searchable ciphertext by updating and execute step C-3, ∥ represents concatenation; if not, end the deletion based on Pub i .

[0075] Example 5

[0076] This embodiment provides a file retrieval and file deletion method based on searchable public key encryption, which is applied to a cloud storage environment. As Figure 1 shown, the entire file management system includes three types of entities, namely multiple senders, a receiver (access party), and a cloud server. Specifically, it includes the following four processes:

[0077] (1) Upload ciphertext: The sender uses the public key PK and the private part Pri of the hidden structure to generate a searchable ciphertext C = (L w , L id , L r , D w , D id ) for each keyword w of the file to be uploaded, obtaining a set of searchable ciphertexts. The file identifier of the file to be uploaded is id. Then, encrypt the file to be uploaded to generate a ciphertext file. Finally, upload the generated set of searchable ciphertexts and the ciphertext file to the cloud server; The cloud server receives and stores the set of searchable ciphertexts and the ciphertext file;

[0078] (2) Search request: The receiver (access party) uses the private key SK to generate a retrieval trapdoor T w for the keyword w to be retrieved, and submit the retrieval trapdoor T w to the cloud server;

[0079] (3) Return result: The cloud server uses the received retrieval trapdoor T w , the public key PK, and the public part Pub of the hidden structure to retrieve the corresponding searchable ciphertext from all searchable ciphertexts , obtaining a set of matching file identifiers, and further return the corresponding ciphertext file to the receiver (access party);

[0080] (4) Delete request: The receiver (access party) uses the private key SK and the file identifier id of the file to be deleted to generate a file deletion trapdoor T id , and submit the file deletion trapdoor T id to the cloud server; The cloud server uses the received file deletion trapdoor T id , the public key PK, and the public part Pub of the hidden structure to retrieve the corresponding searchable ciphertext from all searchable ciphertexts , logically delete the relevant searchable ciphertext, and delete the corresponding ciphertext file.

[0081] The following describes the specific steps of the file retrieval and file deletion method based on searchable public key encryption, as Figure 2 shown.

[0082] Step 1. Initial parameter setting: Construct a corresponding bilinear mapping according to the security parameters preset by the system, and according to the bilinear mapping and the keyword space preset by the system With the file identifier space Calculate the public key PK and the private key SK, which specifically includes the following 4 steps:

[0083] Step 1-1. Construct a bilinear mapping according to the security parameter k preset by the system Among them, the group and are elliptic curve groups, and the length of the order q of these two elliptic curve groups is equal to the security parameter k;

[0084] Step 1-2. Randomly select a generator g in the elliptic curve group , and randomly select a value from the multiplicative group Let h = g s ;

[0085] Step 1-3. Select three cryptographic hash functions: Let the searchable ciphertext space Among them, is the file identifier space preset by the system;

[0086] Step 1-4. Generate the public key PK and the private key SK according to the results of the above steps 1-1, 1-2, and 1-3: SK = s, where is the keyword space preset by the system.

[0087] Step 2. Hidden structure initialization: The sender randomly selects Generate a pair of private and public parts Pri = {u}, Pub = g u according to the public key PK, and initialize a hidden structure according to Pri and Pub. Among them, Pri is a variable, and the format is When Pri is initialized to {u}, where w is a keyword in the keyword space , Pt[u, w] represents a variable related to the binary tuple (u, w), and id is a file identifier in the file identifier space , and Pt[u, id] represents a variable related to the binary tuple (u, id).

[0088] Step 3. Structured encryption: The sender uses the public key PK and the private part Pri of the hidden structure for each keyword w of the file to be uploaded i ∈WSet to generate searchable ciphertext Get the searchable ciphertext set CSet = {C1,..., C |WSet|}, where WSet is the keyword set corresponding to the file to be uploaded, which can be specified by the encryptor based on the file content, or extracted from the file content using a preset / common keyword extraction algorithm. The file identifier of the file to be uploaded is Then encrypt the file to be uploaded to generate a ciphertext file, and finally upload the generated searchable ciphertext set CSet and the ciphertext file to the cloud server. This includes the following 6 steps:

[0089] Step 3-1. For each keyword w i ∈WSet executes steps 3-2 to 3-5:

[0090] Step 3-2. Pick a random value And let L r =g r ;

[0091] Step 3-3. According to w i Query in Pri (w i ,Pt[u,w i ]), if it does not exist, calculate And add (w i ,Pt[u,w i ]) into Pri, calculate L w =H2(e(h,H1(w i )) u ), Otherwise, randomly select L w =Pt[u,w i ], Update Pri in Pt[u,w i ] is P w ;

[0092] Step 3-4. Query (id, Pt[u, id]) in Pri according to id. If it does not exist, calculate And add (id,Pt[u,id]) to Pri, and let L id =H2(e(h,H1(id)) u ), Otherwise, randomly select Calculate L id =Pt[u,id], Update Pt[u,id] in Pri to P id ;

[0093] Step 3-5. Generate searchable ciphertext C based on the results of steps 3-2, 3-3 and 3-4 i =(L w ,Lid , L r , D w , D id );

[0094] Step 3-6. Encrypt the file to be uploaded, and upload the set of searchable ciphertexts CSet = {C1, …, C |WSet|} and the ciphertext file to the cloud server.

[0095] After the above steps are executed for 4 keyword-file identifier pairs (w1, id1), (w2, id1), (w1, id2), (w2, id2), all the searchable ciphertexts on the cloud server and their hidden relationships are as Figure 3 shown.

[0096] Step 4. Search request: The receiver (access party) uses the private key SK to generate a retrieval trapdoor T w = H1(w) s , and submits the retrieval trapdoor T w to the cloud server.

[0097] Step 5. Ciphertext retrieval: The cloud server uses the received retrieval trapdoor T w , the public key PK, and the set of public parts PubSet of the hidden structure (related to the receiver (access party)), where PubSet contains at least one public part Pub, to retrieve the corresponding searchable ciphertext from all the searchable ciphertexts to obtain the set of matching file identifiers, and further return the corresponding ciphertext file to the receiver (access party), which specifically includes the following 5 steps:

[0098] Step 5-1. Initialize an empty set For each public part Pub of the hidden structure i ∈ PubSet, execute Steps 5-2 to 5-4;

[0099] Step 5-2. Initialize two variables i = 0 and j = 0, and two temporary pointers Pt = H2(e(Pub i , T w )) and Pt ′ = NULL;

[0100] Step 5-3. Let i = i + 1, and query for the searchable ciphertext that satisfies in If not found, end the retrieval based on Pub i ;

[0101] Step 5-4. Calculate If tag = 0, add id to I, let j = i, Pt ′ = Pt, and execute step 5-3; if tag = 1 and i = 1, let j = i, Pt ′ = Pt, and execute step 5-3; if tag = 1 and i > 1, update the previously retrieved searchable ciphertext such that Physically delete the searchable ciphertext C i ; continue to execute step 5-3;

[0102] Step 5-5. The cloud server returns the corresponding ciphertext file to the recipient (accessor) according to the retrieved I.

[0103] Step 6. Delete request: The recipient (accessor) generates a file deletion trapdoor T id = (H1(id) s , id), and submits the file deletion trapdoor T id to the cloud server.

[0104] Step 7. File deletion: The cloud server uses the received file deletion trapdoor T id , the public key PK, and the set of public parts PubSet of the hidden structure (related to the recipient (accessor)), which contains at least one public part Pub, to retrieve the corresponding searchable ciphertext from all searchable ciphertexts and logically delete the relevant searchable ciphertext and delete the corresponding ciphertext file, which specifically includes the following 3 steps:

[0105] Step 7-1. Parse T id = (T id,1 , T id,2 ), and delete the corresponding ciphertext file according to T id,2 ; execute steps 7-2 to 7-3 for each public part Pub i ∈ PubSet;

[0106] Step 7-2. Initialize a temporary pointer Pt = H2(e(Pub i , T id,1 ));

[0107] Step 7-3. Query for the searchable ciphertext C = (L id , L w , L id , L r , D w , D id ) that satisfies L iDeletion; otherwise, by updating Logically delete the searchable ciphertext C, and let And execute step 7-3.

[0108] Those skilled in the art can easily understand that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A file encryption method, characterized in that, Including: S1: Use the keyword space carried and the file identifier space to generate the private part Pri and the public part Pub of the hidden structure with the public key PK, Pub = g u , where u is a preset variable, w' is a preset keyword, id' is a preset file identifier; Pt[,] represents the variable related to the binary tuple [,]; is the keyword space, is the file identifier space, and g is a preset variable in the public key PK; S2: Generate the identifier id of the file to be uploaded and the ciphertexts C corresponding to each keyword w in the keyword set WSet, which includes steps A1 to A3: i The corresponding searchable ciphertext C i =(L w ,L id ,L r ,D w ,D id ) A1: Select a random value r from the q - order multiplicative group and calculate the first ciphertext element L r = g r ; A2: Query w i to see if it exists in the private part Pri; if not, calculate and add (w i , Pt[u, w i ) to Pri, calculate the second ciphertext element L w = H2(e(h, H1(w i )) u ), the third ciphertext element D w = H3(e(h, H1(w i )) r ) ⊕ (0 || id || Pt[u, w i ); if it exists, calculate and replace Pt[u, w i in Pri with P w , calculate L w = Pt[u, w i , D w = H3(e(h, H1(w i )) r ) ⊕ (0 || id || P w ); || represents concatenation; means random sampling and assignment, H1, H2, H3 are three hash functions, e(,) represents bilinear mapping operation, k is a security parameter, h = g s , S is the private key SK corresponding to the public key PK; A3: Query whether the id exists in the private part Pri. If it does not exist, calculate and add (id, Pt[u, id]) to Pri, and calculate the fourth ciphertext element L id = H2(e(h, H1(id)) u ), the fifth ciphertext element D id = H2(e(h, H1(id)) r ) ⊕ Pt[u, id]; if it exists, calculate and replace Pt[u, id] in Pri with the variable P id , calculate L id = Pt[u, id], D id = H2(e(h, H1(id)) r ) ⊕ P id ; S3: Combine the ciphertext file obtained by encrypting the file to be uploaded and the set of searchable ciphertexts CSet = {C1,..., C |WSet|} corresponding to all keywords of the file to be uploaded as the target ciphertext; Before the S1, it further includes: Generating at least a pair of private and public parts (Pri, Pub) of the hidden structure, where the private part Pri is held by itself for the file encryption process; the public part Pub is given to the cloud server for the file retrieval process and the file deletion process; Among them, the process of generating a pair of private and public parts (Pri, Pub) of the hidden structure is as follows: Select a random value u from the multiplicative group of order q That is Calculate the public part Pub = g u , the private part Pri = {u}, the private part Pri is a set, and the encryption process will add or update the elements (w, Pt[u, w]), (id, Pt[u, id]) to Pri, where Pt[,] represents the variable related to the binary tuple [,].

2. The file encryption method according to claim 1, characterized in that, The public key PK is represented as: Group and the group are elliptic curve groups. The orders q of the two elliptic curve groups are the same, and e is a bilinear mapping g is a generator is the searchable ciphertext space The three hash functions are respectively represented as:

3. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 or 2.

4. A file retrieval method, characterized in that, Applied to the cloud server, including: After uploading the target ciphertext obtained by the file encryption method according to Claim 1 or 2 to the cloud server, when the cloud server receives a retrieval request carrying a retrieval keyword from an access party, according to the retrieval request and the set PubSet of the public parts of the hidden structure related to the access party, retrieve the corresponding target ciphertext from all searchable ciphertexts and feedback the corresponding ciphertext file to the access party; PubSet contains at least one public part Pub; Wherein, the retrieval request is generated by the access party using the private key SK corresponding to the public key PK and the retrieval keyword w'.

5. The document retrieval method according to claim 4, characterized in that, The retrieval request is a file retrieval trapdoor T w = H1(w”)s, where s represents the private key and w” represents the retrieval keyword.

6. The document retrieval method according to claim 5, wherein Retrieving the corresponding target ciphertext from all searchable ciphertexts and feeding back the corresponding ciphertext file to the access party, including: Step B-1. Initialize an empty set For each public part Pub of the hidden structure i ∈PubSet, execute steps B-2 to B-5; Step B-2. Initialize two variables i = 0 and j = 0, and two temporary pointers Pt = H2(e(Pub i ,T w )) and Pt' = NULL; Step B-3. Let i = i + 1, and query for the searchable ciphertexts that satisfy in If any exist, execute Step B-4; if not, end this round of retrieval based on Pub i ; Step B-4. Calculate Step B-5. If tag = 0, add id to I, set j = i, Pt' = Pt, and return to Step B-3; if tag = 1 and i = 1, set j = i, Pt' = Pt, and return to Step B-3; if tag = 1 and i > 1, update the previously retrieved searchable ciphertext such that physically delete the corresponding searchable ciphertext C i , and execute Step B-3; Step B-6. When the retrieval for all Pub i ∈ PubSet is completed, the ciphertext file corresponding to I obtained by the retrieval is returned to the access party.

7. A file deletion method, characterized in that, Applied to the cloud server, including: After uploading the target ciphertext obtained by the file encryption method according to Claim 1 or 2 to the cloud server, when the cloud server receives a deletion request from an access party, according to the deletion request and the set PubSet of the public parts of the hidden structure related to the access party, retrieve the corresponding target ciphertext from all searchable ciphertexts retrieve the corresponding target ciphertext, logically delete the searchable ciphertext related to the target ciphertext, and delete the ciphertext file corresponding to the target ciphertext; PubSet contains at least one public part Pub; The deletion request is generated by the access party using the private key SK corresponding to the public key PK and the identifier id” of the file to be deleted.

8. The file deletion method according to claim 7, wherein The deletion request is the file deletion trapdoor T id =(H1(id”) s , id”); s represents the private key SK, and id” represents the identifier of the file to be deleted.

9. The file deletion method according to claim 8, characterized in that, The logically deleting the searchable ciphertext related to the target ciphertext and deleting the ciphertext file corresponding to the target ciphertext includes: Step C-1. Parse the deletion request T id Obtain the retrieval trapdoor H1(id”) s and the identifier id” of the file to be deleted, and delete the ciphertext file corresponding to id”; for each public part Pub i ∈ PubSet, execute Steps C-2 to C-3; Step C-2. Initialize the temporary pointer Pt = H2(e(Pub i ,H1(id”) s )); Step C-3. Query for the searchable ciphertext C=(L id =Pt that satisfies L w , L id , L r , D w , D id ); if there is, logically delete the corresponding searchable ciphertext by updating Pt = D id ⊕ H2(e(L r , T id,1 )) and execute Step C-3, || represents concatenation; if not, end this round of deletion based on Pub i .

Citation Information

Patent Citations

  • Rapid keyword searchable public key encryption method

    CN105007258A

  • Dynamic searchable public key encryption method

    CN105553660A