Data encryption method, data decryption method and system

By introducing carbon emission data management center, multiple attribute authority, blockchain and edge servers into the carbon emission system, combined with the CP-ABE technology and hash function hidden by completely policy, the shortcomings of traditional CP-ABE solutions in access control and key hosting are solved, and higher security and flexibility are achieved.

CN119814288APending Publication Date: 2025-04-11NORTHWEST NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411841760.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Traditional CP-ABE schemes have problems with access control and key custody, such as user privacy information leakage, control of key custodians and security of user private keys, and the challenge of revoking private keys when a user leaves or changes in permissions.

Method used

By introducing the Carbon Emission Data Management Center and multiple attribute authoritative organizations, using blockchain and edge servers, combining the CP-ABE technology and hash functions that are completely hidden by the policy, data encryption and decryption are implemented to ensure the privacy of the access policy and the security of the keys.

Benefits of technology

It reduces the risk of users' trust in a single entity, improves the flexibility and scalability of the system, supports large-scale attributes and user management, protects the privacy and security of data users, and improves the efficiency and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814288A_ABST
    Figure CN119814288A_ABST
Patent Text Reader

Abstract

The invention provides a data encryption method and system and a data decryption method and system. The data encryption method comprises the steps that a carbon emission data management center issues system public parameters and public keys of a carbon emission system; the plurality of attribute authoritative institutions determine the institution public keys of the plurality of attribute authoritative institutions according to the system public parameters, the enterprise terminal encrypts the to-be-encrypted data based on the public key, the institution public key and a preset carbon emission data access strategy to obtain an encrypted ciphertext, the enterprise terminal generates a shared transaction of the encrypted ciphertext, and the shared transaction is sent to the enterprise terminal. And the enterprise side encrypts the shared transaction, transmits the shared transaction to the block chain, and transmits the encrypted ciphertext to the edge server under the condition that the block chain verifies the shared transaction successfully, so that the edge server stores the encrypted ciphertext. The trust risk is reduced, large-scale attribute and user management can be supported, and the flexibility and expansibility of a carbon emission system are improved. In addition, privacy protection safety is improved, and efficiency and safety of a carbon emission system are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data security technology, and in particular to a data encryption method, a data decryption method and a system. Background Art

[0002] Carbon emissions have become a global challenge. Global warming has led to frequent extreme weather events, such as floods, droughts, and hurricanes, which have had a serious impact on human life and the global economy. Traditional carbon emissions have problems such as data leakage, data tampering, lack of trust, and potential data sharing security.

[0003] Ciphertext-Policy Attribute-Based Encryption (CP-ABE) is a type of Attribute-Based Encryption (ABE) and is a more effective access control mechanism for protecting data confidentiality.

[0004] In CP-ABE, the data owner (DO) uses the access structure formed by the access policy to encrypt the shared data, and the data user (DU) uses the private key generated by the attributes to decrypt it. The data owner can also be called the enterprise end, and the data user can also be called the user end.

[0005] Although CP-ABE protects the credibility of data and provides fine-grained access control, there are still some shortcomings. For example, in terms of access control, the traditional CP-ABE scheme sends the access structure corresponding to the policy together with the ciphertext. This practice allows anyone who can access the ciphertext to obtain the attribute information of the user through the explicit access structure, which may involve some sensitive information of the user and cause the leakage of the user's privacy information; in terms of key custody, the authorization center is responsible for generating and distributing the user's private key, which means that it has control over the user's private key. If the key custodian is attacked or fails, the user's private key may be leaked or lost, threatening the security of the entire carbon emission system and the privacy of the user. In addition, how to effectively revoke the user's private key when the user leaves or changes authority is also a challenge. Therefore, the key custody problem limits the application of the traditional CP-ABE scheme in some security-sensitive scenarios.

[0006] The content of the background technology section is only the information known to the inventor personally, and does not mean that the above information has entered the public domain before the application date of this disclosure, nor does it mean that it can become the prior art of the present disclosure. Summary of the invention

[0007] The present disclosure provides a data encryption method, a data decryption method and a system to solve at least one of the above technical problems.

[0008] In a first aspect, the present disclosure provides a data encryption method, which is applied to a data encryption system, wherein the data encryption system includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and an enterprise end having data to be encrypted, wherein the multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields; the method includes:

[0009] The carbon emission data management center publishes system public parameters and public keys of the carbon emission system;

[0010] The multiple attribute authorities determine the agency public keys of the multiple attribute authorities according to the system public parameters;

[0011] The enterprise end encrypts the data to be encrypted based on the public key, the institution public key, and a preset carbon emission data access policy to obtain an encrypted ciphertext, wherein the access policy is used to characterize access permission information for allowing or prohibiting access to the data to be encrypted;

[0012] The enterprise end generates a shared transaction of the encrypted ciphertext, and transmits the shared transaction to the blockchain;

[0013] When the blockchain verifies the shared transaction and the verification is passed, the enterprise end transmits the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext.

[0014] In some embodiments, the access policy includes a plurality of sub-policies; the enterprise end encrypts the data to be encrypted based on the public key, the institution public key, and the preset carbon emission data access policy to obtain the encrypted ciphertext, including:

[0015] Randomly selecting a vector according to the system common parameters;

[0016] determining an encryption index of the data to be encrypted according to the random selection vector, and assigning a weight to each of the plurality of sub-strategies according to the random selection vector;

