Resource sharing method and device, storage medium and electronic device

By using the target user attribute structure and identity public and private key pairs in the resource sharing blockchain network to encrypt and re-encrypt, the problems of high key calculation cost and low sharing efficiency in resource sharing are solved, and safe and efficient resources are achieved shared.

CN115150397BActive Publication Date: 2024-11-15CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210803321.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-07
Publication Date
2024-11-15
Estimated Expiration
2042-07-07

AI Technical Summary

Technical Problem

The prior art has problems such as high key calculation cost and low sharing efficiency in the resource sharing process. Especially in cloud storage and data sharing, it requires frequent encryption and decryption operations, which increases the cost of computing and communication and affects security.

Method used

In the resource sharing blockchain network, the resource data plaintext is encrypted using the target user attribute structure and the identity public key, and a first-level ciphertext is generated, and a re-encryption key is generated based on the identity public and private key pair and the target user attribute structure, and re-encryption is performed. Operation, generate a re-encrypted ciphertext, so that the resource requesting node that meets the target user attribute structure can decrypt and obtain the resource data plaintext.

Benefits of technology

It reduces the cost of key computing and storage, improves resource sharing efficiency, ensures the security and robustness of ciphertext sharing, avoids data resource barriers for different data holders, and saves time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115150397B_ABST
    Figure CN115150397B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of Internet technology, and to a resource sharing method and device, a storage medium, and an electronic device, including: a resource-owning node encrypts resource data plaintext according to a target user attribute structure and an identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate user attribute information with sharing authority for the resource data plaintext; a re-encryption key is generated according to an identity public-private key pair and a target user attribute structure; the first-level ciphertext and the re-encryption key are uploaded to a resource-sharing blockchain network to perform a re-encryption operation based on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that a resource requesting node decrypts the re-encrypted ciphertext to obtain a resource data plaintext; the first user attribute information of the resource requesting node satisfies the target user attribute structure. The present disclosure reduces the computational cost of resource sharing and ensures the security and robustness of ciphertext sharing by introducing an encryption method based on a user attribute structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and more specifically, to a resource sharing method, a resource sharing device, a storage medium, and an electronic device. Background Art

[0002] With the development of the Internet technology field, the demand for cloud storage and data sharing has occupied an important position in society, which may cause problems such as data privacy and security at the data resource level.

[0003] In related technologies, resource ciphertext conversion is achieved through a third-party agent, and encryption and decryption work needs to be repeated during the resource sharing process. Resource owners need to generate keys for different resource requesters, which limits resource sharing between different users and increases the key calculation cost and communication cost in the resource sharing process, affecting resource sharing efficiency.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a resource sharing method and device, a computer storage medium and an electronic device, thereby overcoming the technical problems of high key calculation cost and low sharing efficiency of resource sharing caused by the limitations of related technologies to at least a certain extent.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a resource sharing method is provided, which is applied to a resource-owning node, comprising:

[0008] The resource-owning node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate the attribute information of the user who has the sharing authority of the resource data plaintext;

[0009] Generate a re-encryption key based on the public-private key pair and the target user attribute structure;

[0010] Uploading the primary ciphertext and the re-encryption key to the resource sharing blockchain network to perform a re-encryption operation based on the primary ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext;

[0011] The first user attribute information of the resource requesting node satisfies the target user attribute structure.

[0012] In an exemplary embodiment of the present disclosure, before the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain the first-level ciphertext, the method further includes:

[0013] When registering to the resource sharing blockchain network, receiving the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, wherein the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network;

[0014] Among them, the attribute authorization node is determined from the resource sharing blockchain network according to a preset dynamic selection strategy.

[0015] In an exemplary embodiment of the present disclosure, the attribute authorization node is determined by the resource sharing blockchain network from the nodes according to the selection probability, network status information, and node credibility value of the nodes in the resource sharing blockchain network;

[0016] Among them, the probability of being selected is negatively correlated with the number of times the node has been selected in history, and the node credibility value is determined based on the node identity of the node in the resource sharing blockchain network.

[0017] In an exemplary embodiment of the present disclosure, generating a re-encryption key according to the identity public-private key pair and the target user attribute structure includes:

[0018] Selecting at least one target user attribute information that meets the sharing requirement from the user attribute information corresponding to the target user attribute structure;

[0019] The re-encryption key is generated according to the identity public-private key pair and the at least one target user attribute information.

[0020] According to one aspect of the present disclosure, a resource sharing method is provided, which is applied to a resource requesting node, comprising:

[0021] Sending resource request information to the resource sharing blockchain network, wherein the resource request information includes first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and the re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext;

[0022] Obtain the re-encrypted ciphertext, decrypt the re-encrypted ciphertext using its own identity private key, and obtain the resource data plaintext;

[0023] Among them, the first-level ciphertext is obtained by the resource owning node encrypting the resource data plaintext according to the target user attribute structure and its own identity public key. The target user attribute structure is used to indicate the user attribute information with sharing authority of the resource data plaintext. The re-encryption key is generated according to the identity public-private key pair of the resource owning node and the target user attribute structure.

[0024] In an exemplary embodiment of the present disclosure, before sending the resource request information to the resource sharing blockchain network, the method further includes:

[0025] When registering to the resource sharing blockchain network, receiving the first user attribute information and identity public-private key pair assigned by the corresponding attribute authorization node, wherein the identity public-private key pair is generated based on the first user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network;

[0026] Among them, the attribute authorization node is determined from the resource sharing blockchain network according to a preset dynamic selection strategy.

[0027] According to one aspect of the present disclosure, a resource sharing method is provided, applying a resource sharing blockchain network, comprising:

[0028] Receive a first-level ciphertext and a re-encryption key uploaded by a resource-owning node, wherein the first-level ciphertext is obtained by encrypting the resource data plaintext by the resource-owning node according to a target user attribute structure and an identity public key, the target user attribute structure is used to indicate user attribute information having sharing authority for the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure;

