File encryption method, file retrieval method and file deletion method
By generating private and public parts of hidden structures and generating searchable ciphertexts, the problem of difficulty in taking into account both rapid search and dynamic updates in the prior art is solved, and efficient dynamic management and rapid retrieval of ciphertexts are achieved.
Patent Information
- Application Number
- CN202411529262.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Existing searchable public key encryption technology is difficult to take into account both rapid retrieval and dynamic updates.
By using the public key PK carrying keyword space and file identifier space to generate the private part Pri and public part Pub of the hidden structure, the searchable ciphertext Ci=(Lw,Lid,Lr,Dw,Did) is generated, and the ciphertext dynamics are supported. Add, delete, and quick keyword search and file identifier search.
It realizes dynamic update without damaging the search efficiency, has the characteristics of sublinear level retrieval complexity and dynamic deletion, and solves the problems of high retrieval complexity and difficulty in update in the prior art.
Smart Images

Figure CN119449314A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field 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 advancement of cloud computing technology, cloud service providers have provided users with convenient storage and computing services to meet the growing demand for data services. In order 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 to perform keyword searches on ciphertexts. It can save users a lot of network and computing overhead 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, SE mechanisms based on public key cryptography are mostly built on bilinear pairing technology, and security is based on difficulty problems (such as DLP, CDH, DDH, BDH, etc.). During the execution process, there is no need for the encryptor and decryptor to negotiate the key 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. The search process requires group element calculation, bilinear pairing mapping, and operations on bilinear pairings, which is costly. Due to the characteristics of bilinear pairings and the existence of difficulty problems, SE mechanisms based on public key cryptography support more complex search statements and are more suitable for insecure networks. In other words, 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 cloud storage, cloud email, electronic health records and other scenarios.
[0004] However, using existing searchable public key encryption algorithms to encrypt files and store them on cloud servers makes it difficult to achieve both fast retrieval and dynamic updates. Summary of the invention
[0005] In view of the above defects or improvement needs of the prior art, the present invention provides a file encryption method, a retrieval method and a deletion method, the purpose of which is to solve the technical problem that it is difficult to balance keyword retrieval and dynamic update when using the existing searchable public key encryption algorithm to encrypt files and store them on a cloud server.
[0006] To achieve the above object, according to one aspect of the present invention, a file encryption method is provided, comprising:
[0007] S1: Utilize the keyword space With 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, id′ is a preset file identifier; Pt[,] represents the variable associated with the tuple [,]; is the keyword space, is the file identifier space;
[0008] 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:
[0009] A1: From the q factorial group Select a random value r from the ciphertext and calculate the first ciphertext element L r =g r ;
[0010] 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 =H 2 (e(h,H 1 (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; Indicates random sampling and assignment, H 1 , H 2 , H 3 are three hash functions, e(,) represents a bilinear mapping operation, k is a security parameter, and g is a preset variable in the public key PK;
[0011] 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 =H 2 (e(h,H 1 (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: Encrypt the file to be uploaded to obtain a ciphertext file and a searchable ciphertext set CSet corresponding to all keywords of the file to be uploaded = {C 1 ,…,C |WSet|}Merge as the target ciphertext.
[0013] In one embodiment, before S1, the method further includes: generating at least one pair of private and public parts (Pri, Pub) of the hidden structure, wherein the private part Pri is held by the user for the file encryption process; the public part Pub is given to the access execution subject for the file retrieval process and the file deletion process;
[0014] The process of generating a pair of private and public parts of a hidden structure (Pri, Pub) is as follows: From the q-order multiplication group Select a random value u from Calculate the public part Pub = g u , the private part Pri = {u}, the private part Pri is a set, the encryption process will add or update (w, Pt[u,w]), (id, Pt[u,id]) elements to Pri, Pt[,] represents the variables related to the tuple [,].
[0015] In one embodiment, the public key PK is expressed as: group Hequn is an elliptic curve group, the order q of the two elliptic curve groups is the same, and e is a bilinear map g is the generator, is the searchable ciphertext space, The three hash functions are expressed as:
[0016] According to another aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned file encryption method when executing the computer program.
[0017] According to another aspect of the present invention, there is provided a file retrieval method, which is applied to a cloud server and comprises:
[0018] After the target ciphertext obtained by the file encryption method is uploaded to the cloud server, when the cloud server receives a search request carrying a search keyword from the access party, according to the search request and the public part set PubSet of the hidden structure related to the access party, the target ciphertext is obtained from all searchable ciphertexts. The corresponding target ciphertext is retrieved from the ciphertext file, and the corresponding ciphertext file is fed back to the accessing party; PubSet contains at least one public part Pub;
[0019] The search request is generated by the accessing party using the private key SK corresponding to the public key PK and the search keyword w'.
[0020] In one embodiment, the search request is a file search trap T w =H 1 (w″) s , s represents the private key, and w″ represents the search keyword.
[0021] In one embodiment, the method of searching all ciphertexts Retrieving the corresponding target ciphertext and feeding back the corresponding ciphertext file to the accessing party includes:
[0022] Step B-1. Initialize an empty collection Expose some Pub for each hidden structure i ∈PubSet executes steps B-2 to B-5;
[0023] Step B-2. Initialize two variables i=0 and j=0, and two temporary pointers Pt=H 2 (e(Pub i ,T w )) and Pt ′ = NULL;
[0024] Step B-3. Let i=i+1, query Satisfied Searchable ciphertext If it exists, execute step B-4; if it does not exist, end this round of Pub-based i Search for;
[0025] Step B-4. Calculation
[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 Make Physically delete the corresponding searchable ciphertext C i , and execute step B-3;
[0027] Step B-6. When all Pub i After executing the search, ∈PubSet returns the ciphertext file corresponding to I obtained by the search to the accessing party.
[0028] According to another aspect of the present invention, a file deletion method is provided, which is applied to a cloud server, comprising: 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 accessing party, according to the deletion request and a public part set PubSet of a hidden structure related to the accessing party, from all searchable ciphertexts Retrieve the corresponding target ciphertext from the 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;
[0029] The deletion request is generated by the accessing party using the private key SK corresponding to the public key PK and the to-be-deleted file representation id″.
[0030] In one embodiment, the deletion request is a file deletion trap T id =(H 1 (id″) s ,id″); s represents the private key SK, id″ represents the identifier of the file to be deleted.
[0031] In one embodiment, the logical deletion of the searchable ciphertext related to the target ciphertext and the deletion of the ciphertext file corresponding to the target ciphertext include:
[0032] Step C-1. Parsing the deletion request T id Get the retrieval trap H 1 (id″) s And the identifier id″ of the file to be deleted, delete id″ corresponding to the ciphertext file; disclose part of Pub for each hidden structure i ∈PubSet executes steps C-2 to C-3;
[0033] Step C-2. Initialize temporary pointer Pt = H 2 (e(Pub i ,H 1 (id″)s ));
[0034] Step C-3. Query Meet L id =Pt's searchable ciphertext C = (L w ,L id ,L r ,D w ,D id ); if it exists, update Logically delete the corresponding searchable ciphertext, let And execute step C-3, ∥ indicates splicing; if it does not exist, end this round of Pub-based i Delete.
[0035] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0036] (1) The present invention provides a file encryption method, which uses a public key PK and a private part Pri of a hidden structure to encrypt keywords and identifiers of a file to be uploaded, and generates a corresponding searchable ciphertext C=(L w ,L id ,L r ,D w ,D id ), 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. This solves the problem that existing searchable public key encryption technology is difficult to take into account both fast keyword retrieval and dynamic update, and enables searchable public key encryption to have the characteristics of sublinear retrieval complexity and dynamic deletion.
[0037] (2) The present invention provides a file retrieval method, by calculating And iterative search is performed according to Pt until all target ciphertext files that meet the search 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 searchable ciphertext that has not been searched, which ensures semantic security. Specifically, in traditional searchable public key encryption, there is an explicit association between the searchable ciphertext and the ciphertext file. Before the search is performed, semantic information such as the number of keywords contained in a file will be leaked, while the present invention will not leak relevant semantic information.
[0038] (3) The present invention provides a file deletion method, query Meet L id =Pt's searchable ciphertext C = (L w,L id ,L r ,D w ,D id ); if it exists, update Logically delete the corresponding searchable ciphertext, let Then execute step C-3, ∥ indicates splicing; if it does not exist, then end the deletion. After the file identifier is retrieved, the corresponding searchable ciphertext is logically deleted first, and in the subsequent related keyword retrieval process, the calculation Identify the searchable ciphertext that has been logically deleted based on the tag and physically delete it. This searchable ciphertext deletion method that combines logical deletion with physical deletion maintains the hidden structure between searchable ciphertexts and ensures retrieval efficiency and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It 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 flow chart 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 a searchable ciphertext hidden structure provided by an embodiment of the present invention, including four keyword-file identifier pairs (w 1 ,id 1 ),(w 2 ,id 1 ),(w 1 ,id 2 ),(w 2 ,id 2 ) corresponding to the searchable ciphertext and its hidden relationship. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended 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] Example 1
[0044] This embodiment provides a file encryption method, including:
[0045] S1: Utilize the keyword space With 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, id′ is a preset file identifier; Pt[,] represents the variable associated with the tuple [,]; is the keyword space, is the file identifier space, 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 =H 2 (e(h,H 1 (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; Indicates random sampling and assignment, H 1 , H 2 , H 3 are three hash functions, e(,) represents a bilinear mapping operation, r is a random number, k is a security parameter, and 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 =H 2 (e(h,H 1 (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: Encrypt the file to be uploaded to obtain a ciphertext file and a searchable ciphertext set CSet corresponding to all keywords of the file to be uploaded = {C 1 ,…,C |WSet|}Merge as the target ciphertext.
[0051] Furthermore, before S1, the method further includes:
[0052] Generate at least one pair of private and public parts (Pri, Pub) of the hidden structure, wherein the private part Pri is held by the user for the file encryption process; the public part Pub is given to the access execution subject for the file retrieval process and the file deletion process;
[0053] The process of generating a pair of private and public parts of a hidden structure (Pri, Pub) is as follows: From the q-order multiplication group Select a random value u from Calculate the public part Pub = g u , the private part Pri={u}, the private part Pri is a set, the encryption process will add or update (w,Pt[u,w]),(id,Pt[u,id]) elements to Pri, Pt[,] represents the variables related to the tuple [,].
[0054] Furthermore, the public key PK is: Among them, the group Hequn is an elliptic curve group, the order q of the two elliptic curve groups is the same, and e is a bilinear map g is the generator, is the searchable ciphertext space, Furthermore, the three hash functions are expressed as:
[0055] Example 2
[0056] This embodiment provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned file encryption method when executing the computer program.
[0057] Example 3
[0058] This embodiment provides a file retrieval method, comprising: after uploading the target ciphertext obtained by the above file encryption method to a cloud server, when the cloud server receives a retrieval request carrying a retrieval keyword from an accessing party, according to the retrieval request and a public part set PubSet of a hidden structure related to the accessing party, from all searchable ciphertexts The corresponding target ciphertext is retrieved and the corresponding ciphertext file is fed back to the accessing party; PubSet contains at least one public part Pub; wherein the retrieval request is generated by the accessing party using the private key SK corresponding to the public key PK and the retrieval keyword w'.
[0059] Furthermore, the search request is a file search trap T w =H 1 (w″) s , s represents the private key, and w″ represents the search keyword.
[0060] Furthermore, from all searchable ciphertext The corresponding target ciphertext is retrieved from the ciphertext file and its corresponding ciphertext file is fed back to the accessing party, including:
[0061] Step B-1. Initialize an empty collection Expose some Pub for each hidden structure i ∈PubSet executes steps B-2 to B-5;
[0062] Step B-2. Initialize two variables i=0 and j=0, and two temporary pointers Pt=H 2 (e(Pub i ,T w )) and Pt ′ = NULL;
[0063] Step B-3. Let i=i+1, query Satisfied Searchable ciphertext If it exists, execute step B-4; if it does not exist, end this round of Pub-based i Search for;
[0064] Step B-4. Calculation
[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 Make Physically delete the corresponding searchable ciphertext C i , and execute step B-3;
[0066] Step B-6. When all Pub i After executing the search, ∈PubSet returns the ciphertext file corresponding to I obtained by the search to the accessing party.
[0067] Example 4
[0068] This embodiment provides a file deletion method, which is applied to a cloud server, comprising: 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 accessing party, according to the deletion request and a public part set PubSet of a hidden structure related to the accessing party, from all searchable ciphertexts Retrieve the corresponding target ciphertext from the 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;
[0069] The deletion request is generated by the accessing party using the private key SK corresponding to the public key PK and the to-be-deleted file representation id″.
[0070] Furthermore, the deletion request is a file deletion trap T id =(H 1 (id″) s ,id″); s represents the private key SK, id″ represents the identifier of the file to be deleted.
[0071] Furthermore, 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. Parsing the deletion request T id Get the retrieval trap H 1 (id″) s And the identifier id″ of the file to be deleted, delete id″ corresponding to the ciphertext file; disclose part of Pub for each hidden structure i ∈PubSet executes steps C-2 to C-3;
[0073] Step C-2. Initialize temporary pointer Pt = H 2(e(Pub i ,H 1 (id″) s ));
[0074] Step C-3. Query Meet L id =Pt's searchable ciphertext C = (L w ,L id ,L r ,D w ,D id ); if it exists, update Logically delete the corresponding searchable ciphertext, let And execute step C-3, ∥ indicates splicing; if it does not exist, end this round of Pub-based i Delete.
[0075] Example 5
[0076] This embodiment provides a file retrieval and file deletion method based on searchable public key encryption, which is applied to cloud storage environments, such as Figure 1 As shown in the figure, the entire file management system includes three types of entities, namely multiple senders, receivers (access parties) and cloud servers. 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 ), obtain a searchable ciphertext set, wherein the file identifier of the file to be uploaded is id, then encrypt the file to be uploaded to generate a ciphertext file, and finally upload the generated searchable ciphertext set and ciphertext file to the cloud server; the cloud server receives and stores the searchable ciphertext set and ciphertext file;
[0078] (2) Search request: The receiver (access party) uses the private key SK to generate a search trap T for the keyword w to be searched. w , and the search trap door T w Submit to the cloud server;
[0079] (3) Return result: The cloud server uses the received retrieval trap T w , the public key PK and the public part Pub of the hidden structure, from all searchable ciphertext Retrieve the corresponding searchable ciphertext, obtain a set of matching file identifiers, and further return the corresponding ciphertext file to the recipient (access party);
[0080] (4) Deletion request: The receiver (accessor) uses the private key SK and the identifier of the file to be deleted id to generate a file deletion trapdoor T id , and delete the file trap T id Submit to the cloud server; the cloud server uses the received file to delete the trapdoor T id , the public key PK and the public part Pub of the hidden structure, from all searchable ciphertext Retrieve the corresponding searchable ciphertext, 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, such as Figure 2 shown.
[0082] Step 1. Initialize parameter settings: Construct the corresponding bilinear mapping according to the system's preset security parameters, and use the bilinear mapping and the system's preset keyword space With file identifier space Calculating the public key PK and private key SK includes the following four steps:
[0083] Step 1-1. Construct a bilinear mapping based on the system's preset security parameter k Among them, the group and are elliptic curve groups, the length of the order q of these two elliptic curve groups is equal to the security parameter k;
[0084] Step 1-2. In the elliptic curve group Randomly select a generator g from the q-order multiplicative group Randomly select a value from Let h = g s ;
[0085] Step 1-3. Select three cryptographic hash functions: Let the searchable ciphertext space in, It is the file identifier space preset by the system;
[0086] Step 1-4. Generate the public key PK and private key SK based on the results of steps 1-1, 1-2 and 1-3 above: SK = s, where It is the system default keyword space.
[0087] Step 2. Hidden structure initialization: The sender randomly selects Generate a pair of private and public parts Pri = {u}, Pub = g according to the public key PK u, and initialize a hidden structure based on Pri and Pub. Pri is a variable in the format Pri is initialized to {u}, where w is the keyword space Pt[u,w] represents a variable associated with the tuple (u,w), and id is the file identifier space. A file identifier in , Pt[u,id] represents a variable associated with the tuple (u,id).
[0088] Step 3. Structured encryption: The sender uses the public key PK and the private part of the hidden structure Pri for each keyword w of the file to be uploaded. i ∈WSet generates searchable ciphertext Get the searchable ciphertext set CSet = {C 1 ,…,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 =H 2 (e(h,H 1 (w i )) u ), Otherwise, randomly select L w =Pt[u,w i ], Update Pri in Pt[u,wi ] 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 =H 2 (e(h,H 1 (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 ,L id ,L r ,D w ,D id );
[0094] Step 3-6. Encrypt the file to be uploaded and set the searchable ciphertext set CSet = {C 1 ,…,C |WSet|} and the ciphertext file are uploaded to the cloud server.
[0095] When there are 4 keyword-file identifier pairs (w 1 ,id 1 ),(w 2 ,id 1 ),(w 1 ,id 2 ),(w 2 ,id 2 ) After completing the above steps, all searchable ciphertext on the cloud server And its hidden relationship such as Figure 3 shown.
[0096] Step 4. Search request: The receiver (access party) uses the private key SK to generate a search trap T for the keyword w to be searched w =H 1 (w) s , and the search trap door T w Submit to the cloud server.
[0097] Step 5. Ciphertext retrieval: The cloud server uses the received retrieval trap T w, public key PK and the public part set PubSet of the hidden structure (related to the receiver (accessor)), PubSet contains at least one public part Pub, from all searchable ciphertext The corresponding searchable ciphertext is retrieved from the ciphertext, a matching file identifier set is obtained, and the corresponding ciphertext file is further returned to the recipient (access party), which specifically includes the following five steps:
[0098] Step 5-1. Initialize an empty collection Expose some Pub for each hidden structure i ∈PubSet executes steps 5-2 to 5-4;
[0099] Step 5-2. Initialize two variables i=0 and j=0, and two temporary pointers Pt=H 2 (e(Pub i ,T w )) and Pt ′ = NULL;
[0100] Step 5-3. Let i=i+1, query Satisfied Searchable ciphertext If it does not exist, end this round based on Pub i Search for;
[0101] Step 5-4. Calculation 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 Make Physical deletion of searchable ciphertext C i ; Continue to step 5-3;
[0102] Step 5-5. The cloud server returns the corresponding ciphertext file to the recipient (access party) based on the retrieved I.
[0103] Step 6. Deletion request: The receiver (access party) uses the private key SK and the identifier of the file to be deleted id to generate the file deletion trapdoor T id =(H 1 (id) s ,id), and delete the file trap T id Submit to the cloud server.
[0104] Step 7. File deletion: The cloud server uses the received file to delete the trapdoor T id , the public key PK and the public part set PubSet of the hidden structure (related to the receiver (accessor)), which contains at least one public part Pub, from all searchable ciphertext Retrieve the corresponding searchable ciphertext from the database, logically delete the relevant searchable ciphertext, and delete the corresponding ciphertext file. This includes the following three steps:
[0105] Step 7-1. Analyze T id =(T id,1 ,T id,2 ), according to T id,2 Delete the corresponding ciphertext file; disclose part of Pub for each hidden structure i ∈PubSet executes steps 7-2 to 7-3;
[0106] Step 7-2. Initialize a temporary pointer Pt = H 2 (e(Pub i ,T id,1 ));
[0107] Step 7-3. Query Meet L id =Pt's searchable ciphertext C = (L w ,L id ,L r ,D w ,D id ); if it does not exist, then end this round based on Pub i Delete; otherwise, update Logically delete the searchable ciphertext C, and let And execute step 7-3.
[0108] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A file encryption method, characterized in that: include: S1: Utilize the keyword space With 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, id′ is a preset file identifier; Pt[,] represents the variable associated with the tuple [,]; is the keyword space, is the file identifier space, g is a preset variable in the public key PK; 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: A1: From the q factorial group Select a random value r from the ciphertext and calculate the first ciphertext element L r =g r ; 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, k is a security parameter, h = g s , s is the private key SK corresponding to the public key PK; 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], S3: Encrypt the file to be uploaded to obtain a ciphertext file and a searchable ciphertext set CSet corresponding to all keywords of the file to be uploaded = {C1, ..., C |WSet| }Merge as the target ciphertext.
2. The file encryption method according to claim 1, characterized in that: Before the S1, it also includes: Generate at least one pair of private and public parts (Pri, Pub) of the hidden structure, where the private part Pri is kept by itself and used in the file encryption process; the public part Pub is given to the cloud server for the file retrieval process and the file deletion process; The process of generating a pair of private and public parts of a hidden structure (Pri, Pub) is as follows: From the q-order multiplication group Select a random value u from Calculate the public part Pub = g u , the private part Pri = {u}, the private part Pri is a set, the encryption process will add or update (w, Pt[u,w]), (id, Pt[u,id]) elements to Pri, Pt[,] represents the variables related to the tuple [,].
3. The file encryption method according to claim 1, characterized in that: The public key PK is expressed as: group Hequn is an elliptic curve group, the order q of the two elliptic curve groups is the same, and e is a bilinear map g is the generator, is the searchable ciphertext space, The three hash functions are expressed as:
4. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
5. A file retrieval method, characterized in that: Applied to cloud servers, including: After the target ciphertext obtained by the file encryption method according to any one of claims 1 to 3 is uploaded to the cloud server, when the cloud server receives a search request carrying a search keyword from an accessing party, according to the search request and the public part set PubSet of the hidden structure related to the accessing party, the target ciphertext is obtained from all searchable ciphertexts. The corresponding target ciphertext is retrieved from the ciphertext file, and the corresponding ciphertext file is fed back to the accessing party; PubSet contains at least one public part Pub; The search request is generated by the accessing party using the private key SK corresponding to the public key PK and the search keyword w'.
6. The file retrieval method according to claim 5, characterized in that: The retrieval request is a file retrieval trap T w =H1(w″) s , s represents the private key, and w″ represents the search keyword.
7. The file retrieval method according to claim 6, characterized in that: From all searchable ciphertext Retrieving the corresponding target ciphertext and feeding back the corresponding ciphertext file to the accessing party includes: Step B-1. Initialize an empty collection Expose some Pub for each hidden structure i ∈PubSet executes 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, query Satisfied Searchable ciphertext If it exists, execute step B-4; if it does not exist, end this round of Pub-based i Search for; Step B-4. Calculation 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 Make Physically delete the corresponding searchable ciphertext C i , and execute step B-3; Step B-6. When all Pub i After executing the search, ∈PubSet returns the ciphertext file corresponding to I obtained by the search to the accessing party.
8. A file deletion method, characterized in that: Applied to cloud servers, including: After the target ciphertext obtained by the file encryption method according to any one of claims 1 to 3 is uploaded to the cloud server, when the cloud server receives a deletion request from the access party, according to the deletion request and the public part set PubSet of the hidden structure related to the access party, the target ciphertext is obtained from all searchable ciphertexts. Retrieve the corresponding target ciphertext from the 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 accessing party using the private key SK corresponding to the public key PK and the to-be-deleted file representation id″.
9. The file deletion method according to claim 8, characterized in that: The deletion request is a file deletion trap T id =(H1(id″) s ,id″); s represents the private key SK, id″ represents the identifier of the file to be deleted.
10. The file deletion method according to claim 9, characterized in that: The logical deletion of the searchable ciphertext related to the target ciphertext and the deletion of the ciphertext file corresponding to the target ciphertext includes: Step C-1. Parsing the deletion request T id Get the search trap H1(id″) s And the identifier id″ of the file to be deleted, delete id″ corresponding to the ciphertext file; disclose part of Pub for each hidden structure i ∈PubSet executes steps C-2 to C-3; Step C-2. Initialize temporary pointer Pt = H2(e(Pub i ,H1(id″) s )); Step C-3. Query Meet L id =Pt's searchable ciphertext C = (L w ,L id ,L r ,D w ,D id ); if it exists, update Logically delete the corresponding searchable ciphertext, let And execute step C-3, ∥ indicates splicing; if it does not exist, end this round of Pub-based i Delete.
Citation Information
Patent Citations
Rapid keyword searchable public key encryption method
CN105007258A
Dynamic searchable public key encryption method
CN105553660A
Parallelized and structured public key searchable encryption method
CN107086917A
Multi-keyword searchable encryption method supporting numerical attribute comparison
CN108156140A
Searchable public key encryption method, system employing method and server
CN108200063A