[0017] The data to be encrypted is encrypted according to the encryption index, the public key, the institution public key, and the weight of each sub-strategy to obtain the encrypted ciphertext.

[0018] In some embodiments, the enterprise end generates a shared transaction of the encrypted ciphertext, including:

[0019] The enterprise end calculates a message digest and a message signature based on a hash function, generates the shared transaction according to the message digest and the message signature, and generates a unique identifier for the shared transaction.

[0020] In a second aspect, the present disclosure provides a data decryption method, which is applied to a data decryption system, wherein the data decryption system includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and a user end that needs to obtain decrypted data, wherein the multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields, and the enterprise end encrypts the data to be encrypted to obtain an encrypted ciphertext; the method includes:

[0021] The user terminal generates a conversion key corresponding to the encrypted ciphertext, and transmits the conversion key to the edge server;

[0022] The edge server generates a shared transaction corresponding to the conversion key, and transmits the shared transaction to the blockchain, so as to store the conversion key when the blockchain successfully verifies the shared transaction;

[0023] The user terminal generates a smart contract transaction corresponding to the encrypted ciphertext, and obtains part of the ciphertext based on the smart contract transaction to verify the access rights before decryption;

[0024] If the smart contract transaction verification passes, the edge server semi-decrypts the encrypted ciphertext according to the conversion key, and sends the obtained semi-decrypted ciphertext to the user terminal;

[0025] The user terminal decrypts the semi-decrypted ciphertext to obtain plaintext.

[0026] In some embodiments, the client generates a conversion key corresponding to the encrypted ciphertext, including:

[0027] Obtaining private keys from the carbon emission data management center and the plurality of attribute authority agencies respectively;

[0028] A complete private key is determined according to the obtained two-part private key, and the conversion key is generated according to the complete private key and the randomly selected outsourcing parameter.

[0029] In some embodiments, the edge server generates a shared transaction corresponding to the conversion key, including:

[0030] Determining a message digest and a hash value of the conversion key;

[0031] Signing the message digest using the signature private key of the edge server;

[0032] The shared transaction is constructed according to the conversion key, the conversion key hash value, the edge server signature, and the edge server identifier.

[0033] In some embodiments, the method further comprises:

[0034] If the target attribute of the user terminal is revoked or changed, the edge server reconstructs the shared transaction;

[0035] The edge server transmits the reconstructed shared transaction to the blockchain so that the blockchain verifies the reconstructed shared transaction, wherein if the verification is passed, the state of the conversion key of the target attribute is a revoked state.

[0036] In some embodiments, the user terminal decrypts the semi-decrypted ciphertext to obtain plaintext, including:

[0037] Determining a plaintext and a message digest according to the outsourcing parameters and the semi-decrypted ciphertext;

[0038] According to the message digest determined based on the semi-decrypted ciphertext and the preset index mapping relationship, the interactive information corresponding to the plaintext is queried from the blockchain to verify the correctness of the decryption, thereby obtaining the correct plaintext.

[0039] In a third aspect, the present disclosure provides a data encryption system, which includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and an enterprise end having data to be encrypted, wherein the multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields; wherein,

[0040] The carbon emission data management center is used to publish system public parameters and public keys of the carbon emission system;

[0041] The multiple attribute authorities are used to determine the agency public keys of the multiple attribute authorities according to the system public parameters;

[0042] The enterprise end is used to encrypt the data to be encrypted based on the public key, the institution public key, and a preset carbon emission data access policy to obtain an encrypted ciphertext, wherein the access policy is used to characterize access permission information for allowing or prohibiting access to the data to be encrypted;

[0043] The enterprise end is further used to generate a shared transaction of the encrypted ciphertext and transmit the shared transaction to the blockchain;

[0044] When the blockchain is used to verify the shared transaction and the verification is passed, the enterprise end is also used to transmit the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext.

[0045] In some embodiments, the access policy includes a plurality of sub-policies; the enterprise end is specifically used to:

[0046] Randomly selecting a vector according to the system common parameters;

[0047] determining an encryption index of the data to be encrypted according to the random selection vector, and assigning a weight to each of the plurality of sub-strategies according to the random selection vector;

[0048] The data to be encrypted is encrypted according to the encryption index, the public key, the institution public key, and the weight of each sub-strategy to obtain the encrypted ciphertext.

[0049] In some embodiments, the enterprise end is specifically used to calculate a message digest and a message signature based on a hash function, and generate the shared transaction according to the message digest and the message signature, and generate a unique identifier for the shared transaction.

[0050] In a fourth aspect, the present disclosure provides a data decryption system, which includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and a user end that needs to obtain decrypted data, wherein the multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields, and the enterprise end encrypts the encrypted data to obtain an encrypted ciphertext; wherein,

[0051] The user terminal is used to generate a conversion key corresponding to the encrypted ciphertext, and transmit the conversion key to the edge server;

[0052] The edge server is used to generate a shared transaction corresponding to the conversion key, and transmit the shared transaction to the blockchain, so as to store the conversion key when the blockchain successfully verifies the shared transaction;

[0053] The user terminal is also used to generate a smart contract transaction corresponding to the encrypted ciphertext, and obtain part of the ciphertext based on the smart contract transaction to verify the access rights before decryption;

[0054] If the smart contract transaction verification passes, the edge server is used to semi-decrypt the encrypted ciphertext according to the conversion key, and send the obtained semi-decrypted ciphertext to the user terminal;

[0055] The user terminal is also used to decrypt the semi-decrypted ciphertext to obtain plaintext.

