CN116032475A - Data sharing method, system, equipment and computer readable storage medium - Google Patents

Data sharing method, system, equipment and computer readable storage medium Download PDF

Info

Publication number
CN116032475A
CN116032475A CN202211693833.1A CN202211693833A CN116032475A CN 116032475 A CN116032475 A CN 116032475A CN 202211693833 A CN202211693833 A CN 202211693833A CN 116032475 A CN116032475 A CN 116032475A
Authority
CN
China
Prior art keywords
ciphertext
data
encryption method
attribute
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211693833.1A
Other languages
Chinese (zh)
Inventor
刘亦哲
包森成
袁国平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Zhejiang Co Ltd
DBAPPSecurity Co Ltd
Original Assignee
China Mobile Group Zhejiang Co Ltd
DBAPPSecurity Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Group Zhejiang Co Ltd, DBAPPSecurity Co Ltd filed Critical China Mobile Group Zhejiang Co Ltd
Priority to CN202211693833.1A priority Critical patent/CN116032475A/en
Publication of CN116032475A publication Critical patent/CN116032475A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The application discloses a data sharing method, a system, equipment and a computer readable storage medium, which are applied to a data owner to acquire a target message to be shared; encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain a first ciphertext; encrypting the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to the blockchain for sharing; receiving a third ciphertext, verification information and a public key of the data user, which are sent by the data user; verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on a proxy re-encryption method, a public key of a data owner, a private key of the data owner and a public key of a data user; and the re-encryption key is transmitted to the data user, so that the data user obtains the target message based on the proxy re-encryption method, the re-encryption key, the public key of the data owner and the third ciphertext, and the applicability is good.

Description

