Verifiable dynamic searchable encryption method based on blockchain and updateable encryption
By verifying the XOR value of the message authentication code on the blockchain, combined with the sub-key encryption keyword and operation mode, the data insecurity and high overhead problems caused by key sharing in the existing technology are solved, and efficient Search and ciphertext integrity assurance.
Patent Information
- Application Number
- CN202210810675.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-11
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-07-11
AI Technical Summary
In existing searchable encryption methods, key sharing requires data users to be completely trustworthy, data integrity and confidentiality cannot be guaranteed, and the storage and computing overhead during the key update process is large.
Adopt a verifiable dynamic searchable encryption method based on the blockchain, generate message authentication codes and encryption results through the data owner, use the blockchain to verify the correctness and confidentiality of the search results, and encrypt keywords and operations through sub-keys method to implement address mapping to improve search efficiency.
Without requiring the data user to be trustworthy, it improves search efficiency, ensures the integrity and confidentiality of ciphertext, and reduces the storage and computing overhead of key updates.
Smart Images

Figure CN115361165B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of searchable encryption, and in particular to a verifiable dynamic searchable encryption method based on blockchain and updateable encryption. Background Art
[0002] The cloud storage method based on searchable encrypted data can solve the problem that the local client data is too large to store on the one hand, and on the other hand, it provides a search function for the encrypted data stored on the cloud server, which is extremely practical and scalable.
[0003] In existing searchable encryption methods, the key is always shared by the data user and the data owner, which requires the data user to be completely trustworthy, which places high security requirements on the data user. The integrity and confidentiality of the data cannot be guaranteed. As a method of updating the key, the updateable method does not need to download the data stored on the cloud service to re-encrypt the data, greatly reducing the storage and computing overhead of the data owner. In addition, the search results are verified through the blockchain, and the correctness, accuracy and confidentiality of the search results are greatly improved. Summary of the invention
[0004] To remedy the deficiencies of the prior art, the present invention provides a verifiable, dynamic, and searchable encryption method based on blockchain and updateable encryption.
[0005] The technical solution of the present invention is:
[0006] The data owner encrypts and uploads the document, and generates a corresponding message authentication code for each document;
[0007] The message authentication code is uploaded to the cloud server and blockchain;
[0008] During the update process, the data owner obtains the keyword w, the id of the document containing the keyword w, and the corresponding operation; the data owner confirms whether the keyword w to be updated has been initialized. If the keyword w has not been initialized, the global counter of the keyword w is initialized to 0 and incremented by 1; if the keyword w has been initialized, the global counter of the keyword is directly incremented by 1;
[0009] The data owner encrypts the keyword to generate the first encryption result E1; the data owner encrypts the data operation method and the document ID to generate the second encryption result E2; and sends E1 and E2 to the blockchain;
[0010] When a data user needs to search for a keyword w, the data owner queries the number of the keyword w stored on the cloud server and encrypts the number and sends it to the data user; the data user generates a list containing the locations of the entries corresponding to the keyword w to be searched in the blockchain, and the data user sends the list to the blockchain;
[0011] The blockchain searches for the corresponding second encryption result E2 and the corresponding message authentication code value according to the value in the list, and calculates the XOR value of the message authentication code; the blockchain sends the queried second encryption result E2 to the data user;
[0012] The data user decrypts the second encryption result E2 to obtain the ID value of the document containing the keyword w; the data user sends the decrypted ID value to the cloud server;
[0013] The cloud server returns the corresponding document to the data user based on the ID value, and sends the message authentication code corresponding to the document to the blockchain, which calculates the XOR value again; the blockchain compares the two XOR values to verify the correctness of the document returned by the cloud server.
[0014] Beneficial effects of the present invention: The present invention is applicable to real-life scenarios where the data user and the data owner are not the same party, and the address mapping method is used, so that the efficiency in the search process is greatly improved. In addition, the ciphertext update method of the present invention achieves CCA and CTXT security, and the verification method of the present invention is based on the XOR value of the blockchain verification message authentication code, which improves the efficiency of verification. Through these technical means, the present invention can greatly improve the integrity and confidentiality of the ciphertext while ensuring efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Schematic diagram of data information flow in the method of the present invention. DETAILED DESCRIPTION
[0016] The present invention comprises the following steps:
[0017] 1) The data owner uses the key k to generate two subkeys k1 and k2.
[0018] 2) The data owner initializes two mappings: the first mapping is used to store encrypted entries and send them to the blockchain; the second mapping is stored locally and uses a global counter to record the number of times the keyword is updated.
[0019] 3) The data owner encrypts and uploads the document and generates a corresponding message authentication code for each document.
[0020] 4) The message authentication code is uploaded to the cloud server and blockchain.
[0021] 5) During the update process, the data owner obtains the keyword w, the id of the document containing the keyword, and the corresponding operation, such as adding or deleting the entry of the document containing the keyword w.
[0022] 6) During the update process, the data owner first confirms whether the keyword to be updated has been initialized through the second mapping. If the keyword has not been initialized, the global counter of the keyword is initialized to 0 and added by 1.
[0023] 7) During the update process, if the keyword has been initialized, the data owner increases the global counter of the keyword by 1.
[0024] 8) The data owner symmetrically encrypts the keyword with key k1 to generate E1; the data owner operates on the data, i.e., adds or deletes it, and the document ID is symmetrically encrypted with key k2 to generate E2.
[0025] 9) The data owner sends E1 and E2 to the blockchain.
[0026] 10) E1 and E2 are stored on the blockchain and connected through a spatial mapping relationship.
[0027] 11) When the data user needs to search for keyword w, the data owner first queries the number of the keyword stored on the cloud server according to the second mapping, and encrypts the number with the key k and sends it to the data user.
[0028] 12) The data user generates a list of E1 based on the quantity. This list of E1 is essentially
[0029] A search token that refers to the keyword to search for.
[0030] 13) The data user sends the list to the blockchain, and the blockchain searches for tokens based on the values in the list.
[0031] And the mapping relationship between E1 and E2, to find the corresponding second encryption result E2 and the corresponding message authentication code value,
[0032] And calculate the XOR value of the message authentication code.
[0033] 14) The blockchain sends the queried second encryption result E2 to the data user.
[0034] 15) The data user decrypts E2 according to the key k2 to obtain the ID value of the document containing the keyword.
[0035] 16) The data user sends the decrypted ID value to the cloud server. The cloud server returns the corresponding document to the data user based on the ID value, and sends the message authentication code corresponding to the document to the blockchain. The blockchain calculates the XOR value again.
[0036] 17) The blockchain compares the two XOR values. If the comparison results are the same, it means that the cloud server has executed the operation normally, thereby verifying the correctness of the document returned by the cloud server.
[0037] When the key of the present invention is updated, the data owner uses the generated key update token to send to the blockchain, and the blockchain calculates the encrypted database according to the algorithm requirements to replace the key. The encrypted database is generated by encrypting the entries.
[0038] Preferably, in step 1), two subkeys are generated by using the key k, and the generation is performed by XOR. The first subkey is used to encrypt the entry, and the second subkey is used to encrypt the update method and the document ID.
[0039] Preferably, in step 1), before encrypting the data to be uploaded to the cloud, the data needs to be preprocessed first, and the documents and document contents are extracted into keyword / document pairs, that is, entries, where the document in the keyword / document pair refers to the document id.
[0040] Preferably, in step 2), a state is maintained for each keyword (the second mapping refers to this state), mainly to store the number of updates of each keyword, that is, the global counter. Each time the database is added or deleted, the global counter needs to be increased by 1. The purpose of the global counter is to use the number of times to search for keywords in the next search process.
[0041] Preferably, in step 10), the keyword is encrypted to generate E1, the operation mode is encrypted to generate E2, and E1 and E2 are sent to the blockchain. The blockchain stores E1 and E2 by spatial mapping, mapping each keyword to the id of the encrypted document. In this way, the search efficiency can be improved while ensuring security.
[0042] Preferably, after the data owner updates the ciphertext, the key previously obtained by the data user is invalid. In the case of not knowing the trustworthiness of the data user, this method can guarantee the non-disclosure and security of the key to the greatest extent, while also ensuring the integrity and confidentiality of the ciphertext.
[0043] Example:
[0044] like Figure 1As shown, before encrypting the data to be uploaded to the cloud, the data needs to be preprocessed. The document and document content are extracted into keyword / document ID pairs. Then the data owner uses the key k to generate two subkeys k1 and k2 through XOR.
[0045] In the initialization phase, two mappings are initialized. The first mapping is used to send to the cloud server to store encrypted entries, and the second mapping is used to store locally. At the same time, in the initialization phase, the data owner encrypts each document and generates a message authentication code, which is then uploaded to the cloud server and blockchain.
[0046] During the update process, the data owner first confirms whether the keyword to be updated is
[0047] Initialized. If the keyword has not been initialized, the global counter of the keyword is initialized to 0.
[0048] And add 1. If the keyword has been initialized, just add 1 again. Then the data owner uses the key k1 to encrypt the keyword to generate E1, and uses the key k2 to encrypt the update method to generate E2. E1 and E2 are sent to the server, and the cloud server stores E1 and E2 through an address mapping.
[0049] The next step is the search process. When the data user needs to search for keyword w, the data owner first queries the number of keyword w in the mapping. Then a list is generated, which contains the location of the corresponding entries stored in the server. This list is sent to the blockchain, which searches for the corresponding E2 based on E1 in the list, sends the encrypted E2 to the data user, and calculates the corresponding message authentication code. The data user decrypts E2 based on the key k2 to obtain the ID value of the document containing the keyword, and sends the ID value to the cloud server. The cloud server returns the corresponding document to the data user and sends the message authentication code to the blockchain, which compares the XOR values of the two message authentication codes. During the key update process, the data owner uses the generated key update token to send to the blockchain. The blockchain calculates the encrypted database according to the algorithm requirements, thereby achieving the function of changing the key without decrypting the database.
[0050] The present invention realizes that the ciphertext stored in the cloud does not need to be downloaded again, and the ciphertext can be re-encrypted by the cloud server, which not only ensures security, but also reduces the communication and computing overhead of the client. The present invention is based on the message authentication code on the blockchain to achieve the purpose of verifying the search results, greatly improving the verification efficiency. By adopting the above technical means, the present invention can greatly improve the integrity and confidentiality of the ciphertext while ensuring efficiency.
Claims
1. A verifiable dynamic searchable encryption method based on blockchain and updateable encryption, characterized by The method comprises the following steps: The data owner encrypts and uploads the document, and generates a corresponding message authentication code for each document; The message authentication code is uploaded to the cloud server and blockchain; During the update process, the data owner obtains the keyword w, the id of the document containing the keyword w, and the corresponding operation; the data owner confirms whether the keyword w to be updated has been initialized. If the keyword w has not been initialized, the global counter of the keyword w is initialized to 0 and incremented by 1; if the keyword w has been initialized, the global counter of the keyword is directly incremented by 1; The data owner encrypts the keyword to generate the first encryption result E1; the data owner encrypts the data operation method and the document ID to generate the second encryption result E2; and sends E1 and E2 to the blockchain; When a data user needs to search for a keyword w, the data owner queries the number of the keyword w stored on the cloud server and encrypts the number and sends it to the data user; the data user generates a list containing the locations of the entries corresponding to the keyword w to be searched in the blockchain, and the data user sends the list to the blockchain; The blockchain searches for the corresponding second encryption result E2 and the corresponding message authentication code value according to the value in the list, and calculates the XOR value of the message authentication code; the blockchain sends the queried second encryption result E2 to the data user; The data user decrypts the second encryption result E2 to obtain the ID value of the document containing the keyword w; the data user sends the decrypted ID value to the cloud server; The cloud server returns the corresponding document to the data user based on the ID value, and sends the message authentication code corresponding to the document to the blockchain, which calculates the XOR value again; the blockchain compares the two XOR values to verify the correctness of the document returned by the cloud server.
2. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 1, characterized in that: It also includes the data owner using the key k to generate two sub-keys k1 and k2; one is used to encrypt the keyword, and the other is used to encrypt the update method and document id.
3. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 2, characterized in that: The key k generates two sub-keys by means of XOR.
4. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 1, characterized in that: It also includes the data owner initializing two mappings. The first mapping is used to store encrypted entries and send them to the cloud server. The second mapping is stored locally and uses a global counter to record the number of times the keyword is updated.
5. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 4, characterized in that: During the update process, the data owner confirms whether the key w to be updated is initialized through the second mapping.
6. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 2, characterized in that: The data owner uses key k1 to encrypt the keyword and key k2 to encrypt the document ID containing the keyword and the corresponding operation.
7. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 1, characterized in that: The first encryption result E1 and the second encryption result E2 are stored on the blockchain and are connected through a spatial mapping relationship.
8. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 1, characterized in that: The data owner encrypts the data update method and document id by performing an XOR operation on the document id and the update method.
9. The verifiable dynamic searchable encryption method based on blockchain and updateable encryption according to claim 1, characterized in that: When keys k1 and k2 are updated, the data owner uses the generated key update token to send to the blockchain, and the blockchain calculates the encrypted database to replace the key.