[0056] In some embodiments, the user terminal is specifically used to obtain private keys from the carbon emission data management center and the multiple attribute authority agencies respectively;

[0057] A complete private key is determined according to the obtained two-part private key, and the conversion key is generated according to the complete private key and the randomly selected outsourcing parameter.

[0058] In some embodiments, the edge server is specifically used to:

[0059] Determining a message digest and a hash value of the conversion key;

[0060] Signing the message digest using the signature private key of the edge server;

[0061] The shared transaction is constructed according to the conversion key, the conversion key hash value, the edge server signature, and the edge server identifier.

[0062] In some embodiments, if the target attribute of the user terminal is revoked or changed, the edge server is further used to reconstruct the sharing transaction;

[0063] The edge server is further used to transmit the reconstructed shared transaction to the blockchain so that the blockchain verifies the reconstructed shared transaction, wherein if the verification is passed, the state of the conversion key of the target attribute is a revoked state.

[0064] In some embodiments, the user terminal is specifically used to:

[0065] Determining a plaintext and a message digest according to the outsourcing parameters and the semi-decrypted ciphertext;

[0066] According to the message digest determined based on the semi-decrypted ciphertext and the preset index mapping relationship, the interactive information corresponding to the plaintext is queried from the blockchain to verify the correctness of the decryption, thereby obtaining the correct plaintext.

[0067] The data encryption method, data decryption method and system provided by the present disclosure, wherein the data encryption method includes: the carbon emission data management center publishes the system public parameters and public public key of the carbon emission system; multiple attribute authority agencies determine the institutional public keys of multiple attribute authority agencies according to the system public parameters, the enterprise end encrypts the data to be encrypted based on the public public key, the institutional public key, and the preset carbon emission data access policy to obtain the encrypted ciphertext, wherein the access policy is used to characterize the access permission information for allowing access to and prohibiting access to the data to be encrypted, the enterprise end generates a shared transaction of the encrypted ciphertext, and transmits the shared transaction to the blockchain, and the blockchain verifies the shared transaction, and if the verification passes, the enterprise end transmits the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext. By introducing the carbon emission data management center and multiple attribute authority agencies, users of carbon emission data no longer rely on a single authority, reducing the trust risk of users to a single entity. At the same time, the multi-authorization center of multiple attribute authority agencies can support the management of large-scale attributes and users, improve the flexibility and scalability of the carbon emission system, enable the carbon emission system to adapt to more complex access control requirements, and make the attribute management of the carbon emission system more fine-grained and efficient. In addition, the CP-ABE technology and hash functions for complete policy hiding are used. For example, in the above example, complete policy hiding is achieved by embedding "λ" and "ω" into the ciphertext that no longer contains the access structure (M, ρ). By hiding the access policy, malicious users and third parties cannot infer the access control policy associated with the key, nor can they obtain the user's sensitive information in the access policy, thereby protecting the privacy and security of data users, making complete policy hiding more in line with the data sharing needs of carbon emissions. The use of hash functions simplifies the management and comparison of carbon emission user attributes and ensures the efficiency and security of the carbon emission system. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0069] Figure 1 A flowchart of a data encryption method provided by the present disclosure;

[0070] Figure 2 A schematic diagram of the principle of the data encryption / decryption method provided by the present disclosure;

[0071] Figure 3 A flowchart of a data decryption method provided by the present disclosure;

[0072] Figure 4 A schematic diagram of the structure of the data encryption system provided by the present disclosure;

[0073] Figure 5A schematic diagram of the structure of the data decryption system provided by the present invention.

[0074] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0075] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0076] It should be understood that the terms "including" and "having" and any variations thereof in the embodiments of the present disclosure are intended to cover but not exclude inclusion. For example, a product or device comprising a series of components is not necessarily limited to those components explicitly listed, but may include other components not explicitly listed or inherent to these products or devices.

[0077] In the embodiments of the present disclosure, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0078] The term "plurality" in the embodiments of the present disclosure refers to two or more than two, and other quantifiers are similar thereto.

[0079] The terms "first", "second", "third", etc. in the present disclosure are used to distinguish similar or similar objects or entities, and are not necessarily meant to limit a specific order or sequence, unless otherwise indicated. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, for example, they can be implemented in an order other than those given in the diagrams or descriptions of the embodiments of the present disclosure.

[0080] The term "unit / module" as used in this disclosure refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or a combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0081] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0082] According to one aspect of the present disclosure, the present disclosure provides a data encryption method.

[0083] See also Figure 1 , Figure 1 A flow chart of the data encryption method provided in the present disclosure. The data encryption method is applied to a data encryption system, which includes a carbon emission data management center (CDMA), a blockchain, multiple attribute authorities (AAs), an edge server (ES), and an enterprise end (DO) with data to be encrypted. The multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields. These attributes usually represent certain identity characteristics, permissions or roles of the user. For example, "Department: Sales" or "Position: Manager", etc. From the user's perspective, the attributes reflect the user's characteristics or permissions.

[0084] like Figure 1 As shown, the method includes:

[0085] S101: The carbon emission data management center publishes the system public parameters and public key of the carbon emission system.

[0086] The carbon emission system includes the components of the above-mentioned data encryption system, and also includes a user terminal for obtaining the encrypted ciphertext.

[0087] It is understandable that the enterprise end and the user end are relative concepts. For example, in some embodiments, an object may be an enterprise end, and in other embodiments, the object may be a user end.