[0029] Based on the first user attribute information of the resource requesting node, re-encrypting the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext;

[0030] Sending the re-encrypted ciphertext to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext;

[0031] The first user attribute information satisfies the target user attribute structure.

[0032] According to one aspect of the present disclosure, a resource sharing device is provided, which is applied to a resource-owning node, and the device includes:

[0033] A first encryption module is used for the resource-owning node to encrypt the resource data plaintext according to the target user attribute structure and the identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext;

[0034] A second encryption module, used to generate a re-encryption key according to the identity public-private key pair and the target user attribute structure;

[0035] A resource sharing module, configured to upload the primary ciphertext and the re-encryption key to a resource sharing blockchain network, to perform a re-encryption operation based on the primary ciphertext and the re-encryption key, to generate a re-encrypted ciphertext, so that a resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext;

[0036] The first user attribute information of the resource requesting node satisfies the target user attribute structure.

[0037] According to one aspect of the present disclosure, a resource sharing device is provided, which is applied to a resource requesting node, and the device includes:

[0038] A resource request module, configured to send resource request information to a resource sharing blockchain network, wherein the resource request information includes first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and the re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext;

[0039] A decryption module is used to obtain the re-encrypted ciphertext, decrypt the re-encrypted ciphertext using its own identity private key, and obtain the resource data plaintext;

[0040] Among them, the first-level ciphertext is obtained by the resource owning node encrypting the resource data plaintext according to the target user attribute structure and its own identity public key. The target user attribute structure is used to indicate the user attribute information with sharing authority of the resource data plaintext. The re-encryption key is generated according to the identity public-private key pair of the resource owning node and the target user attribute structure.

[0041] According to one aspect of the present disclosure, a resource sharing device is provided, applying a resource sharing blockchain network, the device comprising:

[0042] A first resource processing module is used to receive a first-level ciphertext and a re-encryption key uploaded by a resource-owning node, wherein the first-level ciphertext is obtained by encrypting a resource data plaintext by the resource-owning node according to a target user attribute structure and an identity public key, the target user attribute structure is used to indicate user attribute information having sharing authority for the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure;

[0043] A proxy re-encryption module, configured to perform a re-encryption operation on the primary ciphertext and the re-encryption key based on the first user attribute information of the resource requesting node to generate a re-encrypted ciphertext;

[0044] A second resource processing module is used to send the re-encrypted ciphertext to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext;

[0045] The first user attribute information satisfies the target user attribute structure.

[0046] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above methods is implemented.

[0047] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.

[0048] In the resource sharing method of the exemplary embodiment of the present disclosure, the resource owning node encrypts the resource data plaintext according to the user attribute information indicating the sharing authority of the resource data plaintext and its own identity public key to obtain the first-level ciphertext, and generates a re-encryption key according to its own identity public-private key pair and the target user attribute structure, and uploads the first-level ciphertext and the re-encryption key to the resource sharing network. The resource sharing network re-encrypts the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the re-encryption key can be decrypted by the resource requesting node whose first user attribute information satisfies the target user attribute structure. On the one hand, the resource data plaintext is encrypted through the target user attribute structure and the identity public key to protect the resource owner's ownership of the resource. The resource-owning node does not need to generate re-encryption keys for different resource requesting nodes. It only needs to generate a unique re-encryption key based on its own public-private key pair and the target user attribute structure. Therefore, the re-encryption operation can only be completed for the resource requesting node that meets the target user attribute structure set by the resource-owning node, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext, breaking the data resource barriers between different data holders, ensuring the security and robustness of ciphertext sharing, and reducing the key calculation cost and storage cost. On the other hand, in the resource sharing process, there is no need for full-node consensus in the resource sharing blockchain network, saving time cost and improving resource sharing efficiency.

[0049] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0051] Figure 1 An application environment diagram according to an exemplary embodiment of the present disclosure is shown;

[0052] Figure 2 A flow chart of a resource sharing method according to an exemplary embodiment of the present disclosure is shown;

[0053] Figure 3 A flowchart showing an implementation method of a resource sharing node completing registration with a network according to an exemplary embodiment of the present disclosure is shown;

[0054] Figure 4 A flowchart of another resource sharing method according to an exemplary embodiment of the present disclosure is shown;

[0055] Figure 5 A flowchart of another resource sharing method according to an exemplary embodiment of the present disclosure is shown;

[0056] Figure 6 An interaction diagram of a resource sharing method in an application scenario according to an exemplary embodiment of the present disclosure is shown;

[0057] Figure 7 A schematic diagram of the structure of a resource sharing device according to an exemplary embodiment of the present disclosure is shown;

[0058] Figure 8 A schematic structural diagram of another resource sharing device according to an exemplary embodiment of the present disclosure is shown;

[0059] Fig. 9 A schematic structural diagram of another resource sharing device according to an exemplary embodiment of the present disclosure is shown;

[0060] Fig.10 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.

[0061] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0062] The exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and the concepts of the exemplary embodiments will be fully conveyed to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their detailed description will be omitted.

[0063] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known structures, methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0064] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or these functional entities or parts of functional entities may be implemented in one or more software hardened modules, or these functional entities may be implemented in different networks and / or processor devices and / or microcontroller devices.

[0065] Among the relevant technologies in this field, the demand for cloud storage and data sharing occupies an important position in society, which may cause issues such as data privacy and security at the data resource level.

[0066] However, cloud storage in related technologies considers encryption before uploading user data, and encryption and decryption work needs to be repeated during resource sharing, which limits resource sharing between different users. The cumbersome encryption and decryption work increases the computing cost and communication cost during resource sharing. In addition, when resource sharing is completed by using a semi-trusted third party as an agent to realize resource ciphertext conversion between different users, the data owner needs to generate a proxy re-encryption key for different resource requesters, which increases the computing cost and storage cost. The participation of semi-trusted third-party agents also poses security risks such as collusion attacks, which affects the security and robustness of resource sharing. In addition, full-node consensus within a blockchain node requires a high time cost, which reduces the efficiency of resource sharing.

[0067] Based on this, in an exemplary embodiment of the present disclosure, a resource sharing method is first provided.

[0068] Figure 1 FIG. 1 shows an application environment diagram related to an exemplary embodiment of the present disclosure. Figure 1As shown, there is a distributed resource sharing blockchain network 101, which includes resource sharing nodes (such as resource ownership node 102 and resource request node 103). Resource ownership node 102 uploads its own resource data to distributed resource sharing blockchain network 101, and resource request node 103 obtains shared resources through distributed resource sharing blockchain network 101.

[0069] Among them, the distributed resource sharing blockchain network 101 can complete the re-encryption operation of the first-level ciphertext and re-encryption key uploaded by the resource-owning node 102, which not only provides resource security protection, but also enables the resource requesting node 103 with the target user attribute structure that conforms to the target user attribute structure set by the resource-owning node 102 to decrypt the re-encrypted ciphertext.

[0070] Among them, an alliance chain can be formed by operators, monitoring parties, etc. to review and verify resource sharing transactions between resource sharing nodes, realize transaction settlement based on network servers (such as smart contracts), and realize incentives for shared resources, such as reviewing the first user attribute information of the resource request node and generating re-encrypted ciphertext.

[0071] The number of resource-owning nodes 102 may be one or more, and the number of resource-requesting nodes 103 may be one or more, which may be determined according to actual sharing requirements, and the embodiments of the present disclosure do not specifically limit this. It is worth noting that: Figure 1 The resource owning node 102 shown in the figure can also serve as a resource requester, and the resource requesting node 103 can also serve as a resource owner, that is, the resource owning node 102 and the resource requesting node 103 are not absolute, but relative probabilities.

[0072] like Figure 2 A flow chart of a resource sharing method according to an embodiment of the present disclosure is shown, which is applied to a resource-owning node. Figure 2 As shown, the resource sharing method of the embodiment of the present disclosure may include step S210 and step S230:

[0073] Step S210: the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext;

[0074] Step S220: Generate a re-encryption key based on the public and private key pair of the identity and the target user attribute structure;

[0075] Step S230: Upload the first-level ciphertext and the re-encryption key to the resource sharing blockchain network to perform a re-encryption operation based on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node can decrypt the re-encrypted ciphertext and obtain the resource data plaintext.

[0076] The first user attribute information of the resource requesting node satisfies the target user attribute structure.

[0077] The resource sharing method in the exemplary embodiment of the present disclosure encrypts resource data plaintext through the target user attribute structure and the identity public key to protect the resource owner's ownership of the resource. The resource-owning node does not need to generate re-encryption keys for different resource requesting nodes. It only needs to generate a unique re-encryption key based on its own public-private key pair and the target user attribute structure. The re-encryption operation can only be completed for the resource requesting node that meets the target user attribute information set by the resource-owning node, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext, breaking the data resource barriers of different data holders, ensuring the security and robustness of ciphertext sharing, and reducing the key calculation cost and storage cost. On the other hand, in the resource sharing process, there is no need for full-node consensus in the resource sharing blockchain network, saving time cost and improving resource sharing efficiency.

[0078] Combine the following Figure 2 The resource sharing method of the embodiment of the present disclosure is elaborated in detail.

[0079] In step S210, the resource owning node encrypts the resource data plaintext according to the target user attribute structure and identity public key to obtain a first-level ciphertext.

[0080] In an exemplary embodiment of the present disclosure, the target user attribute structure is used to indicate user attribute information with sharing rights of resource data plaintext, and is set by the resource-owning node according to its own resource sharing needs. The user attribute information is determined based on the on-chain node identity information of the resource sharing node in the resource sharing blockchain network. The on-chain node identity belongs to the trust basis for realizing on-chain interaction between resource sharing nodes in the resource sharing blockchain network. Therefore, based on the on-chain node identity information, the user attribute information with sharing rights of resource data plaintext is determined, which can not only realize the secure cloud access and sharing of resource data, but also make it possible for only the resource request node corresponding to the user attribute information that meets the target user attribute structure to have the authority to obtain the resource data plaintext. Based on the user attributes, it is avoided that the resource-owning node generates re-encryption keys for different resource request nodes, thereby reducing the key calculation cost.

[0081] In actual implementation, before the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and identity public key to obtain the first-level ciphertext, when registering to the resource sharing blockchain network, it receives the second user attribute information and identity public-private key pair assigned by the attribute authorization node. Among them, the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network.

[0082] Exemplarily, after the attribute authorization node completes the identity registration of the resource owner node and assigns the second user attribute information to the resource owner node according to the identity information of the resource owner node, the identity public-private key pair (identity public key KP A and identity private key SK A ):

[0083] KP A , S.K. A = KeyGen(par, U, U A ) (1)

[0084] Wherein, par is a security parameter, which is used to indicate the data length of the key and other data. The data length is considered to be computationally unbreakable and is set according to the actual encryption requirements. The embodiment of the present disclosure does not make any special restrictions on this. U is the complete set of user attribute information, U A The resource owns the second user attribute information set of the node. The number of the second user attribute information in the second user attribute information set may be one or more, and the embodiment of the present disclosure does not make any special requirements for this.

[0085] Among them, the attribute authorization node is determined from the resource sharing blockchain network according to the preset dynamic selection strategy. The shared node is selected as the attribute authorization node through the preset dynamic selection strategy to realize user identity registration and attribute authorization. While ensuring security, it does not require consensus of all nodes in the network, thereby improving authorization efficiency.

[0086] Furthermore, the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and identity public key to obtain the first-level ciphertext, which can be obtained through the following formula (2):

[0087] CT=Enc(M, S, PK A ) (2)

[0088] Among them, CT is the first-level ciphertext, M is the resource data plaintext, and PK A is the identity public key, S is the target user attribute structure, that is, the user attribute information with the sharing permission of the resource data plaintext M.

[0089] The resource-owning node of the exemplary embodiment of the present disclosure encrypts resource data plaintext according to the target user attribute structure and identity public key to obtain first-level ciphertext, and based on ciphertext sharing, it can protect the resource owner's ownership of the data.

[0090] In step S220, a re-encryption key is generated according to the identity public-private key pair and the target user attribute structure.

[0091] In an exemplary embodiment of the present disclosure, the resource-owning node may generate a re-encryption key according to preset target user attribute information and an identity public-private key pair.

[0092] Among them, at least one target user attribute information that meets the sharing requirements can be selected from the user attribute information corresponding to the target user attribute structure, and the re-encryption key can be generated according to the identity public-private key pair and the at least one target user attribute information. In other words, the resource-owning node can select part or all of the user attribute information corresponding to the target user attribute structure according to the actual resource sharing requirements, and generate the re-encryption key in combination with its own identity public-private key pair.

[0093] Exemplarily, generating a re-encryption key based on the public-private key pair and at least one target user attribute information can be implemented by the following formula (3):