Data sharing method, system, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technology, and more particularly, to a data sharing method, system, device, and computer readable storage medium.
Background
At present, users can share data based on requirements, such as mail transmission and manual entry and storage modes, however, the modes are easy to leak data, and meanwhile, unexpected operations can occur in the processes of sending mails, entering and the like by staff, so that auditing can not be realized. To avoid such problems, data may be shared based on the blockchain, during which a data provider uploads the data to be shared to the blockchain, through which the data requestor may access the shared data.
However, in the process of carrying out data sharing based on the blockchain, all parties in the blockchain alliance can read the data on the blockchain and cannot carry out fine-granularity access control, in order to solve the problem, the blockchain can be combined with attribute encryption to carry out data sharing based on the blockchain, the attribute encryption is a method for solving fine-granularity access control, but the method is similar to an authority center mechanism of CA, and has an absolute decryption capability on the encrypted data, and the authority center has an absolute decryption capability, so that the existing combined attribute encryption method for carrying out data sharing based on the blockchain has poor applicability because of the fact that the existing combined attribute encryption can be used for solving the fine-granularity access control of the blockchain data.
In view of the above, how to improve the applicability of the data sharing method is a problem to be solved by those skilled in the art.
Disclosure of Invention
The purpose of the application is to provide a data sharing method, which can solve the technical problem of how to improve the applicability of the data sharing method to a certain extent. The application also provides a data sharing system, a device and a computer readable storage medium.
In order to achieve the above object, the present application provides the following technical solutions:
a data sharing method applied to a data owner, comprising:
acquiring a target message to be shared;
encrypting the target message based on a proxy re-encryption method and a public key of the data owner to obtain a first ciphertext;
encrypting the first ciphertext based on an attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to a blockchain for sharing;
receiving a third ciphertext, verification information and a public key of a data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained by the data user after decrypting the second ciphertext based on the attribute encryption method;
Verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user;
and transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and the data user decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
Preferably, the encrypting the target message based on the proxy re-encrypting method and the public key of the data owner, before obtaining the first ciphertext, further includes:
acquiring an initial setting function of the proxy re-encryption method;
generating a public key of the data owner and a private key of the data owner based on the proxy re-encryption method and the initial setting function.
Preferably, the encrypting the first ciphertext based on the attribute-based encryption method to obtain a second ciphertext includes:
Determining an attribute access policy tree of the target message, and generating a first verification sequence of the target message;
and encrypting the first ciphertext based on the attribute encryption method, the attribute access policy tree and the first verification sequence to obtain the second ciphertext.
Preferably, the receiving the third ciphertext, the verification information, and the public key of the data user, where the third ciphertext and the verification information include ciphertext and information obtained after the data user decrypts the second ciphertext based on the attribute encryption method, includes:
and receiving a third ciphertext, a second verification sequence and a public key of the data user, wherein the third ciphertext and the second verification sequence are sent by the data user, the third ciphertext and the second verification sequence comprise ciphertext and sequences obtained by the data user after decrypting the second ciphertext based on the attribute encryption method and an attribute private key of the data user, and the attribute private key of the data user comprises a private key generated by processing the attribute of the data user based on the attribute encryption method.
Preferably, the verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information includes:
Judging whether the second verification sequence is consistent with the first verification sequence or not;
if the second verification sequence is consistent with the first verification sequence, judging that the third ciphertext is consistent with the first ciphertext;
and if the second verification sequence is inconsistent with the first verification sequence, judging that the third ciphertext is inconsistent with the first ciphertext.
Preferably, the encrypting the first ciphertext based on the attribute encryption method, the attribute access policy tree, and the first verification sequence to obtain the second ciphertext includes:
splicing the first verification sequence and the first ciphertext to obtain a splicing result;
and encrypting the splicing result based on the attribute encryption method and the attribute access strategy tree to obtain the second ciphertext.
A data sharing method is applied to a data user and comprises the following steps:
acquiring a second ciphertext from a blockchain, wherein the second ciphertext comprises a ciphertext obtained by encrypting a first ciphertext by a data owner based on an attribute encryption method and is uploaded to the blockchain by the data owner, and the first ciphertext comprises a ciphertext obtained by encrypting a target message by the data owner based on a proxy re-encryption method and a public key of the data owner;
Decrypting the second ciphertext based on the attribute encryption method to obtain a third ciphertext and verification information;
transmitting the third ciphertext, the verification information and the public key of the data user to the data owner, and generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user after verifying that the third ciphertext is consistent with the second ciphertext based on the verification information by the data owner;
receiving the re-encryption key transmitted by the data owner;
encrypting the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext;
and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
A data sharing system for use with a data owner, comprising:
the first acquisition module is used for acquiring a target message to be shared;
the first encryption module is used for encrypting the target message based on a proxy re-encryption method and a public key of the data owner to obtain a first ciphertext;
The second encryption module is used for encrypting the first ciphertext based on an attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to a blockchain for sharing;
the first receiving module is used for receiving a third ciphertext, verification information and a public key of the data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained after the data user decrypts the second ciphertext based on the attribute encryption method;
the first verification module is used for verifying whether the third ciphertext is consistent with the first ciphertext or not based on the verification information, and if so, generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user;
and the first transmission module is used for transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
A data sharing apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of any one of the data sharing methods described above when executing the computer program.
A computer readable storage medium having stored therein a computer program which when executed by a processor performs the steps of the data sharing method as described in any of the above.
The data sharing method is applied to a data owner and used for acquiring target information to be shared; encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain a first ciphertext; encrypting the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to the blockchain for sharing; receiving a third ciphertext and verification information sent by a data user and a public key of the data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained after the data user decrypts the second ciphertext based on an attribute encryption method; verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on a proxy re-encryption method, a public key of a data owner, a private key of the data owner and a public key of a data user; transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message. In the method, the data owner can process the target message based on the proxy re-encryption method and the attribute encryption method, generates the second ciphertext which can determine whether the target message can be shared based on the attribute and uploads the second ciphertext to the blockchain, and the data owner can generate the re-encryption key based on the proxy re-encryption method under the condition that the third ciphertext is verified to be consistent with the first ciphertext based on the verification information of the data user, so that the data user can decrypt the target message based on the re-encryption key, the centrality of an authorization center in the attribute encryption method is removed, and the attribute encryption method and the blockchain can be combined better, so that the applicability is good. The application provides a data sharing system, a device and a computer readable storage medium, which also solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of an attribute access policy tree;
fig. 2 is a flowchart of a data sharing method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data sharing system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data sharing device according to an embodiment of the present application;
fig. 5 is another schematic structural diagram of a data sharing device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
At present, users can share data based on requirements, such as mail transmission and manual entry and storage modes, however, the modes are easy to leak data, and meanwhile, unexpected operations can occur in the processes of sending mails, entering and the like by staff, so that auditing can not be realized. To avoid such problems, data may be shared based on the blockchain, during which a data provider uploads the data to be shared to the blockchain, through which the data requestor may access the shared data.
However, in the process of carrying out data sharing based on the blockchain, all parties in the blockchain alliance can read the data on the blockchain and cannot carry out fine-granularity access control, in order to solve the problem, the blockchain can be combined with attribute encryption to carry out data sharing based on the blockchain, the attribute encryption is a method for solving fine-granularity access control, but the method is similar to an authority center mechanism of CA, and has an absolute decryption capability on the encrypted data, and the authority center has an absolute decryption capability, so that the existing combined attribute encryption method for carrying out data sharing based on the blockchain has poor applicability because of the fact that the existing combined attribute encryption can be used for solving the fine-granularity access control of the blockchain data.
The data sharing method provided by the application can improve the applicability of the data sharing method by means of the proxy re-encryption method.
In order to facilitate understanding of the data sharing scheme provided in the present application, an existing attribute encryption method and proxy re-encryption method will now be described:
1. attribute encryption
The benchmark et al in 2007 proposed a cipherprop-Policy Attribute-Based Encryption (CP-ABE) mechanism, embedding access policies into Ciphertext and user attributes into keys, so that information owners could specify Ciphertext access policies, suitable for use in message distribution scenarios.
In general, access structures can be expressed using a tree structure, with the internal nodes of the tree representing AND, OR, threshold operations and the leaf nodes representing attributes. The tree structure described above may be referred to as an access tree. As shown in FIG. 1, the access tree W is constructed to indicate that employees satisfying { employee | belonging to A, belonging to the research and development department, having an enrollment time earlier than 2022.2.31 days } or { employee | belonging to B, belonging to the financial department } represent the authorization set. If the above condition is not satisfied, the unauthorized set is obtained.
The CP-ABE characterizes the user's credentials using attributes and the ciphertext access policy is formulated by the encryptor of the data to decide who can decrypt the ciphertext. In CP-ABE, the user's private key is associated with a series of attributes, which can only be decrypted if the user's attributes match the access structure of the ciphertext. In CP-ABE, the roles of the participants are determined by the attributes, thus defining an access structure to express the authorized set of attributes. The set in the access structure is the authorized set, and the set not in the access structure is the unauthorized set.
CP-ABE contains four basic algorithms: setup, encrypt, keyGen, decrypt.
Wherein ABE. Setup (1) k )->(MPK, MSK): only accept implicit security parameters as input, output publicParameters MPK and master key MSK;
abe. Encrypt (MPK, M, W) - > CT: inputting MPK, message M and access structure W, encrypting M to generate ciphertext CT;
ABE.KeyGen(MSK,L)->SK L : input master key MSK and attribute set L describing key, output private key SK L Wherein SK is L Determined by the attribute;
ABE.Decrypt(MPK,CT,SK L )->m: input public parameter MPK, ciphertext CT containing access structure W, and private key SK L It should be noted that the private key here is generated from the set of attributes L, and if L is able to satisfy W, then the CT is decrypted and the message M is returned.
To facilitate understanding, for example, based on the access tree W and the public parameter MPK as described in fig. 1, one uses CP-ABE to call encrypter (MPK, M, W) to Encrypt message M to obtain ciphertext CT, sends CT to all the company owners, zhang san possessory attribute l= { a company, research and development department, 2020.1.1 day on job }, then Zhang san attribute base key SK L Is able to decrypt CT to obtain message M, if the li four has attribute k= { a company, sales department, 2020.1.1 day on duty }, then the attribute base key SK of the li four K The CT cannot be decrypted to obtain the message M.
2. Proxy re-encryption method
The European cryptology of Blaze et al, 1998, proposed proxy re-encryption (PRE), introduced in connection with use field Jing Jinhang above, which generally consists of the following parts:
1)PRE.Setup(1 k )->pram: setting a function initially, and setting a working environment according to the safety parameters;
2) Pre, keygen (pram) - > (pk, sk): a key generation function for generating a public-private key pair of the participant;
3)PRE.ReKeyGen((pk o ,sk o ),pk u )->rk o->u : a conversion key generation function, the data owner uses its own public-private key pair (pk o ,sk o ) Public key pk of data user u Generating a proxy re-encrypted transformation key rk o->u
4)PRE.Encrypt(pk o ,m)->c o : encryption function, data owner using own public key pk o Encrypting the data, and the obtained ciphertext is called original ciphertext c o
5)PRE.ReEnc(c o ,rk o->u ,pk o) ->c u : re-encryption function using a transformation key rk o->u And public key pk o For original ciphertext c o Re-encrypting the obtained ciphertext to obtain a re-encrypted ciphertext c u The ciphertext is substantially equivalent to the public key pk of the user using the data u Encrypted plaintext;
6)PRE.Decrypt(c u ,sk u )->m: decryption function, data user uses own private key sk u Heavy encryption ciphertext c u And (5) decrypting to obtain a corresponding plaintext m.
Referring to fig. 2, fig. 2 is a flowchart of a data sharing method according to an embodiment of the present application.
The data sharing method provided by the embodiment of the application is applied to a data owner, and can comprise the following steps:
step S101: and obtaining the target message to be shared.
In practical application, the data owner may first obtain the target message m with sharing, and the type of the target message may be flexibly determined according to the actual needs, for example, the target message may be text, image, blacklist, etc., which is not specifically limited herein.
Step S102: and encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain a first ciphertext.
In practical application, after obtaining the target message to be shared, the data user may encrypt the target message with the proxy re-encryption method and the public key of the data owner to obtain the first ciphertext c o For example, an encryption method pre.encrypt (pk) of proxy re-encryption may be invoked o ,m)->c o Obtaining ciphertext c o Secure target message by proxy re-encryptionAnd (5) protecting.
In practical application, the data owner can also acquire an initial setting function pram of the proxy re-encryption method before encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain the first ciphertext; generating a public key of the data owner and a private key of the data owner based on a proxy re-encryption method, an initial set function, such as invoking PRE. Key Gen (pram) >(pk, sk) obtaining public key pk of data owner o Private key sk of data owner o . Correspondingly, the data user can also generate a public key of the data user and a private key of the data user based on the proxy re-encryption method and the initial setting function, such as invoking PRE.KeyGen (pram)>(pk, sk) obtaining public Key pk of data user u Private key sk of data user u
Step S103: encrypting the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to the blockchain for sharing.
In practical application, after encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain the first ciphertext, the data user can encrypt the first ciphertext based on the attribute encryption method to obtain the second ciphertext, and upload the second ciphertext to the blockchain for sharing, so that the subsequent data user can access the target message existing in the blockchain based on the attribute of the subsequent data user.
Step S104: and receiving a third ciphertext and verification information sent by the data user and a public key of the data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained after the data user decrypts the second ciphertext based on an attribute encryption method.
Step S105: and verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user.
In practical application, the data owner encrypts the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and sends the second ciphertextAfter the data owner sends the second ciphertext to the blockchain for sharing, the data user can acquire the second ciphertext from the blockchain, decrypt the second ciphertext based on the attribute encryption method to obtain a third ciphertext and verification information, and then send the third ciphertext and the verification information to the data owner so that the data owner verifies whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generates a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user, such as invoking a conversion key generation function PRE o ,sk o ),pk u )->rk o->u Generating a re-encryption key rk o->u
In practical application, the data owner encrypts the first ciphertext based on the attribute encryption method to obtain the second ciphertext, and can determine the attribute access policy tree W of the target message and generate a first verification sequence z of the target message; and encrypting the first ciphertext based on the attribute encryption method, the attribute access policy tree and the first verification sequence to obtain a second ciphertext. In a specific application scene, a data owner encrypts a first ciphertext based on an attribute encryption method, an attribute access strategy tree and a first verification sequence to obtain a second ciphertext, and can splice the first verification sequence and the first ciphertext to obtain a splicing result; encrypting the splicing result based on the attribute encryption method and the attribute access strategy tree to obtain a second ciphertext, for example, an ABE encryption method ABE. Encrypt (MPK, c) can be called o ||z,W)->CT pair c o And carrying out attribute encryption on the z to obtain a second ciphertext CT. It should be noted that, the abe.setup (1) k )->(MPK, MSK) method, generating public system parameter MPK, master key MSK, and publishing MPK, or PRE-initialization function PRE.setup (1) can be called in advance by key authorization center k )->pram is published so that the data user and data owner apply MPK, pram for corresponding operations when needed.
In a specific application scenario, the data owner receives the first data sent by the data userThe third ciphertext, the verification information and the public key of the data user can be received in the process of decrypting the second ciphertext by the data user based on the attribute encryption method to obtain the ciphertext and the information, the third ciphertext, the second verification sequence and the public key of the data user can be sent by the data user, the third ciphertext and the second verification sequence comprise the ciphertext and the sequence obtained by the data user after decrypting the second ciphertext by the data user based on the attribute encryption method and the attribute private key of the data user, and the attribute private key of the data user comprises the private key generated by processing the attribute of the data user based on the attribute encryption method. That is, the data user can call ABE. KeyGen (MSK, L) >The SKL method generates an attribute private key of the data user based on its own attributes and invokes abe. Decrypt (MPK, CT, SK) L )->M decrypts, if the attribute L accords with the attribute access policy tree W, the data user can successfully decrypt to obtain the second ciphertext c o If the attribute L does not accord with the attribute access policy tree W, the data user fails to decrypt, and the data sharing flow can be directly ended.
In a specific application scenario, in the process of verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, the data owner can judge whether the second verification sequence is consistent with the first verification sequence; if the second verification sequence is consistent with the first verification sequence, judging that the third ciphertext is consistent with the first ciphertext; if the second verification sequence is inconsistent with the first verification sequence, the third ciphertext is inconsistent with the first ciphertext.
Step S106: transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
In practical application, the data owner verifies whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, the data owner re-encrypts the third ciphertext based on the proxyAfter the re-encryption key is generated, the data owner's public key, the data owner's private key and the data user's public key, the re-encryption key can be transmitted to the data user, and accordingly, the data user can encrypt the third ciphertext based on the proxy re-encryption method, the re-encryption key and the data owner's public key to obtain a fourth ciphertext, for example, pre.reenc (co, rk) o->u ,pk o )->c u Obtain the fourth ciphertext c u And the fourth ciphertext can be decrypted based on the proxy re-encryption method and the private key of the data user to obtain the target message, for example, the PRE decryption method PRE u ,sk u )->m to input sk u Pair c u And decrypting to obtain a plaintext m.
It should be noted that, the target message is subjected to proxy re-encryption and attribute encryption, and the target message is also required to be decrypted twice, so that the attribute encryption ensures that the data user can decrypt CT to obtain correct co and z only by meeting the data access mechanism set by the data owner, and only has correct z, and proves that the attribute access strategy is met to the data owner, the data owner can return the re-encryption key rko- > u, and can convert co into cu only by using the private key of the data owner and the re-encryption key rko- > u matched with the private key, so that the data user can decrypt the data by using the private key sku to obtain the original data m, and secure sharing of the target message is ensured. In addition, the ciphertext data is stored on the blockchain, so that the non-tamper property of the data is ensured, the problem of fine granularity access of the data is solved by attribute encryption, but the problem of overlarge authority of an ABE key authorization center is left, and the proxy re-encryption is used for secondary encryption so that a data owner still keeps the authorization and verification capability of the data, and when the data owner does not wish to continuously provide the data to the network, the process can be exited at any time to destroy related keys.
After researching the prior attribute encryption method, it is known that in the CP-ABE system, there is a key Authority center Authority, the key Authority center executes the prior Setup (,) method and the KeyGen (MK, L) method, the architecture runs counter to the de-centering idea of the blockchain technology, the key Authority center has absolute decryption capability on the encrypted data, and the direct use of attribute encryption to solve the fine-grained access control of the blockchain data may leave a potential safety hazard. The data sharing method provided by the application is applied to a data owner to acquire the target message to be shared; encrypting the target message based on the proxy re-encryption method and the public key of the data owner to obtain a first ciphertext; encrypting the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to the blockchain for sharing; receiving a third ciphertext and verification information sent by a data user and a public key of the data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained after the data user decrypts the second ciphertext based on an attribute encryption method; verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on a proxy re-encryption method, a public key of a data owner, a private key of the data owner and a public key of a data user; transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message. In the method, the data owner can process the target message based on the proxy re-encryption method and the attribute encryption method, generates the second ciphertext which can determine whether the target message can be shared based on the attribute and uploads the second ciphertext to the blockchain, and the data owner can generate the re-encryption key based on the proxy re-encryption method under the condition that the third ciphertext is verified to be consistent with the first ciphertext based on the verification information of the data user, so that the data user can decrypt the target message based on the re-encryption key, the centrality of an authorization center in the attribute encryption method is removed, and the attribute encryption method and the blockchain can be combined better, so that the applicability is good.
The data sharing method provided by the embodiment of the application is applied to a data user, and can comprise the following steps:
acquiring a second ciphertext from the blockchain, wherein the second ciphertext comprises a ciphertext obtained by encrypting a first ciphertext by a data owner based on an attribute encryption method and is uploaded to the blockchain by the data owner, and the first ciphertext comprises a ciphertext obtained by encrypting a target message by the data owner based on a proxy re-encryption method and a public key of the data owner;
decrypting the second ciphertext based on the attribute encryption method to obtain a third ciphertext and verification information;
transmitting the third ciphertext, the verification information and the public key of the data user to the data owner, and generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user after verifying that the third ciphertext is consistent with the second ciphertext based on the verification information by the data owner;
receiving a re-encryption key transmitted by a data owner;
encrypting the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext;
and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
The corresponding description of the data sharing method applied to the data user provided in the embodiment of the present application may refer to the above embodiment, and is not repeated herein.
In order to facilitate understanding of the data sharing method provided in the present application, the data sharing method provided in the present application will now be described in connection with a blacklist sharing process, and may include the following steps:
the blacklist sharing participants participate in the co-building of the alliance chain, and an interaction module in the blockchain provides two views of a data user and a data user for each party;
the blacklist provider submits blacklist data to be shared through the interaction module, wherein the blacklist data can comprise blacklist introduction, blacklist field names, blacklist content and the like, the blacklist content is ciphertext, and the secret key is managed by the provider;
the interaction module data uploading operation triggers the contract module to deploy contracts and executes a constructor data registration method, wherein the constructor data registration method includes the steps of inputting parameters such as a current blacklist label (unique), a blacklist brief introduction, a blacklist field, content and the like;
other participants in the alliance can issue blacklist data through notices or data owners, and acquire blacklist introduction information by calling a contract data checking method;
If the data user needs to access the data, submitting an access application operation through an interaction module, and synchronously triggering and calling a contract module by a platform to execute an access application method, wherein the input parameters of the method are the address of the data user, a request blacklist label, a request field, a data decryption key attribute (such as A company, research and development department, 2022, 31 days before), and the like;
the data user acquires the request notification of the data user through platform message pushing and log subscription;
the data owner carries out access authorization management on the request, and triggers an access authorization method of the contract module, wherein the method is only called by a contract deployment party, and input parameters are a data tag, a requester id, whether authorization is carried out, an authorization field and the like;
the data owner invokes the strategy management service of the password module to process the attribute of the data user and generate an access strategy tree of the data corresponding to the current tag;
the policy management service generates rules of policies as follows: policies can cover visitor attributes. The access attribute of the data request party A is 'A company', 'research and development department', '2022 2, 31 days ago', and the access attribute of the data request party B is 'B company', 'financial department'; the access attribute provided by the data request party B is 'C company', 'financial department', and the generated strategy is 'A company and research and development department and 2022, 31 day before 2 month or C company and financial department' after approval and no access right of the B company;
The data owner invokes a cryptographic module for encrypting the blacklist data based on the proxy re-encryption method and the public key of the data owner to obtain a first ciphertext; encrypting the first ciphertext based on the attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to the blockchain for sharing;
the cryptographic module generates an attribute private key of a data user according to the user request attribute, and generates a key according to the attribute of the company A, the research and development department and the attribute of the <20220232 when the access attribute of the data requester A is 'company A', 'research and development department', '2022 month 2 day before 31', and distributes the key through a secure channel;
the data user calls a password module to decrypt the second ciphertext based on the third ciphertext and verification information obtained after the attribute encryption method, and according to the attribute encryption algorithm, only a secret key with the attribute meeting the ciphertext policy is known, and the user can decrypt the data, otherwise, the decryption fails;
the data owner verifies whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, a re-encryption key is generated based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user;
The data owner transmits the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and the data user decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain blacklist data;
it should be noted that, the operation logs of uploading, accessing application, authorizing, accessing and the like of the data are all uplink, so that the tamper-proof is ensured, and the method can be used for tracing.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a data sharing system according to an embodiment of the present application.
The data sharing system provided in the embodiment of the application is applied to a data owner, and may include:
a first obtaining module 101, configured to obtain a target message to be shared;
a first encryption module 102, configured to encrypt the target message based on a proxy re-encryption method and a public key of a data owner, to obtain a first ciphertext;
the second encryption module 103 is configured to encrypt the first ciphertext based on an attribute encryption method to obtain a second ciphertext, and upload the second ciphertext to the blockchain for sharing;
the first receiving module 104 is configured to receive a third ciphertext and verification information sent by the data user, and a public key of the data user, where the third ciphertext and the verification information include ciphertext and information obtained by the data user after decrypting the second ciphertext based on the attribute encryption method;
The first verification module 105 is configured to verify whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generate a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner, and the public key of the data user;
the first transmission module 106 is configured to transmit the re-encryption key to the data user, so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key, and the public key of the data owner to obtain a fourth ciphertext, and decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
The description of the corresponding modules in the data sharing system provided in the embodiment of the present application may refer to the above embodiment, and will not be repeated herein.
The application also provides a data sharing device and a computer readable storage medium, which have the corresponding effects of the data sharing method provided by the embodiment of the application. Referring to fig. 4, fig. 4 is a schematic structural diagram of a data sharing device according to an embodiment of the present application.
The data sharing device provided in the embodiments of the present application includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the steps of the data sharing method described in any of the embodiments above when executing the computer program.
Referring to fig. 5, another data sharing device provided in an embodiment of the present application may further include: an input port 203 connected to the processor 202 for transmitting an externally input command to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing communication between the data sharing device and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; communication means employed by the communication module 205 include, but are not limited to, mobile high definition link technology (HML), universal Serial Bus (USB), high Definition Multimedia Interface (HDMI), wireless connection: wireless fidelity (WiFi), bluetooth communication, bluetooth low energy communication, ieee802.11s based communication.
The embodiment of the application provides a computer readable storage medium, in which a computer program is stored, where the computer program when executed by a processor implements the steps of the data sharing method described in any of the embodiments above.
The computer readable storage medium referred to in this application includes Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The description of the relevant parts in the data sharing system, the data sharing device and the computer readable storage medium provided in the embodiments of the present application refers to the detailed description of the corresponding parts in the data sharing method provided in the embodiments of the present application, and will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data sharing, applied to a data owner, comprising:
acquiring a target message to be shared;
encrypting the target message based on a proxy re-encryption method and a public key of the data owner to obtain a first ciphertext;
encrypting the first ciphertext based on an attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to a blockchain for sharing;
receiving a third ciphertext, verification information and a public key of a data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained by the data user after decrypting the second ciphertext based on the attribute encryption method;
Verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information, and if so, generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user;
and transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and the data user decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
2. The method of claim 1, wherein the encrypting the target message based on the proxy re-encryption method and the public key of the data owner, prior to obtaining the first ciphertext, further comprises:
acquiring an initial setting function of the proxy re-encryption method;
generating a public key of the data owner and a private key of the data owner based on the proxy re-encryption method and the initial setting function.
3. The method according to claim 2, wherein encrypting the first ciphertext based on the attribute-based encryption method to obtain a second ciphertext comprises:
determining an attribute access policy tree of the target message, and generating a first verification sequence of the target message;
and encrypting the first ciphertext based on the attribute encryption method, the attribute access policy tree and the first verification sequence to obtain the second ciphertext.
4. The method according to claim 3, wherein the receiving the third ciphertext transmitted by the data user, the authentication information, and the public key of the data user, the third ciphertext, the authentication information including ciphertext and information obtained by the data user decrypting the second ciphertext based on the attribute encryption method, includes:
and receiving a third ciphertext, a second verification sequence and a public key of the data user, wherein the third ciphertext and the second verification sequence are sent by the data user, the third ciphertext and the second verification sequence comprise ciphertext and sequences obtained by the data user after decrypting the second ciphertext based on the attribute encryption method and an attribute private key of the data user, and the attribute private key of the data user comprises a private key generated by processing the attribute of the data user based on the attribute encryption method.
5. The method of claim 4, wherein verifying whether the third ciphertext is consistent with the first ciphertext based on the verification information comprises:
judging whether the second verification sequence is consistent with the first verification sequence or not;
if the second verification sequence is consistent with the first verification sequence, judging that the third ciphertext is consistent with the first ciphertext;
and if the second verification sequence is inconsistent with the first verification sequence, judging that the third ciphertext is inconsistent with the first ciphertext.
6. The method of claim 3, wherein encrypting the first ciphertext based on the attribute encryption method, the attribute access policy tree, and the first authentication sequence to obtain the second ciphertext comprises:
splicing the first verification sequence and the first ciphertext to obtain a splicing result;
and encrypting the splicing result based on the attribute encryption method and the attribute access strategy tree to obtain the second ciphertext.
7. A data sharing method, applied to a data user, comprising:
acquiring a second ciphertext from a blockchain, wherein the second ciphertext comprises a ciphertext obtained by encrypting a first ciphertext by a data owner based on an attribute encryption method and is uploaded to the blockchain by the data owner, and the first ciphertext comprises a ciphertext obtained by encrypting a target message by the data owner based on a proxy re-encryption method and a public key of the data owner;
Decrypting the second ciphertext based on the attribute encryption method to obtain a third ciphertext and verification information;
transmitting the third ciphertext, the verification information and the public key of the data user to the data owner, and generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user after verifying that the third ciphertext is consistent with the second ciphertext based on the verification information by the data owner;
receiving the re-encryption key transmitted by the data owner;
encrypting the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext;
and decrypting the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
8. A data sharing system for application to a data owner, comprising:
the first acquisition module is used for acquiring a target message to be shared;
the first encryption module is used for encrypting the target message based on a proxy re-encryption method and a public key of the data owner to obtain a first ciphertext;
The second encryption module is used for encrypting the first ciphertext based on an attribute encryption method to obtain a second ciphertext, and uploading the second ciphertext to a blockchain for sharing;
the first receiving module is used for receiving a third ciphertext, verification information and a public key of the data user, wherein the third ciphertext and the verification information comprise ciphertext and information obtained after the data user decrypts the second ciphertext based on the attribute encryption method;
the first verification module is used for verifying whether the third ciphertext is consistent with the first ciphertext or not based on the verification information, and if so, generating a re-encryption key based on the proxy re-encryption method, the public key of the data owner, the private key of the data owner and the public key of the data user;
and the first transmission module is used for transmitting the re-encryption key to the data user so that the data user encrypts the third ciphertext based on the proxy re-encryption method, the re-encryption key and the public key of the data owner to obtain a fourth ciphertext, and decrypts the fourth ciphertext based on the proxy re-encryption method and the private key of the data user to obtain the target message.
9. A data sharing apparatus, comprising:
a memory for storing a computer program;
processor for implementing the steps of the data sharing method according to any of claims 1 to 7 when executing said computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the data sharing method according to any of claims 1 to 7.
CN202211693833.1A 2022-12-28 2022-12-28 Data sharing method, system, equipment and computer readable storage medium Pending CN116032475A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211693833.1A CN116032475A (en) 2022-12-28 2022-12-28 Data sharing method, system, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211693833.1A CN116032475A (en) 2022-12-28 2022-12-28 Data sharing method, system, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116032475A true CN116032475A (en) 2023-04-28