[0088] S102: Multiple attribute authorities determine the agency public keys of multiple attribute authorities according to the system public parameters.

[0089] For example, S101 and S102 can be understood as the system initialization phase. Figure 2 As shown in Figure 1, at this stage, the carbon emission data management center publishes system public parameters, public public keys, and public master keys, etc. The multi-attribute authority generates its own institutional public parameters, institutional private keys, and master keys, etc. based on the system public parameters published by the carbon emission data management center.

[0090] For example, the Carbon Emission Data Management Center selects a bilinear group G of prime order p, a random generator g of G, and two hash functions H and H1, and defines H1:{0,1} * →G. The carbon emission data management center randomly selects f∈Z p And set F = e(g,g) f .

[0091] For each attribute in the attribute set U, a parameter α is randomly selected to generate attribute correlation. i ,t i ,h i ,r i ,m i ∈Z p , and generate group elements Where i∈[1,L], L is all the attributes in the attribute set U.

[0092] It is worth noting that multiple attribute authorities are nodes in the blockchain. θ ={AA1,AA2,AA3,...,AA θ Each attribute authority AA in j Random Selection And set

[0093] Correspondingly, the system public parameters disclosed by the carbon emission data management center can be Its master key is

[0094] Attribute Authority AA j Randomly select integer And the institution’s private key is calculated based on this integer Attribute Authority AA j Based on the integer, linear pairing e() is performed to calculate the corresponding institution public key:

[0095] S103: The enterprise end encrypts the data to be encrypted based on the public key, the institutional public key, and the preset carbon emission data access policy to obtain the encrypted ciphertext, wherein the access policy is used to represent the access permission information of allowing and prohibiting access to the data to be encrypted.

[0096] In some embodiments, the access policy includes multiple sub-policies, and S103 may include:

[0097] S1031: The enterprise side randomly selects a vector based on the system public parameters.

[0098] For example, the access policy A includes k sub-policies, that is, W = {W1∨W2Wk}. The enterprise side can randomly select a vector Where s is the encryption index.

[0099] S1032: The enterprise side determines the encryption index of the data to be encrypted according to the random selection vector, and assigns a weight to each of the multiple sub-strategies according to the random selection vector.

[0100] Combined with the above examples, the enterprise side can be based on Share the encrypted index s. Corresponding to the sub-strategy W k The sub-matrix M k , k∈[1,K], according to Determine the weight ω of this sub-strategy x .

[0101] Where k is the index of the sub-strategy, which is in the range of [1, K]. x =v·M x . M x is the vector of rows x of matrix M corresponding to the access policy. x∈[1,l], l is the number of rows in matrix M.

[0102] In some embodiments, in order to facilitate the verification of subsequent access rights, the enterprise end may randomly select a plaintext m k ∈G T , and for each sub-strategy W k Create a binary vector x of length L k ∈{0,1} L For every vector x k Randomly select the encryption parameters b,b i ∈Z p ,i∈[1,L].

[0103] If (x k ) i =1, the enterprise can randomly select and generate encryption parameters δ i ,δ i ′∈Z p , and set the encryption parameters used to generate If (x k ) i =0, the enterprise can randomly select the encryption parameter γ i ∈Z p , and set the encryption parameters used to generate

[0104] S1033: The enterprise end encrypts the data to be encrypted according to the encryption index, the public key, the institutional public key, and the weight of each sub-strategy to obtain the encrypted ciphertext.

[0105] For example, the enterprise can randomly select The encrypted message is calculated using the public key and institutional public key corresponding to the carbon emission data management center and multiple attribute authority agencies. C6={m k F -b} k ,C7=g b ,C8={X i ,Q i} k ,C9={Γ i ,Γ i ′} k and C′={H(m k )} k , the encrypted ciphertext CT = {{C 0,x ,C 1,x ,C 2,x ,C 3,x ,C 4,x ,C 5,x} x∈[1,l] ,,{C6,C7,C8,C9},C′}={CT1,CT2,C′}.

[0106] Among them, CT2 and C′ are used to verify the access rights of the encrypted ciphertext.

[0107] S104: The enterprise generates a shared transaction in encrypted ciphertext and transmits the shared transaction to the blockchain.

[0108] In some embodiments, S104 may include: the enterprise side calculates a message digest and a message signature based on a hash function, generates a shared transaction according to the message digest and the message signature, and generates a unique identifier for the shared transaction.

[0109] For example, the enterprise can use the hash function H to calculate the message digest MD = H (M) and the message signature sign = Sign (MD) to generate a shared transaction ST = {MD, sign}, and calculate the unique identifier ID TX =ST.id.

[0110] S105: When the blockchain verifies the shared transaction and the verification is passed, the enterprise end transmits the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext.

[0111] Exemplarily, the blockchain receives a shared transaction sent by the enterprise side and verifies the shared transaction. If the verification is successful, the blockchain can send a prompt message to the enterprise side indicating that the verification is successful. The enterprise side can transmit the encrypted ciphertext to the edge server based on the prompt message.

[0112] Correspondingly, when the edge server receives the encrypted ciphertext sent by the enterprise end, it can store the encrypted ciphertext.

[0113] That is to say, S103 to S105 are the data encryption stage. Figure 2 As shown in the figure, at this stage, the enterprise formulates access policies to encrypt its carbon emission data to ensure that its carbon emission data is not accessed by malicious users and third-party organizations, and ensures that organizations or users with access rights can share data. After encryption is completed, the enterprise generates a shared transaction, and after the shared transaction is verified, the encrypted ciphertext is uploaded to the edge server.

[0114] Based on the above analysis of S101 to S105, it can be seen that in this embodiment, by introducing a carbon emission data management center and multiple attribute authorities, users of carbon emission data no longer rely on a single authority, reducing the trust risk of users to a single entity. At the same time, the multi-authorization center of multiple attribute authorities can support the management of large-scale attributes and users, improve the flexibility and scalability of the carbon emission system, enable the carbon emission system to adapt to more complex access control requirements, and make the attribute management of the carbon emission system more fine-grained and efficient. In addition, the CP-ABE technology and hash function of complete policy hiding are used. For example, in the above example, complete policy hiding is achieved by embedding "λ" and "ω" into the ciphertext that no longer contains the access structure (M, ρ). By hiding the access policy, malicious users and third parties cannot infer the access control policy associated with the key, nor can they obtain the sensitive information of the user in the access policy, thereby protecting the privacy and security of data users, making complete policy hiding more in line with the data sharing requirements of carbon emissions. The use of hash functions simplifies the management and comparison of carbon emission user attributes and ensures the efficiency and security of the carbon emission system.

[0115] According to one aspect of the present disclosure, the present disclosure provides a data decryption method.

[0116] See also Figure 3 , Figure 3 A flow chart of a data decryption method provided by the present disclosure. The data decryption method is applied to a data decryption system, which includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and a user end that needs to obtain decrypted data. The multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields. The enterprise end encrypts the encrypted data to obtain the encrypted ciphertext.

[0117] like Figure 3 As shown, the method includes:

[0118] S301: The user terminal generates a conversion key corresponding to the encrypted ciphertext, and transmits the conversion key to the edge server.

[0119] In some embodiments, “the user terminal generates a conversion key corresponding to the encrypted ciphertext” in S301 includes:

[0120] S3011: Obtain private keys from the carbon emission data management center and multiple attribute authority organizations respectively.

[0121] S3012: Determine the complete private key based on the two parts of the private key obtained, and generate a conversion key based on the complete private key and the randomly selected outsourcing parameters.

[0122] Exemplarily, multiple attribute authorities select a random number β∈Z for the user terminal p , and create a vector y∈{0,1,*} containing 3 possible values ​​(0,1,*) L If y=(*,*,*,...,*), then let D3=g f ; if y i ≠*, then use Represents index i.

[0123] Multiple attribute authorities under constraints Next, randomly select f i ∈Z p If y i =1, then calculate E′ i =g if y i = 0, then select a random number θ∈Z p And calculate E i =E′ i =g ε ; if y i =*, then set Among them, IndexM:{i′→i} can be used to represent the index mapping relationship between attributes in S and U.

[0124] Multiple attribute authorities select a random number t and calculate D1=H1(uid′) t , D3={Y i ,L i}, D4={E i ,E′ i},D′={μ i =t i / r i ,μ′ i =h i / m i}, IndexM:{i′→i}.

[0125] Correspondingly, on this basis, the client can obtain the complete user key (i.e. the complete private key):

[0126] When the user obtains the complete user key, he can randomly select z∈Z p As an outsourced parameter, the conversion key is calculated based on SK

[0127] S302: The edge server generates a shared transaction corresponding to the conversion key, and transmits the shared transaction to the blockchain, so as to store the conversion key when the blockchain successfully verifies the shared transaction.

[0128] In some embodiments, “the edge server generates a shared transaction corresponding to the conversion key” in S302 includes:

[0129] S3021: Determine the message digest of the conversion key and the conversion key hash value.

[0130] Exemplarily, after receiving the conversion key TK, the edge server may calculate the conversion key hash value TKverify=H(TK) and the message digest MDT=H(ID, TKverify).

[0131] S3022: Use the signature private key of the edge server to sign the message digest.

[0132] For example, the edge server signs its private key BSK ES Signing a message digest

[0133] S3023: Construct a shared transaction according to the conversion key, the conversion key hash value, the edge server signature, and the edge server identifier.

[0134] Combined with the above example, the conversion key is TK, the conversion key hash value is TKverify, the edge server signature is sign, and the edge server identifier is ID. Correspondingly, the shared transaction constructed by the edge server is TX st ={TK,TKverify,sign,ID}.

[0135] The edge server will share the transaction TX st Transmitted to the blockchain. The blockchain is based on the signature public key BPK of the edge server ES For shared transactions TX st Verify to avoid sharing transaction TX st has been tampered with.

[0136] In some embodiments, the data decryption method may further include: if the target attribute of the user terminal is revoked or changed, the edge server reconstructs the shared transaction, and the edge server transmits the reconstructed shared transaction to the blockchain so that the blockchain verifies the reconstructed shared transaction, wherein, if the verification is passed, the state of the conversion key of the target attribute is a revoked state.

[0137] Exemplarily, when a certain attribute of the user terminal is revoked or changed, the edge server can calculate the corresponding conversion key hash value and message digest based on the above method, and sign it to reconstruct the corresponding shared transaction.

[0138] When the blockchain receives the reconstructed shared transaction sent by the edge server, it can be based on the user's signature public key BPK DU The reconstructed shared transaction is verified and marked as revoked if the verification passes.

[0139] Combining the above analysis of S301 and S302, it can be seen that S301 and S302 can be understood as the key generation stage. Figure 2 As shown, at this stage, the user end can submit its unique global identity to the carbon emission data management center to obtain part of the user key from the carbon emission data management center, and obtain part of the key from multiple attribute authorities related to the user end attributes, and integrate the two parts to obtain the complete user key.

[0140] On this basis, the user end can generate a conversion key based on the complete user key and transmit the conversion key to the edge server. The edge server generates a shared transaction through an algorithm and submits it to the blockchain for verification. If the verification is successful, the shared transaction will be stored in the data ledger of the edge server.

[0141] Moreover, when the attributes on the user side are revoked or changed, the same verification will be performed, and the shared transaction corresponding to the revoked or changed attributes will be marked as revoked.

[0142] S303: The user terminal generates a smart contract transaction corresponding to the encrypted ciphertext, and obtains part of the ciphertext based on the smart contract transaction to verify the access rights before decryption.

[0143] This step can be understood as the access rights verification stage. Figure 2 As shown in Figure 1, at this stage, the user side calls the smart contract by generating a smart contract transaction and obtains part of the ciphertext to verify the access rights before decryption. Only after the access rights are verified can the user side obtain the remaining ciphertext.

[0144] For example, for each sub-strategy Wk , calculate the difference Δ=e(Γ i ,E i ) / e(Γ′ i ,E′ i ),i∈[1,L]. If Δ=1, it means (x k ) i =0,y i =1, let If Δ≠1, I={i} is used to record the above index "i", and the result of recording the index is calculated as Result1=I. i ,E i ) and e(Γ i ′,E′ i ) represents a pairing operation.

[0145] When y=(*,*,...,*,*), calculate the intermediate value m′ k =C6·e(C7,D3); when y≠(*,*,...,*,*) and i∈S y When and H(m k ′); if the partial ciphertext C′ contains H(m k ′), output the verification result HS=TRUE, IndexSubP=k; if the partial ciphertext does not contain H(m k ′), then the output verification result HS=FALSE, IndexSubP=⊥.

[0146] Integrating the above results, we get Result2 = {m′ k ,HS},Result3=IndexSubP. Where, IdexSubP is the index of the sub-strategy.

[0147] S304: If the smart contract transaction verification is successful, the edge server semi-decrypts the encrypted ciphertext according to the conversion key, and sends the obtained semi-decrypted ciphertext to the user end.

[0148] For example, when the user needs to access data, such as when the user needs to obtain encrypted ciphertext, it can send an access request to the edge server. After the user passes the data access permission verification in the above example, the edge server can use the conversion key to semi-decrypt the encrypted ciphertext CT and obtain the semi-decrypted ciphertext

[0149] After the semi-decryption is completed, the edge server sends the semi-decrypted ciphertext CT′ to the user end.

[0150] S305: The user end decrypts the semi-decrypted ciphertext to obtain plaintext.

[0151] In combination with the above example, after receiving the semi-decrypted ciphertext CT′ transmitted by the edge server, the user terminal decrypts the semi-decrypted ciphertext CT′ to obtain the plaintext M′.