[0094] RK=ReKeyGen(PK A , S.K. A , S') (3)

[0095] Among them, RK is the re-encryption key, PK A SK is the public key of the node that owns the resource. A is the identity private key of the resource owner node, and S' is at least one target user attribute information, that is, the user attribute information set corresponding to the re-encryption key. Among them, S' contains the user attribute information corresponding to S in formula (2).

[0096] Through the exemplary embodiments of the present disclosure, based on user attributes, the resource owning node does not need to generate re-encryption keys for different resource requesting nodes, but only needs to generate a unique re-encryption key based on its own public-private key pair and the target user attribute structure. Subsequently, it only needs to complete the re-encryption operation for the resource requesting node that meets the target user attribute information set by the resource owning node, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext, breaking the data resource barriers of different data holders, ensuring the security and robustness of ciphertext sharing, while reducing the key calculation cost and storage cost.

[0097] In step S230, the first-level ciphertext and the re-encryption key are uploaded to the resource sharing blockchain network to perform a re-encryption operation based on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node can decrypt the re-encrypted ciphertext and obtain the resource data plaintext.

[0098] In an exemplary embodiment of the present disclosure, a resource-owning node may send a resource-sharing request to a resource-sharing blockchain network, and complete the identity authentication of the resource-owning node in the resource-sharing blockchain network. The resource-sharing request may include identification information corresponding to the resource data plaintext, and the identification information is used to indicate the storage location of the resource data plaintext, and is used to subsequently obtain the resource data plaintext from the specified storage location based on the identification information, thereby avoiding the risk of leakage of the resource data plaintext.

[0099] Furthermore, after the resource sharing blockchain network completes the identity authentication of the resource-owning node, the resource-owning node uploads the first-level ciphertext and the re-encryption key to the resource sharing blockchain network. For example, by calling the smart contract of the resource sharing blockchain network to upload the first-level ciphertext and the re-encryption key to the resource sharing blockchain network, the resource sharing blockchain network then performs a re-encryption operation on the resource requesting node based on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node decrypts the re-encrypted ciphertext and obtains the resource data plaintext, wherein the first user attribute information of the resource requesting node satisfies the target user attribute structure.

[0100] In actual implementation, since the resource-owning node uploads to the resource-sharing blockchain network the first-level ciphertext and re-encryption key of the resource-owning node, through the re-encryption operation, the ciphertext that the resource-owning node can decrypt is allowed to be converted into another resource requesting node with a specified target user attribute structure preset by the resource-owning node (the first user attribute information of the resource requesting node satisfies the target user attribute structure.) The resource data ciphertext with the same resource data plaintext that can be decrypted, that is, the re-encrypted ciphertext, this process does not require the resource-owning node to generate different re-encryption keys according to different resource requesting nodes, but makes the re-encryption operation executed by the resource-sharing blockchain network, reducing the computational cost and storage pressure of the key, and also based on the resource-sharing blockchain network, reducing the risk of abuse of the re-encryption key, thereby ensuring the security of ciphertext sharing.

[0101] In an exemplary embodiment of the present disclosure, a method for implementing a resource sharing node to complete registration with a network is provided. Figure 3 A flowchart of resource sharing node registration according to an exemplary embodiment of the present disclosure is shown below. Figure 3 The registration process of the resource sharing node is described. The resource sharing node includes the resource owning node and the resource requesting node in the embodiment of the present disclosure.

[0102] Step S310: The resource sharing node submits a registration application to the resource sharing blockchain network, requesting user identity registration and user attribute information allocation.

[0103] After a resource sharing node requests user identity registration, an attribute authorization node can be determined from the resource sharing blockchain network according to a preset dynamic selection policy, so as to implement user identity registration of the resource sharing node based on the selected attribute authorization node. After completing the user identity registration, user attribute information is allocated to the resource sharing node, and an identity key pair of the resource sharing node is generated.

[0104] In actual implementation, the resource sharing blockchain network can determine an attribute authorization node from the nodes in the resource sharing blockchain network according to the selection probability of the nodes in the resource sharing blockchain network, network status information, and node credibility value.

[0105] Among them, according to the selection probability of the nodes in the resource sharing blockchain network, network status information, and node credibility value, the attribute authorization node can be determined from the nodes in the resource sharing blockchain network according to the following formula (4):

[0106] RandSel(P i ,S i ,C i ,n)(4)

[0107] Among them, i is used to identify the nodes in the resource sharing blockchain network, P i is the selection probability calculated according to the probability balance function Balance(pi, N) (0 < i ≤ N), N is the total number of nodes in the resource sharing blockchain network, S i is the network status information of the node, C i is the node credibility value, which is determined according to the node identity in the resource sharing blockchain network, and n is the number of selected nodes.

[0108] It should be noted that the selection probability is negatively correlated with the historical selection times of the node. That is, based on the probability balance function Balance(pi, N), the selection probability of the resource sharing node can be adjusted according to the participation situation (including historical selection times) in the resource sharing node attribute authorization consensus. Among them, the initial selection probability value of the resource sharing node can be p i = 1 / N (0 < i ≤ N). Of course, it can also be adjusted according to actual needs, and this disclosure embodiment does not make special limitations on this.

[0109] For example, if the selection times of the resource sharing node A in the most recent one or several user identity registrations are greater than those of the resource sharing node B, then in this user identity registration, the alternative probability of the resource sharing node A is less than that of the resource sharing node B, that is, more resource sharing nodes are used as attribute authorization nodes to improve the security of resource sharing.

[0110] The resource sharing blockchain network calculates the probability of each node being selected in the resource sharing blockchain network, and dynamically and randomly selects resource sharing nodes as attribute authorization nodes based on the network status information and node credibility of each node. Among them, the number of selected attribute authorization nodes is greater than N / 2, and the identity registration and user attribute information allocation of the corresponding resource sharing nodes are completed through the consensus of each attribute authorization node. While ensuring security, it reduces the time cost of node consensus in the resource sharing blockchain network and improves resource sharing efficiency.

[0111] Among them, usually in the distributed resource sharing transaction consensus method based on the resource sharing blockchain network, the entire new process of full node consensus usually includes the preparatory stage, the preparation stage and the confirmation stage. Under the full node consensus, in the resource sharing blockchain network with N consensus nodes, each round of data upload phase will select a node in the network as the master node, and the communication complexity of the entire data consensus method is O(N 2 ). Usually in the communication request phase, the data-owning node sends N-1 messages, in the pre-preparation phase, the master node sends (N-2) messages; in the preparation phase, all nodes except the data-owning node send a total of (N-2) 2 In the confirmation phase, nodes other than the data-owning node send a total of N (N-1) messages. In the reply phase, the data-owning node receives a total of (N-1) messages.

[0112] For the attribute authorization node of the embodiment of the present disclosure, according to the preset dynamic selection strategy, the attribute authorization node is selected from the N existing resource sharing nodes in the resource sharing blockchain network to complete the user identity registration and the allocation of user attribute information. The communication complexity of the consensus process is O(N 2 ).

[0113] Step S320: The resource sharing node completes user identity registration and obtains the identity public and private key pair.

[0114] Through the registration process of step S310 and step S320, each resource sharing node obtains its own user attribute information and public-private key pair.

[0115] Through the resource sharing method in the exemplary embodiment of the present disclosure, the resource data plaintext is encrypted through the target user attribute structure and the identity public key to protect the resource owner's ownership of the resource, and the resource-owning node does not need to generate a re-encryption key for different resource requesting nodes. It only needs to generate a unique re-encryption key according to its own public-private key pair and the target user attribute structure, and the re-encryption operation can only be completed for the resource requesting node that meets the target user attribute information set by the resource-owning node, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext, breaking the data resource barriers of different data holders, ensuring the security and robustness of ciphertext sharing, while reducing the key calculation cost and storage cost; and in the resource sharing process, there is no need for full-node consensus in the resource sharing blockchain network, saving time cost and improving resource sharing efficiency.

[0116] like Figure 4 A flow chart of a resource sharing method according to an embodiment of the present disclosure is shown, which is applied to a resource requesting node. Figure 4 As shown, the resource sharing method of the embodiment of the present disclosure may include step S410 and step S420:

[0117] In step S410, resource request information is sent to the resource sharing blockchain network.

[0118] In an exemplary embodiment of the present disclosure, the resource request information includes the first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext. The primary ciphertext is obtained by encrypting the resource data plaintext by the resource owning node according to the target user attribute structure and its own identity public key. The target user attribute structure is used to indicate the user attribute information with the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource owning node and the target user attribute structure.

[0119] Among them, the first user attribute information is assigned by the corresponding attribute authorization node when the resource request node completes registration with the resource sharing blockchain network, that is, the first user attribute information and identity public-private key pair assigned by the corresponding attribute authorization node are received, and the identity public-private key pair of the resource request node is generated based on the first user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network. The user identity registration and user attribute information allocation of the resource request node are as described in steps S310 to S320 above, which will not be repeated here.

[0120] In actual implementation, the resource requesting node sends a resource request transaction request to the resource sharing blockchain network. After the resource sharing blockchain network authenticates the resource requesting node, it completes the user attribute review based on the first user attribute information of the resource requesting node, that is, it reviews whether the first user attribute information of the resource requesting node meets the target user attribute structure set by the resource owning node.

[0121] When the first user attribute information satisfies the target user attribute structure set by the resource owning node, that is, the first user attribute information is included in the user attribute information corresponding to the target user attribute structure, the resource sharing blockchain network performs a re-encryption operation on the first-level ciphertext and re-encryption key of the resource owning node for the resource requesting node to generate a re-encrypted ciphertext.

[0122] In actual implementation, the re-encrypted ciphertext can be generated by re-encrypting the primary ciphertext and re-encryption key of the resource-owning node using the following formula (5):

[0123] CT*=ReEnc(PK A , CT , RK) (5)

[0124] Among them, CT* is the re-encrypted ciphertext, PK A The resource owns the public key of the node, CT is the first-level ciphertext, and RK is the re-encryption key.

[0125] Through the re-encryption operation, the ciphertext that can be decrypted by the resource owning node is allowed to be converted into resource data ciphertext with the same resource data plaintext that can be decrypted by another resource requesting node with a specified target user attribute structure preset by the resource owning node, that is, the re-encrypted ciphertext.

[0126] In step S420, the re-encrypted ciphertext is obtained, and the re-encrypted ciphertext is decrypted using its own identity private key to obtain the resource data plaintext.

[0127] After obtaining the re-encrypted ciphertext, the resource requesting node uses its own identity private key to decrypt it and obtain the plaintext of the resource data.

[0128] In actual implementation, the resource data plaintext can be obtained through the following formula (6):

[0129] MW=ReDec(CT* , SK B , U B ) (6)

[0130] Among them, MW is the plaintext of resource data, CT* is the re-encrypted ciphertext, and SK B The private key of the resource requesting node is generated by the attribute authorization node during the registration phase. BIt is the first user attribute information of the resource requesting node, which is allocated by the attribute authorization node during the registration phase. The first user attribute information satisfies the target user attribute information set by the resource owning node.

[0131] Since the specific details of each step of the resource sharing method applied to a resource requesting node of the exemplary embodiment of the present disclosure have been described in detail in the above-mentioned invention embodiment of the resource sharing method applied to a resource owning node, they will not be repeated here.

[0132] like Figure 5 A flow chart of a resource sharing method according to an embodiment of the present disclosure is shown, which is applied to a resource sharing blockchain network. Figure 5 As shown, the resource sharing method of the embodiment of the present disclosure may include step S510 and step S530:

[0133] In step 510, the receiving resource possesses the primary ciphertext and the re-encryption key uploaded by the node.

[0134] In an exemplary embodiment of the present disclosure, the first-level ciphertext is obtained by encrypting the resource data plaintext by the resource owning node according to the target user attribute structure and the identity public key. The target user attribute structure is used to indicate the user attribute information with the sharing authority of the resource data plaintext. The re-encryption key is generated according to the identity public-private key pair of the resource owning node and the target user attribute structure.

[0135] Among them, before receiving the first-level ciphertext and re-encryption key uploaded by the resource-owning node, a user identity registration request of the resource-owning node is received, and from the nodes in the resource sharing blockchain network, according to a preset dynamic selection strategy, the attribute authorization node corresponding to the resource-owning node is determined from each node, and the second user attribute information is allocated to the resource-owning node based on the attribute authorization node, and the identity key pair of the resource-owning node is generated based on the second user attribute information.

[0136] In step S520, based on the first user attribute information of the resource requesting node, a re-encryption operation is performed on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext.

[0137] In an exemplary embodiment of the present disclosure, resource request information sent by a resource requesting node is first received to obtain first user attribute information of the resource requesting node that satisfies a target user attribute structure from the resource requesting information, and a re-encryption operation is performed on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext.

[0138] For example, a smart contract may be called to re-encrypt the primary ciphertext and the re-encryption key according to the first user attribute information of the resource requesting node.

[0139] In step S530, the re-encrypted ciphertext is sent to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext.

[0140] During the entire resource sharing process, the resource sharing node generates a re-encryption key based on the target user attribute structure. The resource sharing blockchain network acts as an agent to implement the ciphertext sharing conversion of uplink and downlink data based on the user attribute information of the resource request node that meets the target user attribute structure, thereby preventing the abuse of the re-encryption key of the resource data ciphertext.

[0141] Since the specific details of each step of the resource sharing method applied to the resource sharing blockchain network of the exemplary embodiment of the present disclosure have been described in detail in the above-mentioned invention embodiment of the resource sharing method applied to the resource owning node, they will not be repeated here.

[0142] The resource sharing method of the embodiment of the present disclosure is applicable to various application scenarios involving multi-party resource sharing, such as distributed resource security access, cross-domain data transmission between different organizations, etc. Figure 6 The interactive diagram of the resource sharing method in the application scenario is shown below. Figure 6 The resource sharing method of the embodiment of the present disclosure is described.

[0143] Step S610: The resource-owning node submits a resource sharing request to the resource-sharing blockchain network.

[0144] Step S620: The resource-sharing blockchain network calls the smart contract to authenticate the identity of the resource-owning node.

[0145] Step S630: After the resource-owning node passes the identity authentication, the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain the first-level ciphertext, and generates a re-encryption key according to the identity public-private key pair and the target user attribute structure.

[0146] Step S640: The resource-owning node uploads the primary ciphertext and the re-encryption key to the resource-sharing blockchain network.

[0147] Correspondingly, as a resource requesting node, in step S650, resource request information is sent to the resource sharing blockchain network.

[0148] The resource request information includes first user attribute information of the resource request node that meets the target user attribute structure.

[0149] Step S660: The smart contract completes the attribute review of the resource requesting node based on the first user attribute information of the resource requesting node.

[0150] If the first user attribute information satisfies the target user attribute structure, a re-encryption operation is performed on the first-level ciphertext and the re-encryption key based on the first user attribute information of the resource requesting node to generate a re-encrypted ciphertext.

[0151] Step S670: The resource sharing blockchain network sends the re-encrypted ciphertext to the resource requesting node.

[0152] Step S680: The resource requesting node obtains the re-encrypted ciphertext, and uses its own identity private key to decrypt the re-encrypted ciphertext to obtain the resource data plaintext.

[0153] Through the above resource sharing process, based on dynamic random attribute-based re-encryption and decentralized resource sharing mechanism, the ownership of resources by resource owners is protected through ciphertext sharing, and there is no need to generate a large number of re-encryption keys for different data requesters, which reduces the key calculation cost and storage pressure. When realizing user identity registration and user attribute information allocation of shared resource nodes, the attribute authorization node of each resource sharing node is randomly and dynamically determined. While ensuring security, there is no need for all nodes in the network to reach a consensus, which reduces time costs and improves the efficiency of attribute allocation consensus. The trusted joining of members of the resource sharing blockchain network can be guaranteed through smart contract events, ensuring secure access and sharing of resources and preventing the risk of resource information leakage.

[0154] In addition, according to an exemplary embodiment of the present disclosure, a resource sharing device is also provided, which is applied to a resource-owning node, such as Figure 7 As shown, the device 700 includes:

[0155] The first encryption module 710 is used for the resource owner node to encrypt the resource data plaintext according to the target user attribute structure and the identity public key to obtain the first-level ciphertext, wherein the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext;

[0156] The second encryption module 720 is used to generate a re-encryption key according to the identity public-private key pair and the target user attribute structure;

[0157] The resource sharing module 730 is used to upload the first-level ciphertext and the re-encryption key to the resource sharing blockchain network, so as to perform a re-encryption operation based on the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext;

[0158] The first user attribute information of the resource requesting node satisfies the target user attribute structure.

[0159] In an exemplary embodiment of the present disclosure, the resource sharing device 700 may further include:

[0160] A registration module, configured to receive the second user attribute information and the identity public-private key pair assigned by the attribute authorization node when registering to the resource sharing blockchain network, wherein the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network;

[0161] Among them, the attribute authorization node is determined from the resource sharing blockchain network according to a preset dynamic selection strategy.

[0162] The attribute authorization node of the resource sharing device is determined from the nodes by the resource sharing blockchain network according to the selection probability of the nodes in the resource sharing blockchain network, the network status information, and the node credibility value;

[0163] Among them, the probability of being selected is negatively correlated with the number of times the node has been selected in the past, and the node credibility value is determined based on the node's node identity in the resource-sharing blockchain network.

[0164] In an exemplary embodiment of the present disclosure, the second encryption module 720 may include:

[0165] An information determination unit, configured to select at least one target user attribute information satisfying a sharing requirement from the user attribute information corresponding to the target user attribute structure;

[0166] The key generation unit is used to generate the re-encryption key according to the identity public-private key pair and at least one target user attribute information.

[0167] According to an exemplary embodiment of the present disclosure, a resource sharing device is also provided, which is applied to a resource requesting node, such as Figure 8 As shown, the device 800 includes:

[0168] The resource request module 810 is used to send resource request information to the resource sharing blockchain network, wherein the resource request information includes the first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and the re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext;

[0169] Decryption module 820, used to obtain the re-encrypted ciphertext, decrypt the re-encrypted ciphertext using its own identity private key, and obtain the resource data plaintext;

[0170] Among them, the first-level ciphertext is obtained by the resource-owning node encrypting the resource data plaintext according to the target user attribute structure and its own identity public key. The target user attribute structure is used to indicate the user attribute information with sharing authority of the resource data plaintext. The re-encryption key is generated based on the identity public-private key pair of the resource-owning node and the target user attribute structure.

[0171] According to an exemplary embodiment of the present disclosure, a resource sharing device is also provided, which is applied to a resource sharing blockchain network, such as Fig. 9 As shown, the device 900 includes:

[0172] The first resource processing module 910 is used to receive the first-level ciphertext and re-encryption key uploaded by the resource-owning node, where the first-level ciphertext is obtained by encrypting the resource data plaintext by the resource-owning node according to the target user attribute structure and the identity public key, the target user attribute structure is used to indicate the user attribute information with the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure;

[0173] The proxy re-encryption module 920 is used to perform a re-encryption operation on the first-level ciphertext and the re-encryption key based on the first user attribute information of the resource requesting node to generate a re-encrypted ciphertext;

[0174] The second resource processing module 930 is used to send the re-encrypted ciphertext to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext;

[0175] The first user attribute information satisfies the target user attribute structure.

[0176] Since the specific details of each functional module (unit) of the resource sharing device of the exemplary embodiment of the present disclosure have been described in detail in the inventive embodiment of the resource sharing method described above, they will not be repeated here.

[0177] It should be noted that although several modules or units of the resource sharing device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0178] In addition, in the exemplary embodiment of the present disclosure, a computer storage medium capable of implementing the above method is also provided. A program product capable of implementing the above method of this specification is stored thereon. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0179] The embodiment of the present disclosure also provides a program product for implementing the above method, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0180] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0181] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0182] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0183] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0184] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".

