Ciphertext data indexing method and device, equipment, storage medium and program product
Through the ciphertext data indexing method based on user attributes on the blockchain, the problems of access policy complexity and privacy leakage in the existing technology are solved, efficient ciphertext data indexing and user information security are achieved, and the encryption and decryption calculation is reduced And ensure user anonymity.
Patent Information
- Application Number
- CN202410873703.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-11-08
AI Technical Summary
The existing attribute-based ciphertext data retrieval method has problems with user access policy privacy leakage and access policy complexity. Unhidden attribute access policy may disclose user identity information. Complex access policy increases the user's encryption and decryption computing burden, and for Malicious internal attackers such as data users and servers are not anonymous.
By implementing a ciphertext data index method based on user attributes on the blockchain, the search trap is received, and the keyword index ciphertext collection matches. If it matches, pre-decryption calculation is performed based on the conversion key to obtain the pre-decryption result. Send it to the data user, the conversion key is determined based on the attribute key of the user's attribute set, and the access control policy is used to indicate the attributes allowed to access, reducing the overhead of encryption and decryption calculations and ensuring the user's anonymity.
It improves the overall ciphertext data indexing efficiency, improves the user information security during indexing, reduces encryption and decryption calculations through attribute matching, ensures the anonymity of user attributes, and enhances data protection.
Smart Images