[0152] In some embodiments, S305 may include:

[0153] S3051: Determine the plaintext and the message digest based on the outsourced parameters and the semi-decrypted ciphertext.

[0154] For example, the client calculates the semi-decrypted ciphertext according to the outsourced parameters to obtain the plaintext And the message digest MD′=H(M′) is calculated.

[0155] S3052: According to the message digest determined based on the semi-decrypted ciphertext and the preset index mapping relationship, the interactive information corresponding to the plaintext is queried from the blockchain to verify the correctness of the decryption and obtain the correct plaintext.

[0156] For example, the user end queries the corresponding interaction information, such as the corresponding transaction information, from the blockchain according to the index mapping relationship IndexM to verify the correctness of the decryption, thereby obtaining the correct ciphertext M′.

[0157] Based on the above analysis of S304 and S305, S304 and S305 can be understood as the data decryption stage. Figure 2 As shown, at this stage, after the smart contract transaction is verified, the edge server semi-decrypts the encrypted ciphertext and sends the semi-decrypted ciphertext to the user end. Correspondingly, the user end finally decrypts the semi-decrypted ciphertext to obtain the plaintext.

[0158] Combined with the above analysis of S301 and S305, it can be seen that in this embodiment, by using the smart contract technology in the blockchain, the purpose of efficiently realizing attribute revocation is achieved. As in the above example, the efficient attribute revocation mechanism realizes dynamic access control, allowing the carbon emission data owner or the system administrator to revoke certain attributes of the user terminal when necessary, thereby preventing the revoked user terminal from accessing sensitive data, and ensuring the security and flexibility of the carbon emission system. At the same time, when the attributes of the user terminal change, the carbon emission system can update the user terminal's permissions in a timely manner to ensure that only the user terminal that meets the current access conditions can decrypt the data, reducing the potential risk of data leakage. In addition, by introducing outsourced decryption technology and edge servers, the computing overhead of the user terminal node is greatly reduced, so that the user terminal can also decrypt the ciphertext when using some terminal devices with limited performance, and set a verification mechanism for the decrypted results to ensure the correctness of the decryption, and improve the computing efficiency and security of the carbon emission system.

[0159] According to one aspect of the present disclosure, the present disclosure provides a data encryption system.

[0160] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of the data encryption system provided by the present disclosure. Figure 4 As shown, the data encryption system 400 includes: a carbon emission data management center 401, a blockchain 402, multiple attribute authorities 403, an edge server 404, and an enterprise end 405 with data to be encrypted, wherein the multiple attribute authorities 403 are nodes in the blockchain 402, and different attribute authorities are responsible for managing and issuing different attributes related to their fields; wherein,