[0185] Refer to the following Fig.10 hereinafter describes the electronic device 1000 according to such an embodiment of the present disclosure. Fig.10 The electronic device 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0186] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), and a display unit 1040.

[0187] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0188] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1021 and / or a cache memory unit 1022 , and may further include a read-only memory unit (ROM) 1023 .

[0189] The storage unit 1020 may also include a program / utility 1024 having a set (at least one) of program modules 1025, such program modules 1025 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0190] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0191] The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or may communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0192] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0193] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0194] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A resource sharing method, characterized in that: Applies to resource owning nodes, including: The resource owner node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext; the target user attribute structure is set by the resource owner node; Generate a re-encryption key based on the public-private key pair and the target user attribute structure; Uploading the primary ciphertext and the re-encryption key to the resource sharing blockchain network to perform a re-encryption operation based on the primary ciphertext and the re-encryption key to generate a re-encrypted ciphertext, so that the resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext; Wherein, the first user attribute information of the resource requesting node satisfies the target user attribute structure; Before the resource-owning node encrypts the resource data plaintext according to the target user attribute structure and the identity public key to obtain the first-level ciphertext, the method further includes: When registering to the resource sharing blockchain network, receiving the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, wherein the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the selection probability, network status information, and node credibility of the nodes in the resource sharing blockchain network. The selection probability is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.

2. The method according to claim 1, characterized in that The generating a re-encryption key according to the identity public-private key pair and the target user attribute structure includes: Selecting at least one target user attribute information that meets the sharing requirement from the user attribute information corresponding to the target user attribute structure; The re-encryption key is generated according to the identity public-private key pair and the at least one target user attribute information.

3. A resource sharing method, characterized in that: Applicable to resource request nodes, including: Sending resource request information to the resource sharing blockchain network, wherein the resource request information includes first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext; the target user attribute structure is set by the resource owning node; Obtain the re-encrypted ciphertext, decrypt the re-encrypted ciphertext using its own identity private key, and obtain the resource data plaintext; Among them, the first-level ciphertext is obtained by the resource-owning node encrypting the resource data plaintext according to the target user attribute structure and its own identity public key, the target user attribute structure is used to indicate the user attribute information with the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure; wherein when the resource-owning node registers to the resource-sharing blockchain network, it receives the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, and the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource-sharing blockchain network; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the selection probability, network status information, and node credibility of the nodes in the resource sharing blockchain network. The selection probability is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.

4. The method according to claim 3, characterized in that Before sending the resource request information to the resource sharing blockchain network, the method further includes: When registering to the resource-sharing blockchain network, the first user attribute information and identity public-private key pair assigned by the corresponding attribute authorization node are received, and the identity public-private key pair is generated based on the first user attribute information and the user attribute information set of all nodes in the resource-sharing blockchain network.