Figure CN118916524A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of big data technology, and in particular, relates to a method, device, equipment, storage medium and program product for indexing ciphertext data. Background Art
[0002] At present, searchable encryption technology can realize data encryption and ciphertext retrieval at the same time, significantly improving the security and flexibility of data sharing. The integration of blockchain technology and searchable encryption technology can effectively solve the technical barriers in traditional data circulation, sharing and privacy protection research, enhance the trust of data circulation, promote the digitalization process of various industries, and promote data assetization. Attribute encryption technology can achieve fine-grained access control of privacy data.
[0003] However, most of the existing attribute-based ciphertext data retrieval methods have the problems of user access policy privacy leakage and complex access policies. Unhidden attribute access policies may leak user identity information, complex access policies make the encryption and decryption calculation burden of users heavy, and access policy attributes are not anonymous to malicious internal attackers such as data users and servers.
[0004] Based on this, the industry is still in urgent need of a new ciphertext data indexing solution to effectively improve the overall ciphertext data indexing efficiency and improve user information security during indexing. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device, storage medium and program product for indexing ciphertext data, which can index ciphertext data based on user attributes, thereby effectively improving the overall ciphertext data indexing efficiency and improving the security of user information during indexing.
[0006] In a first aspect, an embodiment of the present application provides a ciphertext data indexing method, which is applied to a blockchain. The ciphertext data indexing method includes:
[0007] Receive search traps sent by data users;
[0008] In response to the search trap, detecting whether a keyword index ciphertext set has a keyword index ciphertext that matches the search trap;
[0009] If the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, and the data user's conversion key meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, the keyword matching result ciphertext is pre-decrypted based on the conversion key to obtain a pre-decrypted result;
[0010] The pre-decryption result is sent to the data user so that the data user can decrypt the pre-decryption result to obtain the shared file plaintext; wherein the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
[0011] In some possible implementations, the conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute of the same classification as the first attribute;
[0012] When the conversion key of the data user meets the access control policy of the target keyword index ciphertext, the keyword matching result ciphertext is pre-decrypted based on the conversion key to obtain the pre-decryption result, including:
[0013] When the first attribute is higher than or equal to the second attribute, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0014] When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
[0015] In some possible implementations, before performing a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the ciphertext data indexing method further includes:
[0016] Receive the conversion key of the data user sent by the attribute authorization center;
[0017] The attribute authorization center is used to encrypt the attribute key based on the attribute set of the data user, and perform secondary encryption on the attribute key to obtain a conversion key.
[0018] In some possible implementations, before performing a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the ciphertext data indexing method further includes:
[0019] When the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within the preset time period does not exceed the preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0020] When the cloud server determines that the number of accesses exceeds a preset access number threshold, receiving a blockchain sending encrypted access rejection instruction sent by the cloud server;
[0021] In response to the ciphertext access denial instruction, the data user is denied access to the keyword matching result ciphertext.
[0022] In some possible implementations, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result, including:
[0023] In the case where the keyword matching result ciphertext is a short-term file ciphertext, a pre-decryption calculation is performed on the keyword matching result ciphertext pre-stored in the blockchain based on the conversion key to obtain a pre-decryption result;
[0024] In the case where the keyword matching result ciphertext is a long-term file ciphertext, when the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within a preset time period does not exceed a preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result, including:
[0025] Initiate a ciphertext access request for the ciphertext of the keyword matching result to the cloud server;
[0026] When the number of accesses does not exceed a preset access number threshold, the stored keyword matching result ciphertext is sent to the blockchain;
[0027] A pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result.
[0028] In some possible implementations, the ciphertext data indexing method further includes:
[0029] When N data owners upload N keyword matching result ciphertexts to the cloud server, N equivalence test trapdoors sent by the N data owners are received; the N equivalence test trapdoors correspond to the N keyword matching result ciphertexts one by one;
[0030] After performing an equivalence test on the N equivalence test trapdoors, a data deduplication request for the keyword matching result ciphertext is sent to the cloud server, where the data deduplication request is used to instruct the cloud server to perform data deduplication on the N keyword matching result ciphertexts.
[0031] In some possible implementations, the search trapdoor is generated based on an index keyword set that the data user is interested in; before detecting, in response to the search trapdoor, whether a keyword index ciphertext set has a keyword index ciphertext that matches the search trapdoor, the ciphertext data indexing method further includes:
[0032] Receive a keyword index ciphertext set uploaded by a data owner corresponding to the keyword matching result ciphertext, wherein the keyword index ciphertext set includes the target keyword index ciphertext;
[0033] In response to the search trap, detecting whether a keyword index ciphertext set contains a keyword index ciphertext that matches the search trap, including:
[0034] Based on the search trap, determine the index keyword set;
[0035] Based on the index keyword set, detect whether there is a keyword index ciphertext in the keyword index ciphertext set that matches the search trap.
[0036] In some possible implementations, before detecting, in response to the search trapdoor, whether there is a keyword index ciphertext set that matches the search trapdoor, the ciphertext data indexing method further includes:
[0037] The target keyword index ciphertext corresponding to the shared file plaintext sent by the data owner is received; the target keyword index ciphertext is obtained by the data owner extracting the keyword from the shared file plaintext and encrypting it; the keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext.
[0038] Based on the same inventive concept, in a second aspect, an embodiment of the present application provides a ciphertext data indexing method, which is applied to a data user. The ciphertext data indexing method includes:
[0039] Sending a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap;
[0040] In the case where the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, a pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain is received; wherein, in the case where the conversion key of the data user conforms to the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext;
[0041] Decrypt the pre-decryption result to obtain the shared file plaintext.
[0042] In some possible implementations, the conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute of the same classification as the first attribute;
[0043] When the first attribute is higher than or equal to the second attribute, pre-decryption calculation is performed on the ciphertext of the keyword matching result based on the conversion key to obtain a pre-decryption result;
[0044] When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
[0045] In some possible implementations, before sending the search trapdoor to the blockchain, the ciphertext data indexing method further includes:
[0046] The attribute set of the data user is sent to the attribute authorization center. The attribute authorization center is used to encrypt the attribute set to obtain the attribute key, and re-encrypt the attribute key to obtain the conversion key, and send the conversion key to the blockchain.
[0047] In some possible implementations, the keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext, and the target keyword index ciphertext is obtained by the data owner extracting a keyword set from the shared file plaintext and encrypting it.
[0048] In some possible implementations, before sending the search trapdoor to the blockchain, the ciphertext data indexing method further includes:
[0049] Set the set of index keywords of interest;
[0050] Generate search trapdoors based on index keyword sets.
[0051] Based on the same inventive concept, in a third aspect, an embodiment of the present application provides a ciphertext data indexing device, which is applied to a blockchain, and the ciphertext data indexing device includes:
[0052] A first receiving module, used for receiving a search trap sent by a data user;
[0053] A first detection module, configured to detect, in response to the search trap, whether there is a keyword index ciphertext set that matches the search trap;
[0054] A first calculation module is used for, if the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, and if the conversion key of the data user meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0055] The first sending module is used to send the pre-decryption result to the data user, so that the data user decrypts the pre-decryption result to obtain the shared file plaintext; wherein the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
[0056] Based on the same inventive concept, in a fourth aspect, an embodiment of the present application provides a ciphertext data indexing device, which is applied to a data user. The ciphertext data indexing device includes:
[0057] The second sending module is used to send a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap;
[0058] The second receiving module is used to receive the pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain when the search trap matches the target keyword index ciphertext in the keyword index ciphertext set; wherein, when the conversion key of the data user meets the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext;
[0059] The first decryption module is used to decrypt the pre-decryption result to obtain the shared file plaintext.
[0060] In a fifth aspect, an embodiment of the present application provides a ciphertext data indexing device, the ciphertext data indexing device comprising:
[0061] a processor and a memory storing computer program instructions;
[0062] When the processor executes the computer program instructions, it implements the ciphertext data indexing method provided in any one of the above-mentioned embodiments of the present application.
[0063] In a sixth aspect, an embodiment of the present application provides a computer storage medium, on which computer readable storage medium is stored computer program instructions, and when the computer program instructions are executed by a processor, a ciphertext data indexing method as provided in any one of the above-mentioned embodiments of the present application is implemented.
[0064] In the seventh aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a ciphertext data indexing method provided in any one of the above-mentioned embodiments of the present application.
[0065] It can be seen from the above description that a method, device, equipment, storage medium and program product for indexing ciphertext data in an embodiment of the present application, the blockchain receives a search trap to query and detect the target keyword index ciphertext, thereby determining the keyword matching result ciphertext corresponding to the target keyword index ciphertext, and detects whether the data user has the decryption access right to the keyword matching result ciphertext according to whether the conversion key of the data user matches the access control policy corresponding to the keyword matching result ciphertext. When the conversion key satisfies the access control policy, it is equivalent to the attribute set of the data user meeting the attributes allowed by the access control policy. In this case, the keyword matching result ciphertext is pre-decrypted and settled based on the conversion key, thereby obtaining the pre-decryption result and sending it to the data user. In this way, the embodiment of the present application reduces the data encryption and decryption calculation overhead through attribute matching, and because the conversion key is the encryption result after multiple encryption of the user attribute set, the user attribute is guaranteed to be partially anonymous to the data owner and the blockchain, thereby effectively improving the overall ciphertext data indexing efficiency and improving the user information security during indexing. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0067] Figure 1 It is a flowchart of a ciphertext data indexing method provided in one embodiment of the present application;
[0068] Figure 2 is a flowchart of a ciphertext data indexing method provided by another embodiment of the present application;
[0069] Figure 3 It is a scenario flow diagram of a ciphertext data indexing method provided in an embodiment of the present application;
[0070] Figure 4 This is a schematic diagram of the timing of a scenario of a ciphertext data indexing method provided in an embodiment of the present application;
[0071] Figure 5 It is a structural diagram of a ciphertext data indexing device provided in one embodiment of the present application;
[0072] Figure 6 is a structural schematic diagram of a ciphertext data indexing device provided in another embodiment of the present application;
[0073] Figure 7 It is a structural diagram of a ciphertext data indexing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0074] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0075] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0076] As mentioned in the background technology section, Web3.0, also known as the intelligent network, is the next generation of the Internet. Its main purpose is to achieve a more intelligent and personalized network experience through artificial intelligence and machine learning technologies. Web3.0 aims to meet users' needs for information retrieval and interaction by providing more powerful search functions, supporting more multimedia content, and better network security and privacy protection. From a technical perspective, the bottom of the Web3.0 stack is the protocol layer, with blockchain as the underlying technical architecture, and everything else is built on top of it.
[0077] As a new type of Internet technology, blockchain is highly decentralized and highly trusted. It combines cryptography, peer-to-peer network communication, consensus mechanism, smart contract programming and other technical means. The addition of blockchain has greatly improved the transparency of industry data, and data sharing and circulation has become more reliable and convenient. In the data asset transaction based on blockchain technology in the Web3.0 scenario, the limited computing power and storage space of local devices make it difficult to effectively analyze and process data. Data is usually uploaded to the cloud by the data owner for storage and calculation. The cloud gathers a large amount of computing and storage resources, and users with limited resources can request flexible and scalable data computing and hosting services from the cloud. However, security threats such as tampering, theft, and counterfeiting in the distributed data circulation and sharing environment may cause economic losses and privacy leaks to manufacturing companies and individual users. In order to ensure the security of private data circulation, data owners usually use cryptographic algorithms to encrypt private data and upload ciphertext data to cloud servers, but data in ciphertext form makes data retrieval operations difficult.
[0078] Searchable encryption technology can achieve data encryption and ciphertext retrieval at the same time, significantly improving the security and flexibility of data sharing. The integration of blockchain technology and searchable encryption technology can effectively solve the technical barriers in traditional data circulation, sharing and privacy protection research, improve the trust of data circulation, promote the digitalization process of various industries, and promote data assetization. Attribute encryption technology can achieve fine-grained access control of private data. Sahai et al. proposed attribute encryption in 2005. Attribute encryption technology uses a series of user attributes as identity identifiers and formulates access policies that match the attribute set to achieve one-to-many data sharing and fine-grained data access control. In order to achieve fine-grained multi-user ciphertext retrieval, scholars have proposed an attribute-based ciphertext retrieval scheme (Attribute-Based Keyword Search, ABKS). Designing an attribute-based ciphertext retrieval scheme with functions such as policy hiding and outsourced decryption in Web3.0 application scenarios is a challenging problem.
[0079] In some specific situations, it is necessary to test whether two different ciphertexts are generated by encrypting the same plaintext without decryption. The two ciphertexts can be generated by the same public key or different public keys. In this case, public key encryption schemes that support equivalence testing come into being. In a public key ciphertext equivalence test scheme, two ciphertexts generated by public keys of different users are stored on the server side. A third party in the system can test whether the plaintexts that generate the two ciphertexts are equal without decrypting the two ciphertexts.
[0080] However, most of the existing attribute-based ciphertext data retrieval methods have the problems of user access policy privacy leakage and complex access policies. Unhidden attribute access policies may leak user identity information, complex access policies make the encryption and decryption calculation burden of users heavy, and access policy attributes are not anonymous to malicious internal attackers such as data users and servers.
[0081] In view of the above, in order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and program product for indexing ciphertext data. It should be noted that the embodiments provided in the present application are not intended to limit the scope of the present application.
[0082] The following first introduces the ciphertext data indexing method provided in the embodiment of the present application.
[0083] Figure 1 The flowchart of the ciphertext data indexing method provided by an embodiment of the present application is shown. The ciphertext data indexing method is applied to blockchain. Figure 1 As shown, the ciphertext data indexing method includes the following steps:
[0084] S110, receiving a search trap sent by a data user;
[0085] S120, in response to the search trap, detecting whether there is a keyword index ciphertext set that matches the search trap;
[0086] S130, if the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, and if the conversion key of the data user meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0087] S140, sending the pre-decryption result to the data user, so that the data user decrypts the pre-decryption result to obtain the shared file plaintext; wherein, the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
[0088] It can be seen from the above description that in a ciphertext data indexing method of an embodiment of the present application, the blockchain receives a search trap to query and detect the target keyword index ciphertext, thereby determining the keyword matching result ciphertext corresponding to the target keyword index ciphertext, and detects whether the data user has decryption access rights to the keyword matching result ciphertext based on whether the conversion key of the data user matches the access control policy corresponding to the keyword matching result ciphertext. When the conversion key satisfies the access control policy, it is equivalent to the attribute set of the data user meeting the attributes allowed by the access control policy. In this case, the keyword matching result ciphertext is pre-decrypted and settled based on the conversion key, thereby obtaining the pre-decryption result and sending it to the data user.
[0089] In this way, the embodiment of the present application reduces the computational overhead of data encryption and decryption through attribute matching. At the same time, since the conversion key is the encryption result after multiple encryption of the user attribute set, the user attributes are guaranteed to be partially anonymous to the data owner and the blockchain, thereby effectively improving the overall ciphertext data indexing efficiency and improving the user information security during indexing.
[0090] The specific implementation of the above steps 110 to 140 is described in detail below.
[0091] In S110, during specific implementation, the data user generates a search trap containing multiple keywords and sends the search trap to the blockchain, where the blockchain receives the search trap sent by the data user.
[0092] In S120, in a specific implementation, after the blockchain receives the search trap, in response to the search trap, it is detected whether there is a keyword index ciphertext in the keyword index ciphertext set that matches the search trap.
[0093] According to some embodiments of the present application, optionally, more specifically, in order to more reasonably detect the search trap, the search trap is generated based on the index keyword set that the data user is interested in. Before detecting, in response to the search trap, whether there is a keyword index ciphertext set that matches the search trap, the ciphertext data indexing method further includes:
[0094] Receive a keyword index ciphertext set uploaded by a data owner corresponding to the keyword matching result ciphertext, wherein the keyword index ciphertext set includes the target keyword index ciphertext;
[0095] In response to the search trap, detecting whether a keyword index ciphertext set contains a keyword index ciphertext that matches the search trap, including:
[0096] Based on the search trap, determine the index keyword set;
[0097] Based on the index keyword set, detect whether there is a keyword index ciphertext in the keyword index ciphertext set that matches the search trap.
[0098] In the specific implementation, the data owner will encrypt the shared file plaintext and obtain the corresponding keyword matching result ciphertext. The data owner will also extract and encrypt each keyword from the shared file plaintext to generate the corresponding keyword index ciphertext set, and transmit this keyword index ciphertext set to the blockchain.
[0099] After receiving the search trap, the blockchain parses the search trap to determine the index keyword set. The keywords in the index keyword set are respectively detected and compared with the keyword index ciphertexts in the keyword index ciphertext set to determine whether the target keyword index ciphertext in the keyword index ciphertext set matches the search trap.
[0100] According to some embodiments of the present application, optionally, in order to more reasonably ensure the security of the shared file plaintext stored in the blockchain, before responding to the search trap and detecting whether the keyword index ciphertext set has a keyword index ciphertext that matches the search trap, the ciphertext data indexing method further includes:
[0101] The target keyword index ciphertext corresponding to the shared file plaintext sent by the data owner is received; the target keyword index ciphertext is obtained by the data owner extracting the keyword set from the shared file plaintext and encrypting it; the keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext.
[0102] In this embodiment, the data owner extracts keywords from the shared file plaintext in advance, and encrypts the extracted keywords to obtain the target keyword index ciphertext, and sends the target keyword index to the blockchain. In this way, the data owner encrypts the private file data and the file keyword index, generates the file ciphertext and the keyword index ciphertext, and stores the short-term file ciphertext and the keyword index ciphertext in the blockchain, which fully guarantees the security of the data file and the index data.
[0103] It should be added that the data owner may extract multiple keywords and send the ciphertexts of the multiple keywords to the blockchain in the form of a ciphertext set, where the multiple keywords include the keywords corresponding to the target keyword ciphertext. This application does not impose any restrictions on this.
[0104] In S130, during the specific implementation, if the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, and the data user's conversion key conforms to the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result.
[0105] The above conversion key is determined based on the attribute key corresponding to the attribute set of the data user.
[0106] More specifically, before performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the ciphertext data indexing method further includes:
[0107] Receive the conversion key of the data user sent by the attribute authorization center;
[0108] The attribute authorization center is used to encrypt the attribute key based on the attribute set of the data user, and perform secondary encryption on the attribute key to obtain a conversion key.
[0109] Exemplarily, the attribute authorization center runs a system initialization algorithm to generate system public parameters, attribute keys of data users, and conversion keys, and stores the conversion keys of data users in the blockchain.
[0110] The access control policy is used to indicate the attributes of the data users who are allowed to access the ciphertext of the keyword matching result. The access control policy can be pre-defined by the data owner and sent to the blockchain, which is not limited in this embodiment.
[0111] According to some embodiments of the present application, optionally, more specifically, in order to fully realize user access based on attributes, the above conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute with the same classification as the first attribute;
[0112] When the conversion key of the data user meets the access control policy of the target keyword index ciphertext, the keyword matching result ciphertext is pre-decrypted based on the conversion key to obtain the pre-decryption result, including:
[0113] When the first attribute is higher than or equal to the second attribute, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0114] When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
[0115] The first attribute and the second attribute may be, for example, the user's job level, etc., which is not limited in this embodiment.
[0116] In this embodiment, in order to solve the problem of user access policy privacy leakage and complex access policy in the attribute-based ciphertext data retrieval method, an attribute-based ciphertext retrieval scheme that supports attribute classification and ranking is designed. Specifically, the same attributes are ranked from high to low according to the attribute permissions, and the high-order attributes can access the data encrypted by the low-order attributes.
[0117] In this way, in the preliminary preparation stage, the data owner only needs to use the lowest-order attributes to encrypt the user, which reduces the computational overhead of data encryption and decryption while ensuring that the user attributes are partially anonymous to the data owner and the pre-decryption server.
[0118] In S140, in specific implementation, after the pre-decryption calculation obtains the pre-decryption result, the pre-decryption result is sent to the data user, so that the data user decrypts the pre-decryption result to obtain the shared file plaintext. When the data user decrypts the pre-decryption result, the data user can use the attribute key of the data user or adopt a preset decryption algorithm, etc., which is not strictly limited in this embodiment.
[0119] According to some embodiments of the present application, optionally, in order to fully guarantee secure access to stored ciphertext data, before performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the ciphertext data indexing method may further include:
[0120] When the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within the preset time period does not exceed the preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0121] When the cloud server determines that the number of accesses exceeds a preset access number threshold, receiving a blockchain sending encrypted access rejection instruction sent by the cloud server;
[0122] In response to the ciphertext access denial instruction, the data user is denied access to the keyword matching result ciphertext.
[0123] In this embodiment, in combination with actual data access scenarios, in order to effectively solve the problem of being unable to resist denial of service attacks initiated by external attackers during the retrieval process of encrypted data, this embodiment limits the number of accesses to outsourced data (encrypted data uploaded by the data owner).
[0124] The cloud server needs to detect whether the number of accesses is less than the preset access number threshold. The preset access number threshold can be set by the data owner of the corresponding ciphertext data or by the cloud server, and the specific setting value is not strictly limited in this embodiment.
[0125] In this way, if a malicious user accesses the same ciphertext data multiple times, the cloud server will deny the user's data access when it detects that the number of accesses has exceeded the limit, thereby effectively avoiding denial of service attacks initiated by malicious users.
[0126] According to some embodiments of the present application, optionally, in combination with actual ciphertext data storage scenarios, the pre-decryption calculation of the keyword matching result ciphertext based on the conversion key is performed to obtain the pre-decryption result, including:
[0127] In the case where the keyword matching result ciphertext is a short-term file ciphertext, a pre-decryption calculation is performed on the keyword matching result ciphertext pre-stored in the blockchain based on the conversion key to obtain a pre-decryption result;
[0128] In the case where the keyword matching result ciphertext is a long-term file ciphertext, when the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within a preset time period does not exceed a preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result, including:
[0129] Initiate a ciphertext access request for the ciphertext of the keyword matching result to the cloud server;
[0130] When the number of accesses does not exceed a preset access number threshold, the stored keyword matching result ciphertext is sent to the blockchain;
[0131] A pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result.
[0132] In this embodiment, if the keyword matching result is a short-term ciphertext, it can be directly stored in the blockchain. If the keyword matching result is a long-term ciphertext, it can be stored in the cloud server for storage. In this way, when the keyword matching result ciphertext is a long-term file ciphertext, a ciphertext access request for the keyword matching result ciphertext is initiated to the cloud server.
[0133] If the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within the preset time period does not exceed the preset access number threshold, the stored keyword matching result is sent to the blockchain. In this way, after receiving the keyword matching result ciphertext, the blockchain performs a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result.
[0134] If the cloud server determines that the number of accesses exceeds the preset access threshold, it generates a ciphertext access denial instruction and sends the ciphertext access denial instruction to the blockchain. In response to the ciphertext access denial instruction, the blockchain denies the data user access to the ciphertext of the keyword matching result, thereby effectively solving the problem of being unable to resist denial of service attacks launched by external attackers during the ciphertext data retrieval process.
[0135] It should be added that, in the case where the above-mentioned keyword matching result ciphertext is a short-term ciphertext, the cloud server can still detect the number of times the data user accesses the keyword matching result ciphertext, so as to instruct the blockchain to reject the access request when the number of accesses exceeds the limit.
[0136] Of course, in some other embodiments, the blockchain may directly detect and determine the number of times a data user has accessed the keyword matching result ciphertext, and perform subsequent pre-decryption calculations if the number of accesses does not exceed a preset access number threshold; if the number of accesses exceeds the preset access number threshold, the data user's access request to the ciphertext may be rejected.
[0137] According to some embodiments of the present application, optionally, in order to fully solve the problem that data users and pre-decryption outsourcing servers may decrypt duplicate data and waste storage and computing resources, the ciphertext data indexing method further includes:
[0138] When N data owners upload N keyword matching result ciphertexts to the cloud server, N equivalence test trapdoors sent by the N data owners are received; the N equivalence test trapdoors correspond to the N keyword matching result ciphertexts one by one;
[0139] After performing an equivalence test on the N equivalence test trapdoors, a data deduplication request for the keyword matching result ciphertext is sent to the cloud server, where the data deduplication request is used to instruct the cloud server to perform data deduplication on the N keyword matching result ciphertexts.
[0140] In specific implementation, different data owners may upload the ciphertext corresponding to the same file to the cloud server. Based on this, in order to fully avoid the problem of wasting storage and computing resources, after the cloud server receives multiple ciphertexts sent by different data owners, the cloud server sends an equivalence test trap for each ciphertext to the blockchain.
[0141] The blockchain tests and compares the multiple equivalence test trapdoors received, and sends a data deduplication request for the keyword matching result ciphertext to the cloud server based on the equivalence test results. The cloud server deduplicates the same keyword matching result ciphertext in response to the data deduplication request. In order to save data storage space, only one copy of the keyword matching result ciphertext needs to be retained.
[0142] In this embodiment, blockchain is used to perform an equivalence test on the ciphertext uploaded to the cloud server, and data deduplication is supported for repeated ciphertext data. In this way, the problem that data users and pre-decryption outsourcing servers may decrypt repeated data and waste storage and computing resources is fully solved.
[0143] Based on the same inventive concept, the present application embodiment also provides a ciphertext data indexing method, which is applied to data users. Figure 2 , Figure 2 The flowchart of the ciphertext data indexing method provided by an embodiment of the present application is shown. The ciphertext data indexing method is applied to data users. Figure 2 As shown, the ciphertext data indexing method includes the following steps:
[0144] S210, sending a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap;
[0145] S220, when the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, receiving the pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain; wherein, when the conversion key of the data user meets the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext;
[0146] S230, decrypt the pre-decryption result to obtain the shared file plaintext.
[0147] The specific implementation of the above steps 210 to 230 is described in detail below.
[0148] In S210, during the specific implementation, a search trap is sent to the blockchain so that the blockchain detects whether there is a keyword index ciphertext in the keyword index ciphertext set that matches the search trap.
[0149] According to some embodiments of the present application, optionally, before sending the search trapdoor to the blockchain, the ciphertext data indexing method further includes:
[0150] Set an index keyword set of interest; generate a search trapdoor based on the index keyword set.
[0151] In S220, during specific implementation, when the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, a pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain is received.
[0152] Among them, when the conversion key of the data user meets the access control policy of the keyword matching result ciphertext, the pre-decryption result is calculated by the blockchain based on the conversion key to pre-decrypt the keyword matching result ciphertext. The above conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
[0153] According to some embodiments of the present application, optionally, the conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute of the same classification as the first attribute;
[0154] When the first attribute is higher than or equal to the second attribute, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result;
[0155] When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
[0156] According to some embodiments of the present application, optionally, the keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext, and the target keyword index ciphertext is obtained by the data owner extracting a keyword set from the shared file plaintext and encrypting it.
[0157] S230, decrypt the pre-decryption result to obtain the shared file plaintext.
[0158] According to some embodiments of the present application, optionally, before sending the search trapdoor to the blockchain, the ciphertext data indexing method further includes:
[0159] The attribute set of the data user is sent to the attribute authorization center. The attribute authorization center is used to encrypt the attribute set to obtain the attribute key, and re-encrypt the attribute key to obtain the conversion key, and send the conversion key to the blockchain.
[0160] It should be understood that, considering that the above steps and the specific implementation process of the embodiment have been reflected in the previous text, for the sake of brevity, this application will not repeat them here. And the ciphertext data indexing method applied to data users provided in the embodiment of the present application has the beneficial effects of the ciphertext data indexing method applied to blockchain provided in the embodiment of the present application, and will not be described in detail here.
[0161] In order to more clearly describe the technical solution of this embodiment, the specific implementation of this embodiment is described in detail with reference to the accompanying drawings. Figure 3 It is a scenario flow diagram of a ciphertext data indexing method provided in an embodiment of the present application; Figure 4This is a scenario timing diagram of a ciphertext data indexing method provided in one embodiment of the present application.
[0162] This embodiment provides a distributed ciphertext data indexing method that can deduplicate in a Web3.0 scenario. Figure 3 and Figure 4 As shown, from the perspective of system architecture, the roles involved in this embodiment mainly include the following five categories: data owner, data user, attribute authorization center, cloud server and blockchain, where each role undertakes the following tasks:
[0163] 1. Data Owner (DO): The data owner encrypts private file data and file keyword index, generates file ciphertext and keyword index ciphertext, and stores short-term file ciphertext and keyword index ciphertext in the blockchain. Then, the data owner can generate an equivalence test trapdoor to assist the cloud server in verifying whether the ciphertext data decrypted by different public keys contains the same plaintext.
[0164] 2. Data User (DU): The data user generates a search trap containing multiple keywords and sends the search trap to the blockchain. After receiving the search result file and the pre-decrypted result, the data user uses his own attribute key to decrypt the search result ciphertext file.
[0165] 3. Attribute Authority (AA): The AA runs the system initialization algorithm to generate system public parameters, user attribute keys and conversion keys.
[0166] 4. Cloud Server: The cloud server stores the preset access count threshold of the plaintext and ciphertext of long-term shared files sent by the data owner.
[0167] 5. Blockchain: After the blockchain network receives the keyword index ciphertext, equivalence test trap sent by the data owner and the search trap sent by the data user, it executes the smart contract to perform keyword matching calculation and equivalence test calculation.
[0168] This embodiment proposes a distributed ciphertext data indexing method that can deduplicate in a Web3.0 scenario, and its specific implementation process is as follows. Here, the illustrative implementation method and its description of this embodiment are used to explain this embodiment, but are not intended to limit this embodiment.
[0169] Step 1. Initialization phase
[0170] Initialization step: The attribute authorization center AA generates the system public parameters Params and the system private key Msk. AA first selects the system parameters λ, two cyclic groups G1, G2, a bilinear map and four collision-resistant secure hash functions, and then selects random numbers to calculate the system public key PK and the initial secret value S0. Finally, the attribute authorization center AA uses the generated system public key, cyclic group, hash function, bilinear map and other information as the system public parameters Params, uploads Params to the blockchain, and secretly saves the system private key Msk composed of the selected random number.
[0171] The further initialization steps are specifically described as:
[0172] The attribute authority AA selects two groups G1 and G2 of order p and a bilinear map e:G1×G1→G2, where g is the generator of group G1.
[0173] A.AA selects four secure hash functions H1: H2:
[0174] H3: and H4:
[0175] B.AA random selection Calculate PK1 = g a , PK2=e(g,g) α , PK3=g β . System public key PK = (PK1, PK2, PK3).
[0176] C.AA random selection and h,u∈G1, calculate For each attribute x in the attribute set A i choose Finally, the attribute authorization center AA discloses and uploads the system public parameters To the blockchain, the secret system private key Msk=(a,α,β,x o ).
[0177] Step 2. Key generation
[0178] Key generation step attribute authorization center AA based on the user's identity information ID u Generate the attribute key SK of the data user u and conversion key TK u , send the attribute key to the data user, and send the conversion key to the blockchain. At the same time, the cloud server generates its own public and private key PK CS and SK CS . Cloud server selects a large prime number and large integers Compute the product of two large prime numbers η, Euler's function φ(η), and d≡κ -1 modφ(η). Based on the difficulty of large integer factorization, the cloud server determines its own public key PK CS =(κ,η) and private key SK CS =(d,φ(η)). The attribute authorization center AA selects a random number for each attribute in the attribute set S of the data user and calculates the user attribute key SK u =(D1,D2,D3,D4,D5,{D i ,D i ′} i∈S ). In this embodiment, the high-order attribute user can calculate the key component D of the low-order attribute user. i ′, low-order attribute users cannot obtain the attribute key component D of high-order attribute data users through reverse calculation i ′. To ensure the privacy of the attribute key, AA calculates the transformation key TK u =(D1′,D2′,D3,D4,D5,{D i ,D i ′} i∈S ) and upload the conversion key TK u To blockchain.
[0179] The further key generation steps are specifically described as:
[0180] A. The cloud server randomly selects a large prime number and large integers Calculate η = ψ × γ and φ(η) = (ψ-1) × (γ-1), and solve for d to satisfy gcd(φ(η),κ) = 1, 1≤κ≤φ(η) and d≡κ -1 modφ(η). The cloud server publishes and uploads its own public key PK CS =(κ,η) to the blockchain, secretly saving your own private key SK CS =(d,φ(η)).
[0181] B.AA random selection For each attribute x in the attribute set S of the data user DU i ∈S, calculate in ID u ∈{0,1} * It is the identity information of the data user DU.
[0182] C.AA random selection and Where p′<p. AA calculation D2=g zyt , D3=gαy h b , D4=g b , D5=g aβ and Attribute key SK of data user DU u =(D1,D2,D3,D4,D5,{D i ,D i ′} i∈S ). Taking the data access process of high-order attribute users and low-order attribute users as an example, randomly select x p ,x N ∈Z p′ , satisfying x p <x N , generate key shares for high-order attribute users and low-order attribute users According to the RSA difficulty assumption, if x p -x N <0, user cannot calculate Therefore, it is impossible to calculate S p When a user only has low-order attributes, it is impossible to obtain access rights to high-order attributes through reverse calculation.
[0183] D. AA calculates D1′=D1 -z , D2′=D2 -z , the conversion key TK of the data user DU u =(D1′,D2′,D3,D4,D5,{D i ,D i ′} i∈S ).
[0184] E.AA sends (SK,z) to the data user DU through a secure channel and uploads (β,TK u ) to the blockchain.
[0185] Step 3. Data encryption
[0186] Data encryption step: The data owner DO sets the file access policy (M, ρ) (corresponding to the aforementioned access control policy), uses the attribute encryption algorithm to encrypt the shared file data m (corresponding to the aforementioned shared file plaintext), and obtains the shared file ciphertext C m In addition, the data owner defines the maximum number of accesses to the shared file. Use the cloud server private key pair Encrypted. According to your own user identity information id o , the data owner generates the ciphertext component C4 and uploads C4 to the blockchain.
[0187] The further data encryption steps are specifically described as follows:
[0188] A.DO calculation is the maximum number of accesses to the shared file data m. DO sends to the cloud server.
[0189] B. DO random selection Calculate C1 = me(g,g) αr , C2=g r , C3=h r and C4=m·r·H4(e(H3(id o ),g) r ), where id o It is the identity of the data owner DO.
[0190] C.DO sets the file access policy to (M, ρ), where M is a l×n matrix and the mapping function ρ can map each row of M to an attribute {x i} i∈A DO for each attribute x in the access policy i Random Selection calculate Then, DO randomly select make Calculate E1 = sr, f i =λ i -θ i , where i = 1,…,l. Shared file data ciphertext C m =((M,ρ),C1,C2,C3,E1,(f i ,C i ) i∈[1,l] ). DO stores the ciphertext C m To the cloud server. DO upload C4 to the blockchain.
[0191] Step 4. Ciphertext equivalence test
[0192] Ciphertext equivalence test steps The cloud server receives ciphertext equivalence test trap E sent by different data owners q Finally, verify whether the equivalence test equation holds. If the equation holds, the ciphertexts sent by different data owners contain the same plaintext. To save data storage space, only the ciphertext of the shared file data sent by one data owner needs to be retained.
[0193] The further ciphertext equivalence test steps are specifically described as follows:
[0194] A. Data owners DO1 and DO2 send the shared file ciphertext to the cloud server and generate equivalence test trapdoors respectively and
[0195] B. The cloud server receives the equivalent test trap sent by DO1 and DO2 and After that, calculate
[0196]
[0197] C. Cloud Server Verification Equation Is it true? If the equation is true, then For identical shared file data, the shared file data ciphertext only needs to be retained once to save data storage space.
[0198] Step 5. Index encryption
[0199] The data owner performs the index encryption step to generate a shared file set F = (F1, F2, ..., F d ) corresponding to the keyword index ciphertext. θ The keyword set W contained in (1≤θ≤d) is W=(w1,w2,…,w m ), the data owner calculates each keyword w j (1≤j≤m) corresponding keyword index ciphertext The index ciphertext set corresponding to the keyword set W is obtained as And upload the index ciphertext set to the blockchain.
[0200] The further index encryption steps are specifically described as follows:
[0201] The data owner DO from the file F θ (1≤θ≤d) to extract the keyword set W=(w1,w2,…,w m ). DO for each keyword w j Random Selection Calculate C j,1 =g βσ .
[0202] A.DO for each shared file F θ Randomly select e θ ,calculate and File F θ Keyword w j Corresponding keyword index ciphertext The index ciphertext set corresponding to the keyword set W is
[0203] B.DO uploads the keyword index ciphertext set of the shared file set F to the blockchain.
[0204] Step 6. Trapdoor Generation
[0205] The data user performs the trapdoor generation step to generate a search trapdoor corresponding to the search keyword set. The data user first selects the search keyword set W′=(w1′,w2′,…,w m′ ′), then select a random number to calculate the search trap corresponding to the search keyword set, and upload the generated search trap to the blockchain.
[0206] The further trapdoor generation steps are specifically described as follows:
[0207] A. The data owner DU sets the index keyword set W′=(w1′,w2′,…,w m′ ′), randomly selected calculate T2=g βη and T3 = g aβη .
[0208] B.DU sends search trap door T W′ =(T1,T2,T3) to blockchain.
[0209] Step 7. Keyword matching test
[0210] The blockchain performs a keyword matching test step to verify whether the search trapdoor and the keyword index ciphertext contain the same keyword. W′ and keyword index ciphertext C w If the same keyword is included, the keyword matching test equation is established, and the blockchain continues to execute the subsequent pre-decryption steps. If the keyword matching test equation is not established, the data user's search request will be rejected.
[0211] The further keyword matching test steps are specifically described as follows:
[0212] (0 / 1)←Test(T W′ ,C w )
[0213] A. Verify the equation Is it true?
[0214] B. When the search keyword set W′ and the keyword index set W are the same and m=m′, the following calculation can be performed. If both sides of the equation are equal, the keyword matching test is successful.
[0215]
[0216] C. If the keyword matching test equation holds, continue to execute step 8 to pre-decrypt the data and return the pre-decryption result ciphertext to the data user; otherwise, reject the data user's search request.
[0217] Step 8. Data pre-decryption
[0218] If the keyword matching test equation in the keyword matching test step is established, the cloud server and the blockchain jointly perform the data pre-decryption step. The cloud server uses the private key SK CS =(d,φ(η)) The maximum number of accesses to the decrypted ciphertext file (the ciphertext of the keyword matching result) (the preset access number threshold). If the current number of accesses to the ciphertext file is less than the maximum number of accesses, the cloud server sends a pre-decryption calculation instruction to the blockchain. The blockchain verifies whether the attribute set S of the data user satisfies the access control policy (M,ρ) defined by the data owner. If the attribute set S of the data user is determined to satisfy the access control policy based on the conversion key, the blockchain obtains the pre-decryption result through pre-decryption calculation. And send the pre-decryption result To data users.
[0219] The further data pre-decryption steps are specifically described as follows:
[0220]
[0221] A. Obtain the system public parameters Params and the conversion key SK of the data user DU u =(D1′,D2′,{D i ,D 4,i} i∈S ), if the keyword matches the result ciphertext C m Stored in the blockchain, the smart contract performs pre-decryption calculations; otherwise, the blockchain requests the cloud server to return the long-term ciphertext C m .
[0222] B. Cloud Server Computing The number of accesses to the shared file data ciphertext is Count and the initial value of Count is 0. The blockchain performs pre-decryption calculations and updates Count=Count+1; otherwise, the cloud server sends an instruction to cause the blockchain to reject DU's access request to the ciphertext of the file data.
[0223] C. If the blockchain verifies that the attribute set S of the data user DU satisfies the access control policy (M, ρ) by converting the key, let I = {i: ρ(i) = S}, then there exists a set of constants μ i ∈Z q Satisfying the equation Σ i∈l μ i ·λ i =s, the pre-decryption calculation can be performed as follows.
[0224]
[0225] D. Send pre-decryption calculation results To data user DU.
[0226] Step 9. Data decryption calculation
[0227] Data user DU receives the pre-decryption calculation result After that, calculate the shared file plaintext
[0228] In the embodiment of this scenario, in order to solve the problems of complex access strategies and privacy leakage in the existing blockchain-based attribute-based ciphertext retrieval methods, this proposal designs an attribute-based ciphertext retrieval scheme that supports attribute classification and ranking. The data owner encrypts the shared data using the lowest-order attributes that satisfy the access strategy. The access strategy includes low-order attributes, and the high-order attributes are the user's real attributes. Users with high-order attributes can decrypt the shared data encrypted by the low-order attributes, thereby ensuring that the access strategy does not include the user's high-order attribute information, realizing user attribute anonymity, and the access strategy cannot leak user attribute information.
[0229] To address the heavy burden of user decryption computation caused by complex access policies, attributes are processed in a hierarchical manner, and only low-order attributes are used to encrypt data. High-order attribute users can access data decrypted by low-order attributes, which can reduce the pressure of encryption and decryption to a certain extent. At the same time, by generating conversion keys, the cloud server is supported to pre-decrypt the ciphertext without leaking the privacy of user attribute keys. Data users only need to perform partial decryption calculations to further reduce user computing overhead.
[0230] In addition, to address the problem of duplicate ciphertext storage caused by different public keys encrypting the same plaintext, this proposal combines attribute-based searchable encryption technology and equivalence testing technology to allow blockchain to perform equivalence tests on different ciphertexts uploaded by different data owners, determine whether ciphertexts encrypted by two different users contain the same plaintext, and deduplicate ciphertexts to reduce data storage overhead.
[0231] Based on the ciphertext data indexing method applied to blockchain provided in the above embodiment, for the same inventive concept, the present application also provides a ciphertext data indexing device corresponding to the above ciphertext data indexing method, which is applied to blockchain. Figure 5 The ciphertext data indexing device is introduced in detail.
[0232] Figure 5 A schematic diagram of the structure of a ciphertext data indexing device provided in one embodiment of the present application is shown, which is applied to blockchain. Figure 5 The illustrated ciphertext data indexing device 500 comprises:
[0233] A first receiving module 510, configured to receive a search trap sent by a data user;
[0234] A first detection module 520 is used to detect whether there is a keyword index ciphertext set that matches the search trap in response to the search trap;
[0235] A first calculation module 530 is configured to, if the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, perform pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result if the conversion key of the data user meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext;
[0236] The first sending module 540 is used to send the pre-decryption result to the data user, so that the data user can decrypt the pre-decryption result to obtain the shared file plaintext; wherein the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
[0237] Based on the ciphertext data indexing method applied to data users provided in the above embodiment, for the same inventive concept, the present application also provides a ciphertext data indexing device corresponding to the above ciphertext data indexing method, which is applied to data users. Figure 6 The ciphertext data indexing device is introduced in detail.
[0238] Figure 6 A schematic diagram of the structure of a ciphertext data indexing device provided in an embodiment of the present application is shown, which is applied to data users. Figure 6 The illustrated ciphertext data indexing apparatus 600 comprises:
[0239] The second sending module 610 is used to send a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap;
[0240] The second receiving module 620 is used to receive the pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain when the search trapdoor matches the target keyword index ciphertext in the keyword index ciphertext set; wherein, when the conversion key of the data user meets the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext;
[0241] The first decryption module 630 is used to decrypt the pre-decryption result to obtain the shared file plaintext.
[0242] Based on the ciphertext data indexing method provided in the above embodiment, for the same inventive concept, the present application also provides a ciphertext data indexing device corresponding to the above ciphertext data indexing method. Figure 7 A detailed introduction to the ciphertext data indexing device is given.
[0243] See below Figure 7 , Figure 7 It is a structural diagram of a ciphertext data indexing device provided in one embodiment of the present application.
[0244] The ciphertext data indexing device may include a processor 701 and a memory 702 storing computer program instructions.
[0245] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0246] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0247] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0248] The processor 701 implements any one of the ciphertext data indexing methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0249] In one example, the data ciphertext data indexing device may further include a communication interface 703 and a bus 710. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 710 and communicate with each other.
[0250] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0251] Bus 710 includes hardware, software or both, and the parts of the ciphertext data indexing device are coupled to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 710 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0252] The ciphertext data indexing device executes the ciphertext data indexing method in the embodiment of the present application, thereby realizing the ciphertext data indexing method described in the embodiment of the present application.
[0253] In addition, in combination with the ciphertext data indexing method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the ciphertext data indexing methods in the above embodiment is implemented.
[0254] Based on the ciphertext data indexing method in the above-mentioned embodiment, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the ciphertext data indexing method provided in any one of the above-mentioned embodiments of the present application.
[0255] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0256] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0257] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0258] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0259] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for indexing ciphertext data, It is characterized in that Applied to blockchain, the method includes: Receive search traps sent by data users; In response to the search trap, detecting whether a keyword index ciphertext set contains a keyword index ciphertext that matches the search trap; If the search trap matches the target keyword index ciphertext in the keyword index ciphertext set, and if the conversion key of the data user meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result; The pre-decryption result is sent to the data user so that the data user decrypts the pre-decryption result to obtain the shared file plaintext; wherein the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; and the access control policy is used to indicate the attributes of the data users who are allowed to access the keyword matching result ciphertext.
2. The method according to claim 1, It is characterized in that The conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute of the same category as the first attribute; When the conversion key of the data user meets the access control policy of the target keyword index ciphertext, pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, including: In a case where the first attribute is higher than or equal to the second attribute, performing a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result; When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
3. The method according to claim 2, It is characterized in that Before performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the method further includes: Receiving the conversion key of the data user sent by an attribute authorization center; The attribute authorization center is used to encrypt the attribute key based on the attribute set of the data user, and perform secondary encryption on the attribute key to obtain the conversion key.
4. The method according to claim 1, It is characterized in that Before performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, the method further includes: When the cloud server determines that the number of times the blockchain accesses the keyword matching result ciphertext within a preset time period does not exceed a preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result; When the cloud server determines that the number of accesses exceeds the preset access number threshold, receiving the blockchain sending encrypted access rejection instruction sent by the cloud server; In response to the ciphertext access denial instruction, the data user is denied access to the keyword matching result ciphertext.
5. The method according to claim 4, It is characterized in that The pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, including: In the case where the keyword matching result ciphertext is a short-term file ciphertext, a pre-decryption calculation is performed on the keyword matching result ciphertext pre-stored in the blockchain based on the conversion key to obtain the pre-decryption result; In the case where the keyword matching result ciphertext is a long-term file ciphertext, when the cloud server determines that the number of accesses to the keyword matching result ciphertext by the blockchain within a preset time period does not exceed a preset access number threshold, a pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result, including: Initiating a ciphertext access request for the ciphertext of the keyword matching result to the cloud server; When the number of accesses does not exceed the preset access number threshold, sending the stored keyword matching result ciphertext to the blockchain; A pre-decryption calculation is performed on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result.
6. The method according to claim 1, It is characterized in that The method further comprises: In the case where N data owners upload N keyword matching result ciphertexts to the cloud server, receiving N equivalence test trapdoors respectively sent by the N data owners; the N equivalence test trapdoors correspond one-to-one to the N keyword matching result ciphertexts; After performing an equivalence test on the N equivalence test trapdoors, a data deduplication request for the keyword matching result ciphertext is sent to the cloud server, wherein the data deduplication request is used to instruct the cloud server to perform data deduplication on the N keyword matching result ciphertexts.
7. The method according to claim 1, It is characterized in that The search trap is generated based on the index keyword set that the data user is interested in; before detecting, in response to the search trap, whether a keyword index ciphertext set has a keyword index ciphertext that matches the search trap, the method further includes: Receiving a keyword index ciphertext set uploaded by a data owner corresponding to the keyword matching result ciphertext, wherein the keyword index ciphertext set includes the target keyword index ciphertext; In response to the search trap, detecting whether a keyword index ciphertext set contains a keyword index ciphertext that matches the search trap, including: Based on the search trap, determining to obtain the index keyword set; Based on the index keyword set, it is detected whether there is a keyword index ciphertext in the keyword index ciphertext set that matches the search trapdoor.
8. The method according to claim 1, It is characterized in that Before detecting, in response to the search trapdoor, whether a keyword index ciphertext set has a keyword index ciphertext that matches the search trapdoor, the method further includes: Receive the target keyword index ciphertext corresponding to the shared file plaintext sent by the data owner; the target keyword index ciphertext is obtained by the data owner extracting keywords from the shared file plaintext and encrypting them; the keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext.
9. A method for indexing ciphertext data, It is characterized in that Applied to a data user, the method comprises: Sending a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap; In the case where the search trapdoor matches the target keyword index ciphertext in the keyword index ciphertext set, a pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain is received; wherein, in the case where the conversion key of the data user complies with the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext; The pre-decryption result is decrypted to obtain the shared file plaintext.
10. The method according to claim 9, It is characterized in that The conversion key includes a first attribute of the data user, and the access control policy of the keyword matching result ciphertext includes a second attribute that allows access; the second attribute is an attribute of the same category as the first attribute; In a case where the first attribute is higher than or equal to the second attribute, performing a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain the pre-decryption result; When the first attribute is lower than the second attribute, it is determined that the data user does not have the pre-decryption authority for the keyword matching result ciphertext.
11. The method according to claim 9, It is characterized in that Before sending the search trapdoor to the blockchain, the method further includes: The attribute set of the data user is sent to the attribute authorization center, which is used to encrypt the attribute key based on the attribute set, re-encrypt the attribute key to obtain the conversion key, and send the conversion key to the blockchain.
12. The method according to claim 9, It is characterized in that The keyword matching result ciphertext is obtained by the data owner encrypting the shared file plaintext, and the target keyword index ciphertext is obtained by the data owner extracting a keyword set from the shared file plaintext and encrypting it.
13. The method according to claim 9, It is characterized in that Before sending the search trapdoor to the blockchain, the method further includes: Set the set of index keywords of interest; The search trapdoor is generated based on the index keyword set.
14. A ciphertext data indexing device, It is characterized in that Applied to blockchain, the device comprises: A first receiving module, used for receiving a search trap sent by a data user; A first detection module, configured to detect, in response to the search trap, whether a keyword index ciphertext set contains a keyword index ciphertext that matches the search trapdoor; A first calculation module is used for, if the search trap matches a target keyword index ciphertext in the keyword index ciphertext set, and if the conversion key of the data user meets the access control policy of the keyword matching result ciphertext corresponding to the target keyword index ciphertext, performing a pre-decryption calculation on the keyword matching result ciphertext based on the conversion key to obtain a pre-decryption result; The first sending module is used to send the pre-decryption result to the data user, so that the data user decrypts the pre-decryption result to obtain the shared file plaintext; wherein the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; and the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext.
15. A ciphertext data indexing device, It is characterized in that Applied to data users, the device comprises: A second sending module is used to send a search trap to the blockchain, so that the blockchain detects whether there is a keyword index ciphertext set that matches the search trap; A second receiving module is used to receive the pre-decryption result of the keyword matching result ciphertext corresponding to the target keyword index ciphertext sent by the blockchain when the search trapdoor matches the target keyword index ciphertext in the keyword index ciphertext set; wherein, when the conversion key of the data user conforms to the access control policy of the keyword matching result ciphertext, the pre-decryption result is obtained by the blockchain performing pre-decryption calculation on the keyword matching result ciphertext based on the conversion key; the conversion key is determined based on the attribute key corresponding to the attribute set of the data user; the access control policy is used to indicate the attributes of the data user who is allowed to access the keyword matching result ciphertext; The first decryption module is used to decrypt the pre-decryption result to obtain the shared file plaintext.
16. A ciphertext data indexing device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the ciphertext data indexing method as described in any one of claims 1-13 is implemented.
17. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the ciphertext data indexing method according to any one of claims 1 to 13 is implemented.
18. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the ciphertext data indexing method as described in any one of claims 1-13.