[0161] The carbon emission data management center 401 is used to publish system public parameters and public keys of the carbon emission system;

[0162] The multiple attribute authorities 403 are used to determine the institution public keys of the multiple attribute authorities according to the system public parameters;

[0163] The enterprise end 405 is used to encrypt the data to be encrypted based on the public key, the institution public key, and a preset carbon emission data access policy to obtain an encrypted ciphertext, wherein the access policy is used to represent access permission information for allowing or prohibiting access to the data to be encrypted;

[0164] The enterprise end 405 is further used to generate a shared transaction of the encrypted ciphertext and transmit the shared transaction to the blockchain 402;

[0165] When the blockchain 402 is used to verify the shared transaction and the verification is passed, the enterprise end 405 is also used to transmit the encrypted ciphertext to the edge server 404 so that the edge server 404 stores the encrypted ciphertext.

[0166] In some embodiments, the access policy includes multiple sub-policies; the enterprise end 405 is specifically used to:

[0167] Randomly selecting a vector according to the system common parameters;

[0168] determining an encryption index of the data to be encrypted according to the random selection vector, and assigning a weight to each of the plurality of sub-strategies according to the random selection vector;

[0169] The data to be encrypted is encrypted according to the encryption index, the public key, the institution public key, and the weight of each sub-strategy to obtain the encrypted ciphertext.

[0170] In some embodiments, the enterprise end 405 is specifically used to calculate a message digest and a message signature based on a hash function, generate the shared transaction according to the message digest and the message signature, and generate a unique identifier for the shared transaction.

[0171] According to one aspect of the present disclosure, the present disclosure provides a data decryption system.

[0172] See also Figure 5 , Figure 5 The structure diagram of the data decryption system provided by the embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the data decryption system 500 includes: a carbon emission data management center 501, a blockchain 502, multiple attribute authorities 503, an edge server 504, and a user terminal 505 that needs to obtain decrypted data. The multiple attribute authorities 503 are nodes in the blockchain 502. Different attribute authorities 503 are used to manage different attributes of the enterprise terminal. The enterprise terminal encrypts the encrypted data to obtain the encrypted ciphertext; wherein,

[0173] The client 505 is used to generate a conversion key corresponding to the encrypted ciphertext, and transmit the conversion key to the edge server 504;

[0174] The edge server 504 is used to generate a shared transaction corresponding to the conversion key, and transmit the shared transaction to the blockchain 502, so as to store the conversion key when the blockchain 502 successfully verifies the shared transaction;

[0175] The user terminal 505 is also used to generate a smart contract transaction corresponding to the encrypted ciphertext, and obtain part of the ciphertext based on the smart contract transaction to verify the access rights before decryption;

[0176] If the smart contract transaction verification is passed, the edge server 504 is used to semi-decrypt the encrypted ciphertext according to the conversion key, and send the obtained semi-decrypted ciphertext to the user terminal 505;

[0177] The user terminal 505 is also used to decrypt the semi-decrypted ciphertext to obtain plaintext.

[0178] In some embodiments, the user terminal 505 is specifically used to:

[0179] Obtaining private keys from the carbon emission data management center 501 and the plurality of attribute authorities 503 respectively;

[0180] A complete private key is determined according to the obtained two-part private key, and the conversion key is generated according to the complete private key and the randomly selected outsourcing parameter.

[0181] In some embodiments, the edge server 504 is specifically used to:

[0182] Determining a message digest and a hash value of the conversion key;

[0183] Sign the message digest using the signature private key of the edge server 504;

[0184] The shared transaction is constructed according to the conversion key, the conversion key hash value, the edge server 504 signature, and the edge server 504 identifier.

[0185] In some embodiments, if the target attribute of the client 505 is revoked or changed, the edge server 504 is further used to reconstruct the sharing transaction;

[0186] The edge server 504 is further used to transmit the reconstructed shared transaction to the blockchain 502 so that the blockchain 502 verifies the reconstructed shared transaction, wherein, if the verification is passed, the state of the conversion key of the target attribute is a revoked state.

[0187] In some embodiments, the user terminal 505 is specifically used to:

[0188] Determining a plaintext and a message digest according to the outsourcing parameters and the semi-decrypted ciphertext;

[0189] According to the message digest determined based on the semi-decrypted ciphertext and the preset index mapping relationship, the interactive information corresponding to the plaintext is queried from the blockchain 502 to verify the correctness of the decryption, thereby obtaining the correct plaintext.

[0190] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0191] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer executable instructions. These computer executable instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0192] These processor executable instructions may also be stored in a processor readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the processor readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0193] These processor-executable instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0194] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. A data encryption method, characterized in that: The data encryption method is applied to a data encryption system, which includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and an enterprise end having data to be encrypted, wherein the multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields; the method includes: The carbon emission data management center publishes system public parameters and public keys of the carbon emission system; The multiple attribute authorities determine the agency public keys of the multiple attribute authorities according to the system public parameters; The enterprise end encrypts the data to be encrypted based on the public key, the institution public key, and a preset carbon emission data access policy to obtain an encrypted ciphertext, wherein the access policy is used to characterize access permission information for allowing or prohibiting access to the data to be encrypted; The enterprise end generates a shared transaction of the encrypted ciphertext, and transmits the shared transaction to the blockchain; When the blockchain verifies the shared transaction and the verification is passed, the enterprise end transmits the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext.