Family

ID=86073550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211693833.1A Pending CN116032475A (en) 2022-12-28 2022-12-28 Data sharing method, system, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116032475A (en)

Similar Documents

Publication Publication Date Title
CN109040045B (en) Cloud storage access control method based on ciphertext policy attribute-based encryption
CN110855671B (en) Trusted computing method and system
US20140325225A1 (en) Self-authenticated method with timestamp
CN111371790B (en) Data encryption sending method based on alliance chain, related method, device and system
US20140208117A1 (en) Server apparatus and program
CN103973736A (en) Data sharing method and device
CN112532580B (en) Data transmission method and system based on block chain and proxy re-encryption
CN113901512B (en) Data sharing method and system
CN114513327B (en) Block chain-based Internet of things private data rapid sharing method
KR100981419B1 (en) Method of joining in a user domain, and method of exchanging information therein
CN108809936B (en) Intelligent mobile terminal identity verification method based on hybrid encryption algorithm and implementation system thereof
CN113225302B (en) Data sharing system and method based on proxy re-encryption
CN113868684A (en) Signature method, device, server, medium and signature system
CN102055766A (en) Webservice service management method and system
CN113612608A (en) Method and system for realizing cluster encryption of dual-mode interphone based on public network
CN115396096A (en) Encryption and decryption method and protection system for secret file based on national cryptographic algorithm
CN114154181A (en) Privacy calculation method based on distributed storage
CN113365264B (en) Block chain wireless network data transmission method, device and system
CN110611679A (en) Data transmission method, device, equipment and system
CN112966280A (en) Data processing method and device, server and data management system
CN112149184A (en) Block chain external storage system and method based on time-limited access
US11979491B2 (en) Transmission of secure information in a content distribution network
CN100561913C (en) A kind of method of access code equipment
CN111431880B (en) Information processing method and device
CN116032475A (en) Data sharing method, system, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination