Data storage and acquisition method and device based on attribute-based encryption and storage medium
Patent Information
- Application Number
- CN202210646855.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2042-06-08
AI Technical Summary
[0004]本申请的实施例提供了一种基于属性基加密的数据存储及获取方法、装置及存储介质,以至少解决现有技术中存在的在处理数据时负载过高的技术问题
[0012]在本申请实施例中,多个密钥分发中心生成多个公钥,数据拥有者可以根据多个公钥以及明文生成密文,并且多个密钥分发中心生成多个私钥,与现有的只有一个密钥分发中心的方案相比,本技术方案将计算压力分散给了多个密钥分发中心,从而减少了密钥分发中心的负载。并且本技术方案通过区块链系统对密文进行解密,从而通过区块链系统的不可篡改的优点,提高了解密时密文的安全性与真实性。进而解决了现有技术中存在的在处理数据时负载过高的技术问题。
Smart Images

Figure CN115001677B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a data storage and retrieval method, apparatus and storage medium based on attribute-based encryption. Background Technology
[0002] With the increasing demand for information use and storage, storing and processing data in the cloud has become the preferred option. Attribute-based encryption is a key technology for achieving access control and privacy protection in cloud computing environments. However, existing attribute-based encryption schemes generate ciphertext that includes both encrypted data and access policies. Access policies inevitably contain sensitive information, and the leakage of this sensitive information can expose user privacy. Furthermore, existing attribute-based encryption schemes generate keys through key distribution centers, but excessive power for these centers can lead to problems such as high load and reduced resistance to security attacks.
[0003] There is currently no effective solution to the technical problem of excessive load when processing data in the existing technologies mentioned above. Summary of the Invention
[0004] The embodiments of this application provide a data storage and retrieval method, apparatus and storage medium based on attribute-based encryption, so as to at least solve the technical problem of excessive load when processing data in the prior art.
[0005] According to one aspect of the embodiments of this application, a data storage method based on attribute-based encryption is provided, comprising: multiple key distribution centers generating multiple public keys according to public parameters through a first initialization algorithm; a data owner generating ciphertext according to the multiple public keys, plaintext, and access policy through a first encryption algorithm, wherein the access policy is used to indicate the attributes of the data owner; and the data owner storing the ciphertext to a cloud server.
[0006] According to another aspect of the embodiments of this application, a data acquisition method based on attribute-based encryption is also provided, comprising: multiple key distribution centers acquiring an attribute set of a data accessor, and generating multiple private keys according to the attribute set using a key generation algorithm; a blockchain system decrypting the ciphertext according to the multiple private keys using a data decryption algorithm to obtain a first plaintext; and the blockchain system sending the first plaintext to the data accessor.
[0007] According to another aspect of the embodiments of this application, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, the method described in any one of the above methods is executed by a processor.
[0008] According to another aspect of the embodiments of this application, a data storage device based on attribute-based encryption is also provided, comprising: a first generation module for multiple key distribution centers to generate multiple public keys according to public parameters through a first initialization algorithm; a second generation module for a data owner to generate ciphertext according to multiple public keys, plaintext, and an access policy through a first encryption algorithm, wherein the access policy is used to indicate the attributes of the data owner; and a storage module for the data owner to store the ciphertext to a cloud server.
[0009] According to another aspect of the embodiments of this application, a data acquisition device based on attribute-based encryption is also provided, comprising: a third generation module, used by multiple key distribution centers to acquire attribute sets of data accessors and generate multiple private keys according to the attribute sets through a key generation algorithm; a decryption module, used by the blockchain system to decrypt ciphertext according to the multiple private keys through a data decryption algorithm to obtain first plaintext; and a data sending module, used by the blockchain system to send the first plaintext to the data accessor.
[0010] According to another aspect of the embodiments of this application, a data storage device based on attribute-based encryption is also provided, including: a first processor; and a first memory connected to the first processor, configured to provide the first processor with instructions to process the following steps: multiple key distribution centers generate multiple public keys according to common parameters through a first initialization algorithm; a data owner generates ciphertext according to the multiple public keys, plaintext, and access policy through a first encryption algorithm, wherein the access policy is used to indicate the attributes of the data owner; and the data owner stores the ciphertext to a cloud server.
[0011] According to another aspect of the embodiments of this application, a data acquisition device based on attribute-based encryption is also provided, including: a second processor; and a second memory connected to the second processor, used to provide the second processor with instructions to process the following steps: multiple key distribution centers acquire attribute sets of data accessors and generate multiple private keys based on the attribute sets using a key generation algorithm; a blockchain system decrypts the ciphertext based on the multiple private keys using a data decryption algorithm to obtain a first plaintext; and the blockchain system sends the first plaintext to the data accessor.
[0012] In this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing schemes with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution uses a blockchain system to decrypt the ciphertext, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This solves the technical problem of excessive load when processing data in existing technologies. Attached Figure Description
[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0014] Figure 1 This is a hardware structure block diagram of a computing device used to implement the method described in Embodiment 1 of this application;
[0015] Figure 2 This is a schematic diagram of a data storage and retrieval system based on attribute-based encryption as described in Embodiment 1 of this application;
[0016] Figure 3 This is a flowchart illustrating the data storage method based on attribute-based encryption according to the first aspect of Embodiment 1 of this application;
[0017] Figure 4 This is yet another flowchart illustrating the data storage method based on attribute-based encryption according to the first aspect of Embodiment 1 of this application;
[0018] Figure 5 This is a flowchart illustrating the data acquisition method based on attribute-based encryption according to the second aspect of Embodiment 1 of this application;
[0019] Figure 6 This is yet another flowchart illustrating the data acquisition method based on attribute-based encryption according to the second aspect of Embodiment 1 of this application;
[0020] Figure 7 This is a schematic diagram of a data storage device based on attribute-based encryption according to the first aspect of Embodiment 2 of this application;
[0021] Figure 8 This is a schematic diagram of a data acquisition device based on attribute-based encryption according to the second aspect of Embodiment 2 of this application;
[0022] Figure 9 This is a schematic diagram of a data storage device based on attribute-based encryption according to the first aspect of Embodiment 3 of this application; and
[0023] Figure 10 This is a schematic diagram of a data acquisition device based on attribute-based encryption according to the second aspect of Embodiment 3 of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Example 1
[0027] According to this embodiment, a method embodiment of a data storage and retrieval method based on attribute-based encryption is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] The method embodiments provided in this example can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Figure 1 A hardware block diagram of a computing device for implementing a data storage and retrieval method based on attribute-based encryption is shown. Figure 1 As shown, a computing device may include one or more processors (processors may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), memory for storing data, and transmission devices for communication functions. In addition, it may also include: a display, input / output interfaces (I / O interfaces), a universal serial bus (USB) port (which may be included as one of the ports in the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, a computing device may also include... Figure 1The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0029] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits can be implemented wholly or partially as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits can be a single, independent processing module, or wholly or partially integrated into any other element in the computing device. As involved in the embodiments of this application, the data processing circuit serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0030] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the attribute-based encryption-based data storage and retrieval method in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the attribute-based encryption-based data storage and retrieval method of the aforementioned application. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the computing device via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0031] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the computing device's communications provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0032] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows users to interact with the user interface of the computing device.
[0033] It should be noted here that, in some optional embodiments, the above... Figure 1 The computing device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computing devices.
[0034] Figure 2 This is a schematic diagram of a data storage and retrieval system based on attribute-based encryption as described in this embodiment. (Refer to...) Figure 2 As shown, the system includes: 100 data owners, 200 data visitors, 300 trusted authentication centers, 400 key distribution centers, 500 cloud servers, and 600 blockchain systems.
[0035] Data owner 100 generates ciphertext based on multiple public keys, access policies, and plaintext sent by multiple key distribution centers 400, and stores the ciphertext on cloud server 500. Furthermore, data owner 100 generates a hash value for the plaintext and stores the hash value in blockchain system 600.
[0036] Data visitor 200 is used to retrieve data (i.e., plaintext) stored by data owner 100.
[0037] The trusted authentication center 300 receives data upload requests from the data owner 100, generates public parameters, and sends the public parameters to the key distribution center 400. The trusted authentication center 300 also authenticates the legitimacy of the data accessor 200.
[0038] Key distribution center 400 is used to generate a public key and a master key based on public parameters when data owner 100 requests to upload data (i.e., plaintext), and sends the public key to data owner 100. Key distribution center 400 also generates a private key and sends it to blockchain system 600. There may be multiple key distribution centers 400; no specific limit is specified here.
[0039] Cloud server 500 is used to receive encrypted messages sent by data owner 100 and store them.
[0040] Blockchain system 600 stores the hash value of data (i.e., plaintext) sent by the data owner. Blockchain system 600 receives the private key sent by key distribution center 400 and generates a master private key based on it. Blockchain system 600 decrypts the ciphertext using the master private key and compares the hash value of the decrypted plaintext with the pre-stored hash value. Blockchain system 600 then sends the data (i.e., plaintext) to the data accessor. It should be noted that the hardware structure described above can be used for the data owner 100, data accessor 200, trusted authentication center 300, key distribution center 400, cloud server 500, and blockchain system 600 within the system.
[0041] Under the above operating environment, according to the first aspect of this embodiment, a data storage method based on attribute-based encryption is provided. Figure 3 A flowchart illustrating the method is shown below. (Refer to...) Figure 3 As shown, the method includes:
[0042] S302: Multiple key distribution centers generate multiple public keys based on common parameters using a first initialization algorithm;
[0043] S304: The data owner generates ciphertext using a first encryption algorithm based on multiple public keys, plaintext, and an access policy, wherein the access policy indicates the attributes of the data owner; and
[0044] S306: The data owner stores the encrypted data on a cloud server.
[0045] Specifically, refer to Figure 4 As shown, when a data owner wants to store data (i.e., plaintext), multiple key distribution centers (i.e., AA) are involved. θ Where θ = 1 to n, n is a natural number, and n >= 2, including AA1, AA2, ..., AA n Multiple key distribution centers (i.e., AA) θ Multiple public keys (i.e., PK keys) are generated based on the public parameter GP using the first initialization algorithm. θ Where θ = 1 to n, n is a natural number, and n>=2). That is, AA1 generates a public key PK1, AA2 generates a public key PK2, ..., AA n Generate a public key PK n .
[0046] Furthermore, multiple key distribution centers send their respective generated public keys to the data owner, who then receives the public key PK. θ Then, using the first encryption algorithm, based on the public key PK... θ The plaintext M and access policy P are used to generate the ciphertext CT. The expression is:
[0047] Encrypt(PK1,PK2,...,PK n ,M,P)→CT
[0048] Where the access strategy P = {p1, p2, ..., p...} m}, that is, the access strategy P includes m elements, where the m elements are m attributes corresponding to the data owner.
[0049] Specifically, the data owner selects a random number s, where s∈Z p And where p is a prime number, Z p Let p be the set of all numbers between [0, p-1] that are relatively prime to the prime number p.
[0050] Then, the ciphertext message C is calculated based on the random number s. M Ciphertext parameters C1, C2 and policy aggregation parameter C p The data owner encrypts the access policy P using a collision-resistant hash function, thereby obtaining the policy aggregation parameter C. p The ciphertext CT output by the first encryption algorithm can be represented as:
[0051]
[0052] Furthermore, the data owner sends the encrypted text to the cloud server, which then stores it upon receiving it.
[0053] As described in the background section, with the increasing demand for information use and storage, storing and processing data in the cloud has become the preferred option. Attribute-based encryption is a key technology for achieving access control and privacy protection in cloud computing environments. However, existing attribute-based encryption schemes generate ciphertext that includes encrypted data and access policies, but access policies inevitably include some sensitive information, and the leakage of sensitive information will expose user privacy. Furthermore, existing attribute-based encryption schemes generate keys through key distribution centers, but excessive power for key distribution centers can lead to problems such as high load and reduced resistance to security attacks.
[0054] To address the aforementioned technical problems, the technical solution of this application involves multiple key distribution centers generating multiple public keys. Data owners can then generate ciphertext based on these public keys and plaintext. Compared to existing solutions with only one key distribution center, this solution distributes computational load across multiple centers, thereby reducing their workload. Furthermore, by storing the ciphertext on a cloud server instead of the blockchain system, this solution avoids putting pressure on the blockchain nodes, thus improving its performance. Additionally, by encrypting the access policy, this solution ensures the security of the sensitive information and protects the privacy of the data owner. This resolves the technical problem of excessive load during data processing in existing technologies.
[0055] Optionally, the operation of multiple key distribution centers generating multiple public keys based on public parameters using a first initialization algorithm includes: a trusted authentication center randomly generating security parameters based on a data upload request sent by the data owner; a trusted authentication center generating public parameters based on the security parameters using a second initialization algorithm; and multiple key distribution centers generating multiple public keys and multiple master keys based on the public parameters sent by the trusted authentication center using the first initialization algorithm.
[0056] Specifically, if a data owner wants to encrypt and store plaintext M on a cloud server, the data owner sends a data upload request to a trusted authentication center.
[0057] Furthermore, after receiving the data upload request, the trusted authentication center randomly generates a security parameter λ, and then uses a second initialization algorithm to generate a common parameter GP based on the security parameter λ. The expression for generating the common parameter GP based on the security parameter λ using the second initialization algorithm is as follows:
[0058] Setup(1 λ → (GP)
[0059] Specifically, the trusted authentication center inputs the generated security parameter λ into the bilinear group generation algorithm ζ(λ), and then outputs (p, G0, G1, e) based on the security parameter λ. Here, G0 and G1 are the values of Z. p Two multiplicative cyclic groups of order p, where p is a random prime number and Z is a prime number. p Let G0 be the set of all numbers between [0, p-1] that are relatively prime to a prime number p. The generator of the group G0 is g, where g is a random number and satisfies the bilinear mapping e: G0 × G0 → G1, using a collision-resistant hash function H: G0 → Z. p As a random oracle model, the trusted authentication center obtains the output public parameter GP, where GP = {G0, G1, g, e, p}.
[0060] The trusted authentication center sends the public parameter GP to multiple key distribution centers (AA). θ Multiple key distribution centers (AA) θ After receiving the public parameter GP, a public key PK is generated based on the public parameter GP using the first initialization algorithm. θ and master key MK θ Where θ = 1 to n, n is a natural number, and n >= 2. That is, the system includes multiple key distribution centers, each generating a public key and a master key. Furthermore, the public key PK is generated based on the public parameter GP using a first initialization algorithm. θ and master key MK θ The expression is:
[0061] SetupAA(GP)→(PK θ MK θ )
[0062] Specifically, multiple key distribution centers AA θ After generating the public key PK through the first initialization algorithm θ and master key MK θ When θ∈[1,n-1], the key distribution center AA θ Randomly generate α θ, where α θ ∈Z p ,but:
[0063]
[0064] MK θ ={α θ}
[0065] When θ = n, the key distribution center AA θ Randomly generate β, where β∈Z p ,but:
[0066] PK θ ={g β}
[0067] MK θ ={β}
[0068] Therefore, the key distribution center in this technical solution generates multiple public keys and multiple master keys, making the encryption algorithm more rigorous and improving data security. Furthermore, in attribute-based encryption schemes with a single key distribution center, since key generation and distribution are entirely controlled by that single center, there is a risk of collusion between data access users and the single key distribution center, leading to key leakage and abuse. This technical solution, by setting up multiple key distribution centers, increases the ability to resist security attacks and reduces the excessive workload on a single key distribution center.
[0069] Optionally, the method further includes: the data owner generating a corresponding hash value based on the plaintext using a second encryption algorithm; and the data owner storing the hash value in a blockchain system.
[0070] Specifically, the data owner uses a second encryption algorithm to generate a hash value (hashm) of plaintext M based on plaintext M. The expression for obtaining the hash value (hashm) using the second encryption algorithm is as follows:
[0071] SHA256(M)→hashm
[0072] Specifically, the data owner encrypts the plaintext M using the SHA256 algorithm, obtaining the hash value hashm of the plaintext M. The data owner then sends the hash value hashm to the blockchain system, which stores it.
[0073] Therefore, this technical solution improves the security of data storage by storing the hash value generated from the plaintext into the blockchain system.
[0074] Therefore, according to the first aspect of this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Compared with existing schemes with only one key distribution center, this technical solution distributes the computational burden among multiple key distribution centers, thereby reducing the load on each key distribution center. Furthermore, this technical solution ensures the security of the sensitive information and protects the privacy of the data owner by encrypting the access policy. This solves the technical problem of excessive load when processing data in existing technologies.
[0075] Furthermore, according to a second aspect of this embodiment, a data acquisition method based on attribute-based encryption is provided. Figure 5 A flowchart illustrating the method is shown below. (Refer to...) Figure 5 As shown, the method includes:
[0076] S502: Multiple key distribution centers obtain the attribute set of the data accessor and generate multiple private keys based on the attribute set using a key generation algorithm;
[0077] S504: The blockchain system uses a data decryption algorithm to decrypt the ciphertext using multiple private keys to obtain the first plaintext; and
[0078] S506: The blockchain system sends the first plaintext to the data accessor.
[0079] Specifically, refer to Figure 6 As shown, when a data accessor wants to obtain data uploaded by the data owner, multiple key distribution centers (i.e., AA) are involved. θ Where θ = 1 to n, n is a natural number, and n >= 2, including AA1, AA2, ..., AA n Multiple key distribution centers (i.e., AA) θ Obtain the attribute set of the data visitor, and generate multiple private keys (i.e., SK) based on the attribute set using a key generation algorithm. θ Where θ = 1 to n, n is a natural number, and n>=2). That is, AA1 generates a private key SK1, AA2 generates a private key SK2, ..., AA n Generate a private key SK n .
[0080] Furthermore, multiple key distribution centers send their private keys to the blockchain system. The blockchain system receives these private keys and retrieves the ciphertext stored by the data owner from the cloud server. The blockchain system then generates a master private key from these private keys and uses it to decrypt the ciphertext, thus obtaining the plaintext (i.e., the first plaintext).
[0081] Furthermore, the blockchain system sends the plaintext (i.e., the first plaintext) to the data accessor.
[0082] As described in the background section, with the increasing demand for information use and storage, storing and processing data in the cloud has become the preferred option. Attribute-based encryption is a key technology for achieving access control and privacy protection in cloud computing environments. However, existing attribute-based encryption schemes generate ciphertext that includes encrypted data and access policies, but access policies inevitably include some sensitive information, and the leakage of sensitive information will expose user privacy. Furthermore, existing attribute-based encryption schemes generate keys through key distribution centers, but excessive power for key distribution centers can lead to problems such as high load and reduced resistance to security attacks.
[0083] To address the aforementioned technical problems, the technical solution of this application involves multiple key distribution centers generating multiple public keys. The data owner can then generate ciphertext based on these public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing solutions with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution uses a blockchain system to decrypt the ciphertext, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This effectively solves the technical problem of excessive load during data processing in existing technologies.
[0084] Optionally, the operation of multiple key distribution centers obtaining the attribute set of a data accessor includes: the data accessor sending an access request and the attribute set to a trusted authentication center, wherein the access request is used to request the acquisition of the first plaintext; the trusted authentication center authenticating the identity of the data accessor based on the access request; and if the identity of the data accessor is valid, the trusted authentication center sending the attribute set of the data accessor to multiple key distribution centers.
[0085] Specifically, when a data visitor wants to obtain data M uploaded by the data owner, the data visitor sends an access request for the data and the data visitor's attribute set A to the trusted authentication center. The access request includes a temporary random number.
[0086] The trusted authentication center pre-sets a list of visitor information, which records the IDs of each allowed data visitor and their temporary random numbers. Each allowed data visitor's ID and their temporary random number have a unique correspondence, and the temporary random number is greater than 0. That is, each allowed data visitor has their own unique temporary random number. In addition, the visitor information list also records the IDs of disallowed data visitors and their temporary random numbers. Disallowed data visitors have a temporary random number of 0.
[0087] After receiving an access request, the Trusted Authentication Center (TAC) retrieves the temporary nonce and the access visitor's ID from the request. The TAC then queries the visitor list for the visitor's ID. If the ID is not found, the visitor fails authentication, and the TAC sends an "Access Failed" message. If the TAC finds the visitor's ID, it retrieves the temporary nonce from the visitor information list and compares it with the nonce from the access request. If the nonce differs from the nonce in the access information list, or if the nonce in the access information list is 0, authentication fails, and the TAC rejects the access request. If the nonce matches, authentication succeeds.
[0088] In addition, the data owner can modify the list of visitors stored in the trusted authentication center. When the data owner changes the temporary random number of a data visitor who is allowed to access the data to 0, the data owner revokes the data visitor's access rights.
[0089] Once the data visitor's identity is successfully authenticated, the trusted authentication center sends attribute set A to multiple key distribution centers.
[0090] Therefore, this technical solution can improve data security by authenticating the identity of data access users, thereby restricting unauthorized data access users from obtaining data.
[0091] Optionally, the operation of generating multiple private keys based on an attribute set using a key generation algorithm includes: multiple key distribution centers obtaining a pre-stored master key, and generating multiple private keys based on the attribute set and the master key using a key generation algorithm.
[0092] Specifically, when the data owner stores the data, the trusted authentication center sends the public parameter GP to multiple key distribution centers (AA). θ Multiple key distribution centers (AA) θ Upon receiving the public parameter GP, the master key MK is generated based on the public parameter GP using the first initialization algorithm. θ Where θ = 1 to n, n is a natural number, and n >= 2. That is, the system includes multiple key distribution centers, and each key distribution center generates a master key.
[0093] Where when θ∈[1,n-1], the key distribution center AA θ Randomly generate αθ , where α θ ∈Z p ,but:
[0094] MK θ ={α θ}
[0095] When θ = n, the key distribution center AA θ Randomly generate β, where β∈Z p ,but:
[0096] MK θ ={β}
[0097] Furthermore, after receiving attribute set A, multiple key distribution centers use a key generation algorithm based on the master key MK. θ Generate private key SK from attribute set A θ The expression is: KeyGen(MK θ A)→SK θ
[0098] Specifically, the attribute set A = {a1, a2, ..., a...} m}. Attribute set A includes m attributes. Key distribution center AA θ Randomly generate r j,θ Where r j,θ ∈Z p ,and Where j = 1 to m, and j is a natural number. Calculate the private key parameter D. 1,θ D 2,θ and attribute aggregation parameter D a,θ The private key output by the key generation algorithm can be represented as:
[0099] If θ∈[1,n-1], then:
[0100]
[0101] If θ = n, then: SK θ ={D s =g 1 / β}
[0102] Therefore, in this technical solution, multiple key distribution centers generate multiple different private keys through multiple pre-generated different master keys, thereby reducing the load on the key distribution centers. Furthermore, the encryption text can only be decrypted using different private keys, thus improving data security.
[0103] Optionally, the operation of the blockchain system decrypting ciphertext using multiple private keys to obtain the first plaintext through a data decryption algorithm includes: the blockchain system generating a total private key using a private key calculation algorithm based on multiple private keys sent by the key distribution center; the blockchain system obtaining pre-stored ciphertext from the cloud server; and the blockchain system decrypting the ciphertext using the total private key through a data decryption algorithm to obtain the first plaintext.
[0104] Specifically, the key distribution center AA θ Send private key SK to the blockchain system θ The blockchain system received the private key SK. θ Then, the private key is calculated using a private key calculation algorithm based on the private key SK. θ Generate the master private key SK. The expression is:
[0105] SKCompute(SK1,SK2,...,SK n →SK
[0106] Specifically, the smart contracts of the blockchain system are based on the private key SK. θ Automatically calculate private key parameters D1, D2 and attribute aggregation parameter D a It outputs the master private key SK, which is used to decrypt the ciphertext.
[0107]
[0108]
[0109]
[0110] SK = {D1,D2,D} a}
[0111] Furthermore, the blockchain system sends a request to the cloud server to retrieve the encrypted text. In response, the cloud server sends the encrypted text CT' to the blockchain system. CT' represents the data stored on the cloud server by the data owner. Upon receiving CT', the blockchain system uses a data decryption algorithm to generate plaintext M' (i.e., the first plaintext) based on CT' and the master private key SK.
[0112] Therefore, the blockchain system in this technical solution decrypts ciphertext using a private key, and the powerful computing performance of the blockchain system can improve the decryption efficiency.
[0113] Optionally, the operation of the blockchain system to decrypt the ciphertext using a data decryption algorithm based on the total private key to obtain the first plaintext includes: the blockchain system obtaining the access policy in the ciphertext, wherein the access policy is used to indicate the attributes of the data owner; the blockchain system matching the attribute set in the total private key with the access policy; and if the attribute set and the access policy match successfully, the blockchain system generating the first plaintext corresponding to the ciphertext.
[0114] Specifically, the blockchain system sends a request to the cloud server to retrieve the encrypted text. In response, the cloud server sends the encrypted text CT' to the blockchain system. CT' represents the data stored on the cloud server by the data owner. Upon receiving CT', the blockchain system uses a data decryption algorithm to generate plaintext M' (i.e., the first plaintext) based on CT' and the master private key SK. The expression is as follows:
[0115] Decrypt(CT′,SK)→M′or ⊥
[0116] Specifically, the blockchain system obtains attribute set A from the master private key SK, matches attribute set A in the master private key SK with the access policy P in the ciphertext CT', and if the match is successful, decrypts the ciphertext CT' to obtain the plaintext M' (i.e., the first plaintext). Here, attribute set A = {a1, a2, ..., a...} m}, access strategy P = {p1, p2, ..., p m The blockchain system will use a collision-resistant hash function to process the a1~a1~a2 attributes in attribute set A. m The results of the separate calculations are multiplied to obtain the result of attribute set A, and then the result of the calculation is applied to access strategy P by a collision-resistant hash function to process p1 to p2. m The results of the separate calculations are multiplied to obtain the result of the access strategy P. The blockchain system then compares the result of the attribute set A with the result of the access strategy P to determine whether attribute set A matches the access strategy. Furthermore, the number of attributes in attribute set A is the same as the number of elements in access strategy P.
[0117] Therefore, when attribute set A matches access policy P, the ciphertext CT' is decrypted to obtain plaintext M' (i.e., the first plaintext). This can be expressed using the formula:
[0118]
[0119] The blockchain system then calculates M′ based on CT′ and De:
[0120]
[0121] Therefore, this technical solution ensures data security by matching attribute sets and access policies to obtain plaintext.
[0122] Optionally, the operation of the blockchain system sending the first plaintext to the data accessor includes: the blockchain system generating a corresponding first hash value based on the first plaintext; the blockchain system comparing the second hash value of the pre-stored second plaintext with the first hash value, wherein the data owner generates ciphertext based on the second plaintext; and if the first hash value and the second hash value are the same, the blockchain system sending the first plaintext to the data accessor.
[0123] Specifically, the blockchain system uses the SHA256 algorithm to generate a hash value hashm' (first hash value) from the plaintext M' (i.e., the first plaintext), and obtains the hash value hashm' (second hash value) of the plaintext M (i.e., the second plaintext) stored in the blockchain system by the data owner. The blockchain system then compares the hash value hashm' (second hash value) with the hash value hashm' (first hash value). If the hash values hashm and hashm' are the same, then plaintext M' (first plaintext) and plaintext M (second plaintext) are identical. The blockchain system then determines that the ciphertext CT has not been tampered with after being stored on the cloud server, and subsequently sends the plaintext M' (first plaintext) to the data accessor. When the hash value hashm is different from the hash value hashm', then the plaintext M' (i.e., the first plaintext) is also different from the plaintext M (i.e., the second plaintext). The blockchain system then determines that the ciphertext CT has been tampered with after being stored on the cloud server, and thus returns an "access failed" message to the data access user.
[0124] This technical solution compares the hash value of plaintext stored on the cloud server with the hash value of plaintext pre-stored in the blockchain, thus ensuring the authenticity of the data stored on the cloud server and guaranteeing its integrity. Furthermore, the immutability of the blockchain in storing plaintext hash values provides a trusted environment for private key synthesis and ciphertext decryption.
[0125] Therefore, according to the second aspect of this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing schemes with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution decrypts the ciphertext using a blockchain system, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This solves the technical problem of excessive load when processing data in existing technologies.
[0126] In addition, refer to Figure 4 as well as Figure 6 As shown, the process of encrypting plaintext and decrypting ciphertext is as follows:
[0127] S1: If the data owner DO wants to encrypt and store the plaintext M in the cloud server CSP, then the data owner DO sends a data upload request to the trusted certification authority CA.
[0128] S2: After receiving the data upload request, the Trusted Authentication Center (CA) randomly generates a security parameter λ and then uses a second initialization algorithm to generate a common parameter GP based on the security parameter λ. The expression for generating the common parameter GP based on the security parameter λ using the second initialization algorithm is: Setup(1 λ → (GP)
[0129] Specifically, the Trusted Certification Authority (CA) inputs the generated security parameter λ into the bilinear group generation algorithm. Then, based on the safety parameter λ, output (p, G0, G1, e). Where G0 and G1 are Z... p Z is a multiplicative cyclic group of order p, where p is a random prime number. p Let G0 be the set of all numbers between [0, p-1] that are relatively prime to a prime number p. The generator of the group G0 is g, where g is a random number and satisfies the bilinear mapping e: G0 × G0 → G1, using a collision-resistant hash function H: G0 → Z. p As a random oracle model, the trusted authentication center (CA) obtains the common parameters GP from the output, where GP = {G0, G1, g, e, p}.
[0130] S3: The Trusted Certification Authority (CA) sends the Public Parameters (GP) to the Key Distribution Center (AA). θ .
[0131] S4: Key Distribution Center (AA) θ After receiving the public parameter GP, a public key PK is generated based on the public parameter GP using the first initialization algorithm. θ and master key MK θ Where θ = 1 to n, and n is a natural number, and n >= 2. That is, the system includes multiple key distribution centers, each generating a public key and a master key. Furthermore, the public key PK is generated based on the public parameter GP using a first initialization algorithm. θ and master key MK θ The expression is:
[0132] SetupAA(GP)→(PK θ MK θ ).
[0133] Specifically, multiple key distribution centers AAθ After generating the public key PK through the first initialization algorithm θ and master key MK θ When θ∈[1,n-1], the key distribution center AA θ Randomly select α θ ∈Z p ,but:
[0134]
[0135] MK θ ={α θ}
[0136] When θ = n, the key distribution center AA θ Randomly select β∈Z p ,but:
[0137] PK θ ={g β}
[0138] MK θ ={β}
[0139] S5: Key Distribution Center AA θ PK the public key θ Send to the data owner (DO).
[0140] S6: Data owner DO receives public key PK θ Then, using the first encryption algorithm, based on the public key PK... θ The plaintext M and access policy P are used to generate the ciphertext CT. The expression is:
[0141] Encrypt(PK1,PK2,...,PK n ,M,P)→CT
[0142] Where the access strategy P = {p1, p2, ..., p...} m}, that is, the access strategy P includes m elements, where the m elements are m attributes corresponding to the data owner.
[0143] Specifically, the data owner DO selects a random number s∈Z. p Calculate the encrypted message C M Ciphertext parameters C1, C2 and policy aggregation parameter C p The data owner DO encrypts the access policy P using a collision-resistant hash function, thereby obtaining the policy aggregation parameter C. p The ciphertext CT output by the first encryption algorithm can be represented as:
[0144]
[0145] S7: The data owner DO sends the encrypted CT to the cloud server CSP. The cloud server CSP stores the received encrypted CT, thus obtaining the encrypted CT'.
[0146] S8: The data owner DO generates a hash value hashm of plaintext M based on plaintext M using a second encryption algorithm. The expression for obtaining the hash value hashm using the second encryption algorithm is:
[0147] SHA256(M)→hashm
[0148] Specifically, the data owner DO uses the SHA256 algorithm to encrypt the plaintext M, obtaining the hash value hashm of the plaintext M.
[0149] S9: Data owner DO sends the hash value hashm to the blockchain system BC, which stores the hash value hashm. Thus, data owner DO's plaintext M is successfully uploaded.
[0150] S10: When data visitor DU wants to obtain data M uploaded by data owner DO, data visitor DU sends an access request for obtaining data M and its attribute set A to the trusted authentication center CA. The access request includes a temporary random number.
[0151] S11: The Trusted Certification Center (CA) pre-configures a visitor information list. This list records the IDs of all allowed data visitors and their temporary random numbers. Each allowed data visitor's ID and their temporary random number have a unique correspondence, and the temporary random number is greater than 0. That is, each allowed data visitor has their own unique temporary random number. In addition, the visitor information list also records the IDs of disallowed data visitors and their temporary random numbers. The temporary random number for disallowed data visitors is 0.
[0152] After receiving an access request, the Trusted Authentication Center (CA) retrieves the temporary nonce and the access user's ID from the request. The CA then queries the access user's ID in the access user list. If the ID is not found, the access user fails authentication, and the CA sends an "Access Failed" message. If the CA finds the access user's ID, it retrieves the temporary nonce from the access user information list and compares it with the nonce from the access request. If the nonce differs from the nonce in the access request or is zero, the access user's authentication fails, and the CA rejects the access request. If the nonce matches, the access user's authentication succeeds.
[0153] In addition, the data owner can modify the list of visitors stored in the trusted authentication center. When the data owner changes the temporary random number of a data visitor who is allowed to access the data to 0, the data owner revokes the data visitor's access rights.
[0154] S12: If the data visitor's identity is successfully authenticated, the trusted authentication center will send attribute set A to multiple key distribution centers.
[0155] S13: After receiving attribute set A, multiple key distribution centers use a key generation algorithm based on the master key MK θ Generate private key SK from attribute set A θ The expression is: KeyGen(MK θ A)→SK θ
[0156] Specifically, the attribute set A = {a1, a2, ..., a...} m}. Attribute set A includes m attributes. Key distribution center AA θ Randomly select r j,θ ∈Z p ,and Where j = 1 to m, and j is a natural number. Calculate the private key parameter D. 1,θ D 2,θ and attribute aggregation parameter D a,θ The private key output by the key generation algorithm can be represented as:
[0157] If θ∈[1,n-1], then:
[0158]
[0159] If θ = n, then: SK θ ={D s =g 1 / β}
[0160] S14: Key Distribution Center AA θ Send private key SK to blockchain system BC θ .
[0161] S15: Blockchain system BC receives private key SK θ Then, the private key is calculated using a private key calculation algorithm based on the private key SK. θ Generate the master private key SK. The expression is: SKCompute(SK1,SK2,...,SK...). n →SK
[0162] Specifically, the smart contracts of the blockchain system BC are based on the private key SK. θ Automatically calculate private key parameters D1, D2 and attribute aggregation parameter D a Output the master private key SK, which is used to decrypt CT.
[0163]
[0164]
[0165]
[0166] SK = {D1,D2,D} a}
[0167] S16: The blockchain system BC sends a request to the cloud server CSP to obtain the ciphertext. In response to the request, the cloud server CSP sends the ciphertext CT' to the blockchain system BC.
[0168] S17: After receiving the ciphertext CT', the blockchain system BC generates the plaintext M' using a data decryption algorithm based on the ciphertext CT' and the main private key SK. The expression is:
[0169] Decrypt(CT′,SK)→M′or ⊥
[0170] Specifically, the blockchain system BC matches the attribute set A in the master private key SK with the access policy P in the ciphertext CT'. If a match is found, the ciphertext CT' is decrypted to obtain the plaintext M'. This can be expressed using the formula:
[0171]
[0172] Then, the blockchain system BC calculates M′ based on CT′ and De:
[0173]
[0174] S18: Blockchain system BC generates a hash value hashm' from plaintext M' using the SHA256 algorithm and obtains the hash value hashm of plaintext M stored in blockchain system BC by data owner DO. Then, blockchain system BC compares hash value hashm with hash value hashm'. If hash value hashm is the same as hash value hashm', then plaintext M' is the same as plaintext M. Blockchain system BC determines that ciphertext CT has not been tampered with after being stored on cloud server CSP, and according to the expression Decrypt(CT′,SK)→M′or⊥, if it has not been tampered with, it outputs M'. Blockchain system BC then sends plaintext M' to the data accessor. If hash value hashm is different from hash value hashm', then plaintext M' is also different from plaintext M. Blockchain system BC determines that ciphertext CT has been tampered with after being stored on cloud server CSP, and according to the expression Decrypt(CT′,SK)→M′or⊥, if it has been tampered with, it outputs ⊥. Therefore, it returns an "access failed" message to the data accessor.
[0175] In addition, refer to Figure 1 As shown, according to a third aspect of this embodiment, a storage medium is provided. The storage medium includes a stored program, wherein, when the program is executed, a processor performs any of the methods described above.
[0176] Therefore, according to this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing schemes with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution uses a blockchain system to decrypt the ciphertext, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This solves the technical problem of excessive load when processing data in existing technologies.
[0177] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0178] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0179] Example 2
[0180] Figure 7 A data storage device 700 based on attribute-based encryption according to a first aspect of this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. Reference Figure 7 As shown, the device 700 includes: a first generation module 710, used by multiple key distribution centers to generate multiple public keys according to public parameters through a first initialization algorithm; a second generation module 720, used by a data owner to generate ciphertext according to multiple public keys, plaintext, and access policy through a first encryption algorithm, wherein the access policy is used to indicate the attributes of the data owner; and a storage module 730, used by the data owner to store the ciphertext to a cloud server.
[0181] Optionally, the first generation module 710 includes: a first generation submodule, used by the trusted authentication center to randomly generate security parameters based on the data upload request sent by the data owner; a second generation submodule, used by the trusted authentication center to generate public parameters based on the security parameters using a second initialization algorithm; and a third generation submodule, used by multiple key distribution centers to generate multiple public keys and multiple master keys based on the public parameters sent by the trusted authentication center using a first initialization algorithm.
[0182] Optionally, the device 700 further includes: a hash value generation module for the data owner to generate a corresponding hash value based on the plaintext using a second encryption algorithm; and a data storage module for the data owner to store the hash value in a blockchain system.
[0183] also, Figure 8 A data acquisition apparatus 800 based on attribute-based encryption according to a second aspect of this embodiment is shown, which corresponds to the method described according to the second aspect of Embodiment 1. Reference Figure 8As shown, the device 800 includes: a third generation module 810, used by multiple key distribution centers to obtain the attribute set of data accessors and generate multiple private keys according to the attribute set through a key generation algorithm; a decryption module 820, used by the blockchain system to decrypt the ciphertext according to the multiple private keys through a data decryption algorithm to obtain the first plaintext; and a data sending module 830, used by the blockchain system to send the first plaintext to the data accessor.
[0184] Optionally, the third generation module 810 includes: a first sending submodule, used by the data accesser to send an access request and an attribute set to the trusted authentication center, wherein the access request is used to request the acquisition of the first plaintext; an authentication submodule, used by the trusted authentication center to authenticate the identity of the data accesser according to the access request; and a second sending submodule, used by the trusted authentication center to send the attribute set of the data accesser to multiple key distribution centers if the identity of the data accesser is legitimate.
[0185] Optionally, the third generation module 810 includes: a fourth generation submodule, used by multiple key distribution centers to obtain a pre-stored master key and generate multiple private keys based on the attribute set and the master key through a key generation algorithm.
[0186] Optionally, the decryption module 820 includes: a third sending submodule, used by the blockchain system to generate a total private key based on multiple private keys sent by the key distribution center using a private key calculation algorithm; a first obtaining submodule, used by the blockchain system to obtain pre-stored ciphertext from the cloud server; and a decryption submodule, used by the blockchain system to decrypt the ciphertext based on the total private key using a data decryption algorithm to obtain the first plaintext.
[0187] Optionally, the decryption submodule includes: a second acquisition submodule, used by the blockchain system to acquire the access policy in the ciphertext, wherein the access policy is used to indicate the attributes of the data owner; a matching submodule, used by the blockchain system to match the attribute set in the total private key with the access policy; and a fifth generation submodule, used by the blockchain system to generate a first plaintext corresponding to the ciphertext when the attribute set and the access policy are successfully matched.
[0188] Optionally, the data sending module 830 includes: a sixth generation submodule, used by the blockchain system to generate a corresponding first hash value based on the first plaintext; a comparison submodule, used by the blockchain system to compare the second hash value of the pre-stored second plaintext with the first hash value, wherein the data owner generates ciphertext based on the second plaintext; and a fourth sending submodule, used by the blockchain system to send the first plaintext to the data accessor if the first hash value and the second hash value are the same.
[0189] Therefore, according to this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing schemes with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution uses a blockchain system to decrypt the ciphertext, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This solves the technical problem of excessive load when processing data in existing technologies.
[0190] Example 3
[0191] Figure 9 A data storage device 900 based on attribute-based encryption according to a first aspect of this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. Reference Figure 9 As shown, the device 900 includes: a first processor 910; and a first memory 920 connected to the first processor 910, for providing instructions to the first processor 910 to process the following steps: multiple key distribution centers generate multiple public keys according to common parameters through a first initialization algorithm; a data owner generates ciphertext according to multiple public keys, plaintext, and access policy through a first encryption algorithm, wherein the access policy is used to indicate the attributes of the data owner; and the data owner stores the ciphertext to a cloud server.
[0192] Optionally, the operation of multiple key distribution centers generating multiple public keys based on public parameters using a first initialization algorithm includes: a trusted authentication center randomly generating security parameters based on a data upload request sent by the data owner; a trusted authentication center generating public parameters based on the security parameters using a second initialization algorithm; and multiple key distribution centers generating multiple public keys and multiple master keys based on the public parameters sent by the trusted authentication center using the first initialization algorithm.
[0193] Optionally, the device 900 further includes: the data owner generating a corresponding hash value based on the plaintext using a second encryption algorithm; and the data owner storing the hash value in a blockchain system.
[0194] also, Figure 10 A data acquisition apparatus 1000 based on attribute-based encryption according to a second aspect of this embodiment is shown, which corresponds to the method described according to the second aspect of Embodiment 1. Reference Figure 10As shown, the device 1000 includes: a second processor 1010; and a second memory 1020 connected to the second processor 1010, used to provide instructions to the second processor 1010 to process the following steps: multiple key distribution centers obtain the attribute set of data accessors and generate multiple private keys according to the attribute set through a key generation algorithm; the blockchain system decrypts the ciphertext according to the multiple private keys through a data decryption algorithm to obtain the first plaintext; and the blockchain system sends the first plaintext to the data accessor.
[0195] Optionally, the operation of multiple key distribution centers obtaining the attribute set of a data accessor includes: the data accessor sending an access request and the attribute set to a trusted authentication center, wherein the access request is used to request the acquisition of the first plaintext; the trusted authentication center authenticating the identity of the data accessor based on the access request; and if the identity of the data accessor is valid, the trusted authentication center sending the attribute set of the data accessor to multiple key distribution centers.
[0196] Optionally, the operation of generating multiple private keys based on an attribute set using a key generation algorithm includes: multiple key distribution centers obtaining a pre-stored master key, and generating multiple private keys based on the attribute set and the master key using a key generation algorithm.
[0197] Optionally, the operation of the blockchain system decrypting ciphertext using multiple private keys to obtain the first plaintext through a data decryption algorithm includes: the blockchain system generating a total private key using a private key calculation algorithm based on multiple private keys sent by the key distribution center; the blockchain system obtaining pre-stored ciphertext from the cloud server; and the blockchain system decrypting the ciphertext using the total private key through a data decryption algorithm to obtain the first plaintext.
[0198] Optionally, the operation of the blockchain system to decrypt the ciphertext using a data decryption algorithm based on the total private key to obtain the first plaintext includes: the blockchain system obtaining the access policy in the ciphertext, wherein the access policy is used to indicate the attributes of the data owner; the blockchain system matching the attribute set in the total private key with the access policy; and if the attribute set and the access policy match successfully, the blockchain system generating the first plaintext corresponding to the ciphertext.
[0199] Optionally, the operation of the blockchain system sending the first plaintext to the data accessor includes: the blockchain system generating a corresponding first hash value based on the first plaintext; the blockchain system comparing the second hash value of the pre-stored second plaintext with the first hash value, wherein the data owner generates ciphertext based on the second plaintext; and if the first hash value and the second hash value are the same, the blockchain system sending the first plaintext to the data accessor.
[0200] Therefore, according to this embodiment, multiple key distribution centers generate multiple public keys. The data owner can generate ciphertext based on the multiple public keys and plaintext. Furthermore, multiple key distribution centers generate multiple private keys. Compared to existing schemes with only one key distribution center, this technical solution distributes the computational burden across multiple key distribution centers, thereby reducing their load. Moreover, this technical solution uses a blockchain system to decrypt the ciphertext, leveraging the immutability of the blockchain system to improve the security and authenticity of the ciphertext during decryption. This solves the technical problem of excessive load when processing data in existing technologies.
[0201] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0202] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0206] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0207] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A data storage method based on attribute-based encryption, characterized in that, include: Multiple key distribution centers generate multiple public keys based on common parameters using a first initialization algorithm; The data owner generates ciphertext using a first encryption algorithm based on the plurality of public keys, plaintext, and access policy, wherein the access policy is used to indicate the attributes of the data owner; as well as The data owner stores the ciphertext on a cloud server, and the data owner generates a corresponding hash value based on the plaintext using a second encryption algorithm; Furthermore, the data owner stores the hash value in the blockchain system; Multiple key distribution centers obtain the attribute set of the data accessor and generate multiple private keys based on the attribute set using a key generation algorithm; The blockchain system uses a data decryption algorithm to decrypt the ciphertext based on the multiple private keys to obtain the first plaintext; as well as The blockchain system sends the first plaintext to the data accessor, and the operation of the blockchain system sending the first plaintext to the data accessor includes: The blockchain system generates a corresponding first hash value based on the first plaintext. The blockchain system compares the second hash value of the pre-stored second plaintext with the first hash value, wherein the data owner generates the ciphertext based on the second plaintext; and If the first hash value is the same as the second hash value, the blockchain system sends the first plaintext to the data accessor. The operation of the blockchain system decrypting the ciphertext using the multiple private keys to obtain the first plaintext includes: The blockchain system generates a master private key based on the multiple private keys sent by the key distribution center using a private key calculation algorithm. The blockchain system obtains pre-stored ciphertext from the cloud server; and The blockchain system decrypts the ciphertext using a data decryption algorithm based on the total private key to obtain the first plaintext. The operation of the blockchain system decrypting the ciphertext using the data decryption algorithm based on the total private key to obtain the first plaintext includes: The blockchain system obtains the access policy from the ciphertext, wherein the access policy is used to indicate the attributes of the data owner; The blockchain system matches the attribute set in the master private key with the access policy; and If the attribute set matches the access policy, the blockchain system generates a first plaintext corresponding to the ciphertext.
2. The method according to claim 1, characterized in that, The operation of multiple key distribution centers generating multiple public keys based on common parameters using a first initialization algorithm includes: The trusted authentication center randomly generates security parameters based on the data upload request sent by the data owner; The trusted authentication center generates the public parameters based on the security parameters using a second initialization algorithm; and The multiple key distribution centers generate multiple public keys and multiple master keys based on the public parameters sent by the trusted authentication center using a first initialization algorithm.
3. The method according to claim 1, characterized in that, The operations of multiple key distribution centers to obtain the attribute set of data accessors include: The data accesser sends an access request and an attribute set to the trusted authentication center, wherein the access request is used to request the acquisition of the first plaintext. The trusted authentication center authenticates the identity of the data access user based on the access request; and If the data visitor's identity is legitimate, the trusted authentication center sends the data visitor's attribute set to the multiple key distribution centers.
4. The method according to claim 1, characterized in that, The operation of generating multiple private keys based on an attribute set using a key generation algorithm includes: The multiple key distribution centers obtain the pre-stored master key and generate multiple private keys based on the attribute set and the master key using the key generation algorithm.
5. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, the method described in any one of claims 1 to 4 is performed by a processor.
Citation Information
Patent Citations
Blockchain data sharing encryption and decryption method, equipment, and storage medium
CN111385301A
Attribute-based searchable encryption of multi-center ciphertext strategy and corresponding method for searching and acquiring data
CN112751670A
Method and system for storing and accessing trusted data in electric power information physical system
CN113360925A