2. The method according to claim 1, characterized in that The access strategy includes a plurality of sub-strategies; the enterprise end encrypts the data to be encrypted based on the public key, the institution public key, and the preset carbon emission data access strategy to obtain the encrypted ciphertext, including: Randomly selecting a vector according to the system common parameters; determining an encryption index of the data to be encrypted according to the random selection vector, and assigning a weight to each of the plurality of sub-strategies according to the random selection vector; The data to be encrypted is encrypted according to the encryption index, the public key, the institution public key, and the weight of each sub-strategy to obtain the encrypted ciphertext.

3. The method according to claim 1, characterized in that The enterprise end generates a shared transaction of the encrypted ciphertext, including: The enterprise end calculates a message digest and a message signature based on a hash function, generates the shared transaction according to the message digest and the message signature, and generates a unique identifier for the shared transaction.

4. A data decryption method, characterized in that: The data decryption method is applied to a data decryption system, which includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and a user end that needs to obtain decrypted data. The multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields. The enterprise end encrypts the data to be encrypted to obtain encrypted ciphertext; the method includes: The user terminal generates a conversion key corresponding to the encrypted ciphertext, and transmits the conversion key to the edge server; The edge server generates a shared transaction corresponding to the conversion key, and transmits the shared transaction to the blockchain, so as to store the conversion key when the blockchain successfully verifies the shared transaction; The user terminal generates a smart contract transaction corresponding to the encrypted ciphertext, and obtains part of the ciphertext based on the smart contract transaction to verify the access rights before decryption; If the smart contract transaction verification passes, the edge server semi-decrypts the encrypted ciphertext according to the conversion key, and sends the obtained semi-decrypted ciphertext to the user terminal; The user terminal decrypts the semi-decrypted ciphertext to obtain plaintext.

5. The method according to claim 4, characterized in that The user terminal generates a conversion key corresponding to the encrypted ciphertext, including: Obtaining private keys from the carbon emission data management center and the plurality of attribute authority agencies respectively; A complete private key is determined according to the obtained two-part private key, and the conversion key is generated according to the complete private key and the randomly selected outsourcing parameter.

6. The method according to claim 4, characterized in that The edge server generates a shared transaction corresponding to the conversion key, including: Determining a message digest and a hash value of the conversion key; Signing the message digest using the signature private key of the edge server; The shared transaction is constructed according to the conversion key, the conversion key hash value, the edge server signature, and the edge server identifier.

7. The method according to claim 4, characterized in that The method further comprises: If the target attribute of the user terminal is revoked or changed, the edge server reconstructs the shared transaction; The edge server transmits the reconstructed shared transaction to the blockchain so that the blockchain verifies the reconstructed shared transaction, wherein if the verification is passed, the state of the conversion key of the target attribute is a revoked state.

8. The method according to claim 5, characterized in that The user terminal decrypts the semi-decrypted ciphertext to obtain plaintext, including: Determining a plaintext and a message digest according to the outsourcing parameters and the semi-decrypted ciphertext; According to the message digest determined based on the semi-decrypted ciphertext and the preset index mapping relationship, the interactive information corresponding to the plaintext is queried from the blockchain to verify the correctness of the decryption, thereby obtaining the correct plaintext.

9. A data encryption system, characterized in that: The data encryption system includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and an enterprise end having data to be encrypted. The multiple attribute authorities are nodes in the blockchain, and different attribute authorities are responsible for managing and issuing attributes related to their fields; wherein, The carbon emission data management center is used to publish system public parameters and public keys of the carbon emission system; The multiple attribute authorities are used to determine the agency public keys of the multiple attribute authorities according to the system public parameters; The enterprise end is used to encrypt the data to be encrypted based on the public key, the institution public key, and a preset carbon emission data access policy to obtain an encrypted ciphertext, wherein the access policy is used to characterize access permission information for allowing or prohibiting access to the data to be encrypted; The enterprise end is further used to generate a shared transaction of the encrypted ciphertext and transmit the shared transaction to the blockchain; When the blockchain is used to verify the shared transaction and the verification is passed, the enterprise end is also used to transmit the encrypted ciphertext to the edge server so that the edge server stores the encrypted ciphertext.

10. A data decryption system, characterized in that: The data decryption system includes a carbon emission data management center, a blockchain, multiple attribute authorities, an edge server, and a user end that needs to obtain decrypted data. The multiple attribute authorities are nodes in the blockchain. Different attribute authorities are responsible for managing and issuing attributes related to their fields. The enterprise end encrypts the encrypted data to obtain encrypted ciphertext; wherein, The user terminal is used to generate a conversion key corresponding to the encrypted ciphertext, and transmit the conversion key to the edge server; the edge server is used to generate a shared transaction corresponding to the conversion key, and transmit the shared transaction to the blockchain, so as to store the conversion key when the blockchain successfully verifies the shared transaction; The user terminal is also used to generate a smart contract transaction corresponding to the encrypted ciphertext, and obtain part of the ciphertext based on the smart contract transaction to verify the access rights before decryption; If the smart contract transaction verification passes, the edge server is used to semi-decrypt the encrypted ciphertext according to the conversion key, and send the obtained semi-decrypted ciphertext to the user terminal; The user terminal is also used to decrypt the semi-decrypted ciphertext to obtain plaintext.