5. A resource sharing method, characterized in that: Application resource sharing blockchain network, including: Receive a first-level ciphertext and a re-encryption key uploaded by a resource-owning node, wherein the first-level ciphertext is obtained by encrypting the resource data plaintext by the resource-owning node according to the target user attribute structure and the identity public key, the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure; wherein the resource-owning node receives the second user attribute information and the identity public-private key pair assigned by the attribute authorization node when registering to the resource-sharing blockchain network, and the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource-sharing blockchain network; the target user attribute structure is set by the resource-owning node; Based on the first user attribute information of the resource requesting node, re-encrypting the first-level ciphertext and the re-encryption key to generate a re-encrypted ciphertext; Sending the re-encrypted ciphertext to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext; Wherein, the first user attribute information satisfies the target user attribute structure; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the probability of being selected, network status information, and node credibility of the nodes in the resource sharing blockchain network. The probability of being selected is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.

6. A resource sharing device, characterized in that: Applies to resource owning nodes, including: A first encryption module is used for the resource-owning node to encrypt the resource data plaintext according to the target user attribute structure and the identity public key to obtain a first-level ciphertext, wherein the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext; A second encryption module, used to generate a re-encryption key according to the identity public-private key pair and the target user attribute structure; A resource sharing module, configured to upload the primary ciphertext and the re-encryption key to a resource sharing blockchain network, to perform a re-encryption operation based on the primary ciphertext and the re-encryption key, to generate a re-encrypted ciphertext, so that a resource requesting node can decrypt the re-encrypted ciphertext to obtain the resource data plaintext; Wherein, the first user attribute information of the resource requesting node satisfies the target user attribute structure; The second encryption module is configured to perform: When registering to the resource sharing blockchain network, receiving the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, wherein the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource sharing blockchain network; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the selection probability, network status information, and node credibility of the nodes in the resource sharing blockchain network. The selection probability is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.

7. A resource sharing device, characterized in that: Applicable to resource request nodes, including: A resource request module, configured to send resource request information to a resource sharing blockchain network, wherein the resource request information includes first user attribute information of the resource requesting node that satisfies the target user attribute structure, so that the resource sharing blockchain network performs a re-encryption operation on the primary ciphertext and the re-encryption key of the resource owning node based on the first user attribute information to generate a re-encrypted ciphertext; A decryption module is used to obtain the re-encrypted ciphertext, decrypt the re-encrypted ciphertext using its own identity private key, and obtain the resource data plaintext; Among them, the first-level ciphertext is obtained by the resource-owning node encrypting the resource data plaintext according to the target user attribute structure and its own identity public key, the target user attribute structure is used to indicate the user attribute information with the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure; wherein when the resource-owning node registers to the resource-sharing blockchain network, it receives the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, and the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource-sharing blockchain network; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the selection probability, network status information, and node credibility of the nodes in the resource sharing blockchain network. The selection probability is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.

8. A resource sharing device, characterized in that: Application resource sharing blockchain network, including: A first resource processing module is configured to receive a first-level ciphertext and a re-encryption key uploaded by a resource-owning node, wherein the first-level ciphertext is obtained by encrypting the resource data plaintext by the resource-owning node according to the target user attribute structure and the identity public key, the target user attribute structure is used to indicate the user attribute information having the sharing authority of the resource data plaintext, and the re-encryption key is generated according to the identity public-private key pair of the resource-owning node and the target user attribute structure; wherein when the resource-owning node is registered in the resource-sharing blockchain network, it receives the second user attribute information and the identity public-private key pair assigned by the attribute authorization node, and the identity public-private key pair is generated based on the second user attribute information and the user attribute information set of all nodes in the resource-sharing blockchain network; A proxy re-encryption module, configured to perform a re-encryption operation on the primary ciphertext and the re-encryption key based on the first user attribute information of the resource requesting node to generate a re-encrypted ciphertext; A second resource processing module is used to send the re-encrypted ciphertext to the resource requesting node, so that the resource requesting node decrypts the re-encrypted ciphertext to obtain the resource data plaintext; Wherein, the first user attribute information satisfies the target user attribute structure; The attribute authorization node is determined by the resource sharing blockchain network from the nodes in the resource sharing blockchain network according to the probability of being selected, network status information, and node credibility of the nodes in the resource sharing blockchain network. The probability of being selected is negatively correlated with the number of historical selections of the nodes in the resource sharing blockchain network. The node credibility is determined according to the node identity of the node in the resource sharing blockchain network. In addition, the number of the attribute authorization nodes is greater than N / 2, where N is the total number of nodes in the resource sharing blockchain network, and the identity registration of the resource owning node and the allocation of the second user attribute information are completed through consensus among the attribute authorization nodes.