A power data privacy security protection system, method and application based on ciphertext policy attribute-based encryption

By using a power data privacy and security protection system based on ciphertext policy attribute base encryption, and combining blockchain and smart contracts with symmetric encryption and CP-ABE technology, the system solves the problems of dynamic changes in user attributes and complex key management of power data in the cloud environment, and achieves data transparency, security and efficiency.

CN119892452BActive Publication Date: 2026-01-23TIANJIN UNIV OF SCI & TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510041349.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2026-01-23
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

Existing attribute-based encryption technologies are difficult to effectively respond to dynamic changes in user attributes in power data privacy protection, and key management is complex, resulting in insufficient system security and efficiency.

Method used

A power data privacy and security protection system based on ciphertext policy attribute base encryption is adopted. The encryption algorithm is executed through a blockchain platform and smart contracts. Symmetric encryption and CP-ABE technology are used, and the access policy is transformed into an access tree structure and embedded in the ciphertext to achieve fine-grained access control. A user revocation algorithm is constructed through a chameleon hash function.

Benefits of technology

It achieves transparency, traceability, and security of power data in the cloud environment, ensures data integrity and privacy, improves system security and efficiency, simplifies key management, and responds to changes in user permissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892452B_ABST
    Figure CN119892452B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of power data encryption, and discloses a power data privacy security protection system, method and application based on ciphertext policy attribute-based encryption, wherein the system comprises entity roles of a data owner (DO), a data user (DU), a trusted authorization center (TA), a block chain (BC), a cloud service provider (CSP) and an attribute manager (AM). The application solves the single-point failure problem caused by the dependence on the central entity in the traditional CP-ABE scheme by using the block chain platform, the encryption algorithm is executed by the smart contract, the symmetric decryption key is safely hosted on the cloud server, and the key information such as the data digest and the file location is stored on the block chain, so that the transparency and traceability of the data are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power data encryption technology, and in particular to a power data privacy and security protection system, method and application based on ciphertext policy attribute base encryption. Background Technology

[0002] As the power industry embarks on its digital transformation, storing power data in the cloud has become a key initiative. Cloud computing technology offers a flexible and efficient data storage solution, allowing storage resources to be virtualized and hosted on remote servers, accessible to users at any time as needed. This model is widely popular due to its cost-effectiveness, enhanced data backup options, and ease of data access from anywhere. Power data encompasses not only real-time monitoring of the grid's status but also granular metrics such as electricity consumption, frequency fluctuations, and voltage levels, all crucial for ensuring the grid's efficient operation and reliability. Given the high sensitivity of this type of data, ensuring its proper protection in the cloud environment is paramount. This requires implementing stringent security measures to prevent unauthorized access, tampering, or leakage, while ensuring the confidentiality and integrity of the data are impeccably protected during storage and transmission.

[0003] Privacy protection for power data typically involves encryption and multi-layered defense strategies. Advanced encryption technologies and strict access control policies significantly reduce the risk of malicious attacks while ensuring compliance with industry regulations. Attribute-based ecryption (ABE) has been rigorously proven to effectively protect power data privacy. This method allows for the definition of complex access control policies, controlling data access permissions through sets of attributes rather than single user identifiers. This means the creation of rich access rules to accommodate diverse permission management needs. Unlike traditional public-key encryption schemes, ABE enables scenarios where encryption is performed once and decryption is performed by multiple users. Decryption is successful as long as the user's attributes meet the policies defined in the ciphertext or key. While this method offers good privacy protection for power data, implementing ABE may require significant computational resources and time, especially when processing large amounts of data or involving complex policies, making it difficult to balance security and feasibility.

[0004] In existing technologies, Sahai et al., building upon attribute-based encryption, proposed an advanced framework called "Revocable Attribute-Based Encryption" (Revocable ABE). It provides data owners with a crucial capability: the ability to revoke or cancel previously granted decryption permissions to users, provided the user complies with established access policies. This mechanism makes access control more flexible and responsive, applicable to many real-world scenarios, especially in environments with frequent changes in user permissions. However, using this scheme involves a series of complex cryptographic algorithms and meticulously designed protocols to ensure that even if a user's private key is leaked or misused, the system can still effectively revoke the right to use those private keys. To achieve this, the existing ABE framework needs further extension and optimization to support efficient key revocation mechanisms. Furthermore, the system's complexity increases due to the need to maintain an additional list for revocation, periodically update keys, and periodically re-encrypt data. While this improvement significantly enhances the system's security and flexibility, it also places higher demands on system design and management.

[0005] In existing technologies, Zhao Zhiyuan et al. proposed an innovative, verifiable, fully outsourced Ciphertext Policy Attribute-Based Encryption (CP-ABE) scheme. This scheme allows users to focus on their core business logic, completely delegating computationally intensive tasks involving key generation, data encryption, and decryption to cloud servers. This outsourcing model not only leverages the efficiency and flexibility of cloud platforms but also significantly reduces the computational burden and resource consumption of user devices, enabling them to handle complex encryption operations without requiring powerful computing capabilities. However, using this scheme presents challenges in key management. Due to the need for verifiability and outsourcing, the number of key versions in the system may increase, leading to more complex key management. Precise synchronization and management of different key versions are essential to ensure data integrity and security. Furthermore, maintaining compatibility and update mechanisms between key versions presents a new challenge as the number of key versions increases.

[0006] In the digital transformation of the power industry, migrating critical power data to the cloud environment has become a key step in driving industry development. Cloud computing, as a flexible and efficient data storage solution, facilitates the management and analysis of power data. Through virtualization technology, storage resources are deployed on remote cloud servers, allowing users to access data on demand, whether for daily operations or big data analysis. However, the sensitivity of power data cannot be ignored. If this data is leaked during collection, transmission, or analysis, it can easily become prey for cyber attackers, leading to serious economic losses and security risks. Therefore, ensuring that this data is adequately protected in the cloud environment, preventing any form of unauthorized access, tampering, or leakage, is crucial.

[0007] Using attribute-based encryption cannot guarantee the privacy and security of access policies, nor can it fully respond to dynamic changes in user attributes.

[0008] Therefore, there is an urgent need for one or more new related methods to ensure the security of power data. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide a power data privacy and security protection system, method and application based on ciphertext policy attribute base encryption.

[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0011] A power data privacy and security protection system based on ciphertext policy attribute base encryption, the system includes entity roles including data owner DO, data user DU, trusted authorization center TA, blockchain BC, cloud service provider CSP, and attribute manager AM;

[0012] The entity roles include: data owners who can choose a key to encrypt data and update the key using ciphertext sent by the attribute manager AM; data users who can generate identity identifiers to construct private keys and verify data integrity; trusted authorization centers that can generate private keys and initial keys for attribute groups and update attribute group keys when attribute revocation occurs; blockchains that can publish information such as attribute state changes and record the mapping relationship between data users DU and their attribute sets; cloud service providers that can sign the hash value of the ciphertext and ensure data integrity and trustworthiness; and attribute managers that can re-encrypt the ciphertext and ensure no collusion with cloud service providers CSP when revocation occurs.

[0013] The above-mentioned power data privacy and security protection system is applied in the protection of power data privacy and security.

[0014] The power data privacy and security protection method based on ciphertext policy attribute base encryption in the aforementioned power data privacy and security protection system includes the following steps:

[0015] (1) System initialization

[0016] The Trusted Authorization Center (TA) performs system initialization, inputting security parameters λ and attributes U to derive the system public key PK and the system master private key MSK. TA defines a bilinear mapping, e: G×G→G T G and G T Let G represent a multiplicative cyclic group, with generator g and order p being prime numbers. To construct this system, TA chose a hash function H: {0, 1}*→G to ensure data security and privacy. TA also chose a random element α∈Z. p α represents a random element in a p-order multiplicative cyclic group, Z p It is a multiplicative cyclic group of order p, and n values ​​are defined for the system properties, L n ={att i} 1≤i≤n L n This represents the system attribute definition value, att i This represents the system attribute value, where i represents a random number greater than or equal to 1 and less than or equal to n. Each attribute can take n values. i Multiple values, which can then be represented as Let Z represent the set of system attribute values, b represent random numbers related to the attribute, and i represent random numbers greater than or equal to 1 and less than or equal to n; then, TA starts from Z. p A random number was selected. calculate Z i,bi Z is a random number in a p-order multiplicative cyclic group, g is a generator in the multiplicative cyclic group, and Z is a random number in a p-order multiplicative cyclic group. i,bi It is the encrypted representation of the attribute value, T i,bi It is another element generated by TA for the attribute value, b i These are random numbers related to attributes, from which the system's public key PK and master private key MSK are derived. These keys will be used to encrypt and decrypt data and to implement fine-grained access control.

[0017]

[0018] Where, e(g, g) a Let g be a bilinear mapping representing the generator g of the multiplicative cyclic group. a Let g represent the generator g raised to the power of α in the multiplicative cyclic group G; the rest of the formula is the same as above.

[0019] Executed by the TA, the input is the public key PK, and the output is the public key CPK and the private key CSK. The TA selects two prime numbers p and q, where p represents a random prime number different from q, and q represents a random prime number different from p, and calculates their product n = p·q. After that, the TA selects a random integer E. Ensure that the Euler totient function of E and n Coprime numbers, cloud service provider CSP: D is the private key exponent in the symmetric encryption algorithm, and E is the Euler totient function. Given a random set of prime integers, calculate the CSP's public key CPK, CPK = {E, n} and private key CSK, CSK = D based on these parameters;

[0020] The process is performed by the data owner DO, who takes the system public key PK as input and outputs DO's public key DPK and private key DSK. A similar method can also be used to generate the data owner DO's public key DPK, where DPK = {E′, n′} and private key DSK. In this way, the security and uniqueness of the keys are ensured for subsequent encryption, decryption and data transmission operations.

[0021] (2) User Registration

[0022] A global identity identifier is used to identify specific users, and a corresponding user key SK and conversion key TK are generated based on the set of attributes submitted by the user.

[0023] (3) Data processing

[0024] Before the entity with data owner DO starts processing work, it needs to connect to the blockchain network to obtain the necessary system parameters PP, and perform offline pre-computation operations during idle time to ensure that the subsequent encryption process can be completed efficiently. Once DO receives the power data N, it will immediately perform online hybrid encryption operations to generate the corresponding ciphertext data CT. This process can be divided into offline and online states to ensure data security and efficient system operation.

[0025] ①Online Phase

[0026] a) Choose the symmetric key K ey Calculate the two ciphertexts of N. N represents electricity data, C f and Let N represent two encrypted data sets, where Enc() represents a symmetric encryption algorithm, Key is the symmetric key, and H(N) represents the hash function of the power data N.

[0027] b) Select an access strategy (M,q), where M is an l-row n-column matrix and q is an injective function, q(i) = x, which maps the row number i of matrix M to the attribute x, i = 1, 2, ..., n;

[0028] c) Select a random number s, let Use it as a shared secret value, then select a random number. Set vector s is a random number belonging to a p-order multiplicative cyclic group. It is a p-order multiplicative cyclic group, where v2…vn are n random numbers belonging to the multiplicative cyclic group. It is a vector composed of random numbers in a multiplication cyclic group;

[0029] d) For each row Mi of matrix M, calculate the share λ i As the secret shared value of s, let λ i It is to calculate the share, M i It is each row of matrix M. It is a vector, and T is the transpose sign;

[0030] e) Calculate the values ​​of C, C1, C0, and C′0, where C = K ev ×W, C1=ss′, C0=W0, C′0=W′0, C represents the ciphertext obtained by symmetric encryption of plaintext and encryption key Key, W represents the encryption parameter obtained by operation of public key PK and random number s′, W0 represents another encryption parameter obtained by operation of generator g and random number s′, and W′0 represents another encryption parameter obtained by operation of generator h and random number s′.

[0031] f) Calculate f i =λ i -λ′ q(i) And set C i =W q(i) ;

[0032] ②Offline stage

[0033] a) Select a random number s′, let Calculate W = (PK) s′ W0 = g s′ W′0=h s′ The value of P K Represents the public key;

[0034] b) For attribute x∈ATT, select another random number λ′ x ,make Calculate The value of A x The function parameter represents attribute x, h is a random element in the multiplicative cyclic group, and Wx These are the encrypted parameters calculated for attribute x.

[0035] λ′ x It is a random number;

[0036] (4) Data encryption

[0037] Executed by the DO, the inputs are the public key PK, plaintext data data, and access policy W. The output is the intermediate ciphertext CT′. In the key space, the DO randomly selects a symmetric key k to symmetrically encrypt the plaintext data Data. After the encryption operation is completed, the DO transmits the encrypted data to the receiver, letting C′ = Enc. k (Data), C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, and Data represents the encrypted plaintext data. Here, the key encryption key tree method is used. DO converts the access policy W into an access tree and selects a random number s, letting s∈Z. p Calculate C′1=k·e(g,g) αs C′2=g s k is the symmetric key, g is the generator of the multiplicative cyclic group, α is the random element of the p-order multiplicative cyclic group, and s is the multiplicative cyclic group Z. p The random number is given by s, and e is a bilinear mapping of two multiplicative cyclic groups. In order to determine the unread non-leaf nodes, s is first set to the value of the root node and the node is marked as read. At the same time, all child nodes are modified to be unread. By performing recursive operations, the unread non-leaf nodes can be accurately determined and the corresponding processing operations can be performed.

[0038] ① When child nodes are in an unread state, if the non-leaf nodes are AND gates, then encryption can only be performed if all child nodes have been read. In other words, with an AND gate, all access attributes must be satisfied before decryption can proceed. In this case, DO randomly selects s. i ∈Z p ,1≤≤s i ≤p-1, si is a random number in the multiplicative cyclic group, Z p It is a p-order multiplicative cyclic group, and for the last non-leaf node, DO will set the node as read before calculating the value. p is the order of the multiplicative cyclic group, sj is the last leaf node, s and si are random numbers in the multiplicative cyclic group, and mod is the modulo operator;

[0039] ② When scanning a non-leaf node, if there are unread nodes among its child nodes, and the non-leaf node is an OR gate, then the non-leaf node needs to be marked as read. Simultaneously, the values ​​of all unread child nodes are set to a specific value s, and the DO performs the calculation:

[0040]

[0041]

[0042] Among them, Z i,bi is the encrypted representation of the attribute value, s is the random number selected in the multiplicative cyclic group, i is the random element in the attribute set, W represents the access policy, g is the generator of the multiplicative cyclic group, e is the bilinear mapping of the two multiplicative cyclic groups, I represents the set of attribute indices related to the access policy, C3' represents the ciphertext intermediate value, and C4' represents the ciphertext intermediate value.

[0043] The intermediate ciphertext CT′ = {W, C′, C′1, C′2, C′3, C′4} is obtained. This is executed by the AM, which takes the public key PK and the intermediate ciphertext CT′ as input. The AM then obtains the final ciphertext CT and the ciphertext header Hdr. After the DO sends the intermediate ciphertext, the AM receives it and can begin processing and decryption. By obtaining the intermediate ciphertext, the AM can continue with subsequent calculations or decryption steps to complete a specific task or obtain the required information. Next, the AM randomly selects k. i ∈Z p ,calculate C3 = C′3, C2 = C′2, C1 = C′1, C = C′, C, C1, C2, C3, and C4 are different components of the ciphertext, thus deriving the ciphertext and the ciphertext header:

[0044] CT = {C, C1, C2, C3, C4}

[0045]

[0046] Where, k i It is a p-order multiplicative cyclic group Z p Let i be a random element in the attribute set, W represent the access strategy, g be the generator of the multiplicative cyclic group, e be the bilinear mapping between the two multiplicative cyclic groups, and E be the inequality of Euler's totient function. Random integers that are coprime, T is the encryption attribute, θ is the attribute encryption coefficient, Mincs represents the least common subset, v is the attribute variable, j represents a random element different from i, CT represents the ciphertext, and Hdr represents the ciphertext header.

[0047] During the AM's computation of the ciphertext CT, it generates a hash value H(CT) corresponding to the ciphertext and sends this hash value to the DO. It then sends (CT, Hdr) to the CSP for processing to ensure the security and integrity of data transmission and storage. Upon receiving the data, the CSP calculates the hash value of CT to derive H(CT) and generates a signature Sig.CSP (CT)=H(CT) D mod n, Sig is the digital signature, H(CT) represents the hash value of the ciphertext CT. When CSP receives the hash value and the signature, it will store the signature along with the data at location Lo. c Send the data to the DO (Data Encryption Controller) together so that the DO can read and process the data in subsequent operations. The data encryption process is as follows: Figure 3 As shown;

[0048] (6) User Cancellation

[0049] Executed by TA, the system takes into account the common parameters, the random number ai′, the new key version K′, and the user attribute set S′, and derives the updated data user key SK′. At this stage, for users whose accounts have not been revoked, TA selects a random number β′. Generate a new key version K, and calculate R = (g β′ ,e(g β ,H1(ID))), where g β =g β (H1(att i ) a′ ) t-i′ ,att i It is one of the attribute sets, where i represents an element in the attribute set, g is the generator of the multiplicative cyclic group G, e is a bilinear mapping, H is a hash function, ID is the user's pseudonym, β' is a random number, t is a random number in the p-order multiplicative cyclic group, and α is a random value; because S′=S, a′ i =a i (i = 1, 2, ..., n)

[0050] The user attribute set and corresponding random values ​​remain unchanged; the key SK is then updated after calculation. i =SK i Users whose access has not been revoked can continue to access the site. For users whose access has been revoked, their corresponding attribute set S′=S\{att i}, select a new random number a′ i ≠a i (i = 1, 2, ..., n), therefore, users whose keys have been revoked will not receive the random number β' in the new key version K. The relevant information was not available, thus preventing the acquisition of a valid key SK′. i The meanings of the letters in the formula have been explained above.

[0051] The power data privacy and security protection method based on ciphertext policy attribute base encryption in the aforementioned power data privacy and security protection system is characterized by:

[0052] The power data privacy and security protection method based on ciphertext policy attribute base encryption also includes the generation of keys for individual users by AM, and the specific operation of AM generation is as follows:

[0053] When a user accesses the system, the system will obtain a globally unique identification information G from AM. IDu ∈{0,1} * Next, the system will use the set of attributes provided by the user. The process is performed to obtain the corresponding user key SK and transformation key TK. These operations are implemented by AM:

[0054] ① Select three natural numbers r, t, z ∈ G, where G represents a multiplicative cyclic group, and set the transformation key UK = z;

[0055] ② Calculate β = H(G) IDu H represents the hash function;

[0056] ③ For each attribute x∈S, calculate K x =(A x ) rtβ S represents the user's attribute set, x represents a single attribute in the attribute set S, and K x A represents the key component associated with attribute x. x The encrypted representation of the attribute value, r and t are randomly selected values, while β is the user's global identity identifier (GID) hashed using the hash function H. u The value obtained after processing;

[0057] ④ Calculate K respectively u L u The values ​​of D and G L u =g zrt D = g αr h b ;

[0058] ⑤ Set the user key SK = (K u L u , {K x} x∈S ,D,E), calculate K=(K u ) 1 / z L = (L u ) 1 / z Set the conversion key TK = (K, L, {K x} x∈S ), where D is the private key exponent in the symmetric encryption algorithm, and E is the exponent of the Euler totient function. Random integers that are coprime, Kx is the key corresponding to attribute x, K and L are part of the conversion key TK, and Ku and Lu are part of the key used to generate the user key.

[0059] The power data privacy and security protection method based on ciphertext policy attribute base encryption in the aforementioned power data privacy and security protection system is characterized by:

[0060] The electricity data privacy and security protection method based on ciphertext policy attribute base encryption also includes a smart contract interaction process, including a fair trading contract (FTC), a result verification contract (RVC), and a result receiving contract (RRC). The operation flow of the three smart contracts is as follows:

[0061] The smart contract FTC is responsible for ensuring that the user has prepaid the corresponding search fee before the search operation begins. After the server provides the search results, another smart contract RVC will intervene to verify the correctness and completeness of the results. Only when the results meet the established standards and requirements can the server obtain the reward it deserves from the contract. If the results fail to pass the verification, the smart contract will automatically trigger the refund mechanism to return the prepaid fee to the user.

[0062] The advantages and effects achieved by this invention are:

[0063] 1. This invention considers aspects such as data integrity, data confidentiality, and access policy concealment. To prevent the leakage of power data during collection, transmission, or analysis, which could lead to serious economic losses and security risks, it proposes a power data privacy and security protection method based on ciphertext policy attribute base encryption. This invention addresses the single point of failure problem inherent in traditional CP-ABE schemes that rely on a central entity by using a blockchain platform. The encryption algorithm is executed by a smart contract, the symmetric decryption key is securely hosted on a cloud server, and key information such as data digests and file locations are stored on the blockchain, ensuring data transparency and traceability.

[0064] 2. In this invention, the plaintext data is first encrypted using a symmetric encryption algorithm, and then the symmetric key is encrypted using CP-ABE technology to achieve precise control over data access permissions. To further enhance security, the access policy is transformed into an access tree structure and cleverly embedded in the ciphertext, effectively hiding the policy itself.

[0065] 3. This invention utilizes a user revocation algorithm built with a chameleon hash function, ensuring that once a user's access rights are revoked, they will be unable to obtain new key information and thus unable to decrypt the data. This comprehensive design not only guarantees data security and integrity but also achieves reliable data storage and privacy protection in the cloud environment through a trusted auditing mechanism, enhancing the security and efficiency of the entire system.

[0066] 4. By clearly defining the roles of data owner, data user, trusted authorization center, blockchain, cloud service provider, and attribute manager, this invention achieves data security encryption, flexible attribute management, efficient blockchain recording, data integrity verification, and anti-collusion design, effectively protecting the privacy and integrity of power data and improving the security and credibility of the system. Attached Figure Description

[0067] Figure 1 This is a system model architecture diagram of the present invention;

[0068] Figure 2 This is a flowchart of the smart contract interaction process in this invention;

[0069] Figure 3 This is a flowchart of the data encryption process in this invention;

[0070] Figure 4 This is a flowchart of the data decryption process in this invention;

[0071] Figure 5 This is a time-sharing graph of encryption for different file sizes based on the method of this invention;

[0072] Figure 6 This is a decryption time graph for different file sizes based on the method of this invention. Detailed Implementation

[0073] The present invention will be further described in detail below with reference to specific embodiments. The following embodiments are merely descriptive and not limiting, and should not be used to limit the scope of protection of the present invention.

[0074] The various experimental operations involved in the specific embodiments are all conventional techniques in the field. For parts not specifically annotated in this invention, those skilled in the art can refer to various commonly used reference books, scientific and technological documents or related instructions and manuals before the filing date of this invention to carry out the operations.

[0075] Example 1

[0076] A power data privacy and security protection system based on ciphertext policy attribute-based encryption, such as Figure 1 As shown, the system includes entity roles such as Data Owner (DO), Data User (DU), Trusted Authorization Center (TA), and Blockchain. c (Baidu, BC), Cloud Service Providers (CSP), and Attribute Manager (AM);

[0077] The entity roles include: data owners who can choose a key to encrypt data and update the key using ciphertext sent by the attribute manager AM; data users who can generate identity identifiers to construct private keys and verify data integrity; trusted authorization centers that can generate private keys and initial keys for attribute groups and update attribute group keys when attribute revocation occurs; blockchains that can publish information such as attribute state changes and record the mapping relationship between data users DU and their attribute sets; cloud service providers that can sign the hash value of the ciphertext and ensure data integrity and trustworthiness; and attribute managers that can re-encrypt the ciphertext and ensure no collusion with cloud service providers CSP when revocation occurs.

[0078] This invention, by clearly defining the roles of data owner, data user, trusted authorization center, blockchain, cloud service provider, and attribute manager, achieves data security encryption, flexible attribute management, efficient blockchain recording, data integrity verification, and anti-collusion design, effectively protecting the privacy and integrity of power data and improving the security and credibility of the system.

[0079] The power data privacy and security protection method based on ciphertext policy attribute-based encryption, as described above, utilizes the power data privacy and security protection system described above. Figures 2 to 4 As shown, it includes the following steps:

[0080] (1) System initialization

[0081] The Trusted Authorization Center (TA) performs system initialization, inputting security parameters λ and attributes U to derive the system public key PK and the system master private key MSK. TA defines a bilinear mapping, e: G×G→G T G and G T Let G represent a multiplicative cyclic group, with generator g and order p being prime numbers. To construct this system, TA chose a hash function H: {0, 1}*→G to ensure data security and privacy. TA also chose a random element α∈Z. p α represents a random element in a p-order multiplicative cyclic group, Z p It is a multiplicative cyclic group of order p, and n values ​​are defined for the system properties, L n ={att i} 1≤i≤n L n This represents the system attribute definition value, att i This represents the system attribute value, where i represents a random number greater than or equal to 1 and less than or equal to n. Each attribute can take n values. i Multiple values, which can then be represented as Let Z represent the set of system attribute values, b represent random numbers related to the attribute, and i represent random numbers greater than or equal to 1 and less than or equal to n; then, TA starts from Z.p A random number was selected. calculate z i,bi Z is a random number in a p-order multiplicative cyclic group, g is a generator in the multiplicative cyclic group, and Z is a random number in a p-order multiplicative cyclic group. i,bi It is the encrypted representation of the attribute value, T i,b i is another element generated by TA for the attribute value, b i These are random numbers related to attributes, from which the system's public key PK and master private key MSK are derived. These keys will be used to encrypt and decrypt data and to implement fine-grained access control.

[0082]

[0083] Where, e(g, g) a Let g be a bilinear mapping representing the generator g of the multiplicative cyclic group. a Let g represent the generator g raised to the power of α in the multiplicative cyclic group G; the rest of the formula is the same as above.

[0084] Executed by the TA, the input is the public key PK, and the output is the public key CPK and the private key CSK. The TA selects two prime numbers p and q, where p represents a random prime number different from q, and q represents a random prime number different from p, and calculates their product n = p·q. After that, the TA selects a random integer E. Ensure that the Euler totient function of E and n Coprime numbers, cloud service provider CSP: D is the private key exponent in the symmetric encryption algorithm, and E is the Euler totient function. Given a random set of prime integers, calculate the CSP's public key CPK, CPK = {E, n} and private key CSK, CSK = D based on these parameters;

[0085] This process is performed by the data owner (DO) entity, taking the system public key (PK) as input and outputting the DO's public key (DPK) and private key (DSK). A similar method can also be used to generate the DO's public key (DPK). DPK ={ E The key is secured and unique by using the private key DSK, which enables subsequent encryption, decryption, and data transmission operations.

[0086] (4) User registration

[0087] A global identity identifier is used to identify specific users, and a corresponding user key SK and conversion key TK are generated based on the set of attributes submitted by the user. The global identity identifier is a user identification mechanism that can be shared across multiple applications and platforms to ensure secure access to and processing of the user's data. Through this design, the system can accurately identify and manage user identity and data, thereby improving data security and controllability.

[0088] (5) Data processing

[0089] Before the entity with data owner DO starts processing work, it needs to connect to the blockchain network to obtain the necessary system parameters PP, and perform offline pre-computation operations during idle time to ensure that the subsequent encryption process can be completed efficiently. Once DO receives the power data N, it will immediately perform online hybrid encryption operations to generate the corresponding ciphertext data CT. This process can be divided into offline and online states to ensure data security and efficient system operation.

[0090] ①Online Phase

[0091] a) Choose the symmetric key K ey Calculate the two ciphertexts of N. N represents electricity data, C f and Let N represent two encrypted data sets, where Enc() represents a symmetric encryption algorithm, Key is the symmetric key, and H(N) represents the hash function of the power data N.

[0092] b) Select an access strategy (M,q), where M is a 1xn matrix and q is an injective function, q(i) = x, which maps the row number i of matrix M to the attribute x, i = 1, 2, ..., n;

[0093] c) Select a random number s, let Use it as a shared secret value, then select a random number. Set vector s is a random number belonging to a p-order multiplicative cyclic group. It is a p-order multiplicative cyclic group, where V²···vn are n random numbers belonging to the multiplicative cyclic group. It is a vector composed of random numbers in a multiplication cyclic group;

[0094] d) For each row Mi of matrix M, calculate the share λ i As the secret shared value of s, let λ i It calculates the shares, where Mi is each row of matrix M. It is a vector, and T is the transpose sign;

[0095] e) Calculate the values ​​of C, C1, C0, and C′0, where C = K ev ×W, C1=ss, C0=W0, C0=W0, C represents the ciphertext obtained by symmetric encryption of plaintext and encryption key Key, W represents the encryption parameter obtained by operation of public key PK and random number s', W0 represents another encryption parameter obtained by generator g through operation of random number s', and W′0 represents another encryption parameter obtained by generator h through operation of random number s'.

[0096] f) Calculate f i =λ i -λ′ q(i) And set C i =W q(i) ;

[0097] ②Offline stage

[0098] a) Select a random number s′, let Calculate W = (P) K ) s′ W0 = g s′ W ′ 0 = h s′ The value of P K Represents the public key;

[0099] b) For attribute x∈ATT, select another random number λ′ x ,make Calculate The value of A x The function parameter represents attribute x, h is a random element in the multiplicative cyclic group, and W x It is the encrypted parameter calculated for attribute x, λ′ x It is a random number;

[0100] (4) Data encryption

[0101] Executed by DO, inputting public key PK, plaintext data data, and access policy W, outputting intermediate ciphertext. CT In the key space, DO randomly selects a symmetric key k to symmetrically encrypt the plaintext data Data. After encryption, DO transmits the encrypted data to the receiver, letting C′ = Enc. k (Data), C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, and Data represents the encrypted plaintext data. Here, the key encryption key tree method is used. DO converts the access policy W into an access tree and selects a random number s, letting s∈Z. p Calculate C′1=k·e(g,g) as C′2=g sk is the symmetric key, g is the generator of the multiplicative cyclic group, α is the random element of the p-order multiplicative cyclic group, and s is the multiplicative cyclic group Z. p The random number is given by s, and e is a bilinear mapping of two multiplicative cyclic groups. In order to determine the unread non-leaf nodes, s is first set to the value of the root node and the node is marked as read. At the same time, all child nodes are modified to be unread. By performing recursive operations, the unread non-leaf nodes can be accurately determined and the corresponding processing operations can be performed.

[0102] ① When child nodes are in an unread state, if the non-leaf nodes are AND gates, then encryption can only be performed if all child nodes have been read. In other words, with an AND gate, all access attributes must be satisfied before decryption can proceed. In this case, DO randomly selects s. i ∈Z p , 1≤s i ≤p-1, si is a random number in the multiplicative cyclic group, Z p It is a p-order multiplicative cyclic group, and for the last non-leaf node, DO will set the node as read before calculating the value. p is the order of the multiplicative cyclic group, sj is the last leaf node, s and si are random numbers in the multiplicative cyclic group, and mod is the modulo operator;

[0103] ② When scanning a non-leaf node, if there are unread nodes among its child nodes, and the non-leaf node is an OR gate, then the non-leaf node needs to be marked as read. Simultaneously, the values ​​of all unread child nodes are set to a specific value s. This ensures that during logical computation, the value of the non-leaf node correctly reflects the state of its child nodes and avoids redundant computation of read nodes. DO performs the computation:

[0104]

[0105] Among them, Z i,bi is the encrypted representation of the attribute value, s is the random number selected in the multiplicative cyclic group, i is the random element in the attribute set, W represents the access policy, g is the generator of the multiplicative cyclic group, e is the bilinear mapping of the two multiplicative cyclic groups, I represents the set of attribute indices related to the access policy, C3' represents the ciphertext intermediate value, and C4' represents the ciphertext intermediate value.

[0106] The intermediate ciphertext CT′ = {W, C′, C′1, C′2, C′3, C′4} is obtained. This is executed by the AM, which takes the public key PK and the intermediate ciphertext CT′ as input. The AM then obtains the final ciphertext CT and the ciphertext header Hdr. After the DO sends the intermediate ciphertext, the AM receives it and can begin processing and decryption. By obtaining the intermediate ciphertext, the AM can continue with subsequent calculations or decryption steps to complete a specific task or obtain the required information. Next, the AM randomly selects k. i ∈Z p ,calculate C3 = C′3, C2 = C′2, C1 = C′1, C = C′, C, C1, C2, C3, and C4 are different components of the ciphertext, thus deriving the ciphertext and the ciphertext header:

[0107] CT = {C, C1, C2, C3, C4}

[0108]

[0109] Where, k i It is a p-order multiplicative cyclic group Z p Let i be a random element in the attribute set, W represent the access strategy, g be the generator of the multiplicative cyclic group, e be the bilinear mapping between the two multiplicative cyclic groups, and E be the inequality of Euler's totient function. Random integers that are coprime, T is the encryption attribute, θ is the attribute encryption coefficient, Mincs represents the least common subset, v is the attribute variable, j represents a random element different from i, CT represents the ciphertext, and Hdr represents the ciphertext header.

[0110] During the AM's computation of the ciphertext CT, it generates a hash value H(CT) corresponding to the ciphertext and sends this hash value to the DO. It then sends (CT, Hdr) to the CSP for processing to ensure the security and integrity of data transmission and storage. Upon receiving the data, the CSP calculates the hash value of CT to derive H(CT) and generates a signature Sig. CSP (CT)=H(CT) D modn, Sig is the digital signature, and H(CT) represents the hash value of the ciphertext CT. When CSP receives the hash value and the signature, it will store the signature along with the data at location Lo. c Send the data to the DO (Data Encryption Controller) together so that the DO can read and process the data in subsequent operations. The data encryption process is as follows: Figure 3 As shown;

[0111] (7) User Cancellation

[0112] Executed by TA, the system takes into account the common parameters, the random number ai′, the new key version K′, and the user attribute set S′, and derives the updated data user key SK′. At this stage, for users whose accounts have not been revoked, TA selects a random number β′. Generate a new key version K, and calculate R = (g β′ ,e(g β ,H1(ID))), where g β =g β (H1(att i ) a′ ) t-i′ ,att i It is one of the attribute sets, where i represents an element in the attribute set, g is the generator of the multiplicative cyclic group G, e is a bilinear mapping, H is a hash function, ID is the user's pseudonym, β' is a random number, t is a random number in the p-order multiplicative cyclic group, and α is a random value; because S′=S, a′ i =a i The user attribute set (i = 1, 2, ..., n) and its corresponding random value remain unchanged; the key is then updated after calculation. S Ki = SK i. Users whose access has not been revoked can continue to access the site. For users whose access has been revoked, their corresponding attribute set S′=S\{att i}, select a new random number a′ i ≠a i (i = 1, 2, ..., n), therefore, users whose keys have been revoked will not receive the random number β' in the new key version K. Because of the lack of relevant information, a valid key could not be obtained. SK i.

[0113] Preferably, the power data privacy and security protection method based on ciphertext policy attribute base encryption further includes the generation of keys for individual users by an AM, and the specific operations for AM generation are as follows:

[0114] When a user accesses the system, the system will obtain a globally unique identification information G from AM. IDu ∈{0,1} * Next, the system will use the set of attributes provided by the user. The process is performed to obtain the corresponding user key SK and transformation key TK. These operations are implemented by AM:

[0115] ① Select three natural numbers r, t, z ∈ G, where G represents a multiplicative cyclic group, and set the transformation key UK = z;

[0116] ② Calculate β = H(G) IDu H represents the hash function;

[0117] ③ For each attribute x∈S, calculate K x =(A x ) rtβ S represents the user's attribute set, x represents a single attribute in the attribute set S, and K x A represents the key component associated with attribute x. x The encrypted representation of the attribute value, r and t are randomly selected values, while β is the user's global identity identifier (GID) hashed using the hash function H. u The value obtained after processing;

[0118] ④ Calculate K respectively u L u The values ​​of D and G L u =g zrt D = g αr h b ;

[0119] ⑤ Set the user key SK = (K u L u , {K x} x∈S ,D,E), calculate K=(K u ) 1 / z L = (L u ) 1 / z Set the conversion key TK = (K, L, {K x} x∈S ), where D is the private key exponent in the symmetric encryption algorithm, and E is the exponent of the Euler totient function. K are random integers that are coprime to each other. x It is the key corresponding to attribute x, K and L are part of the conversion key TK, and Ku and Lu are part of the key used to generate the user key.

[0120] Preferably, the power data privacy and security protection method based on ciphertext policy attribute base encryption also includes a smart contract interaction process, including a fair trading contract (FTC), a result verification contract (RVC), and a result receiving contract (RRC). The operation flow of the three smart contracts is as follows:

[0121] The smart contract FTC is responsible for ensuring that the user has prepaid the corresponding search fee before the search operation begins. After the server provides the search results, another smart contract RVC will intervene to verify the correctness and completeness of the results. Only when the results meet the established standards and requirements can the server obtain the reward it deserves from the contract. If the results fail to pass the verification, the smart contract will automatically trigger the refund mechanism to return the prepaid fee to the user.

[0122] Example 2

[0123] A method for protecting the privacy and security of power data based on ciphertext policy attribute base encryption, the specific steps of which are as follows:

[0124] First, the Trusted Authorization Center (TA) initializes the system, inputs relevant parameters, defines a bilinear mapping e, defines a hash function H, selects a random element as the system attribute definition value, and then selects a random number from the multiplicative cyclic group.

[0125] Through calculation and This yields the system's public key PK and master private key MSK. Further, the Trusted Authorization Center (TA) inputs the public key PK, selects two prime numbers, calculates their product n, and then calculates the product n using 1 and Euler's totient function. Choose an integer E from the set, and E is the same as... The numbers are coprime. The public key CPK and private key CSK of the CSP are calculated based on the parameters.

[0126] The system public key PK is input by the data owner DO. A similar method can also be used to generate the data owner DO's public key DPK and private key DSK.

[0127] After system initialization and setup are complete, the user registration process begins. Based on the set of attribute information submitted by the user, the system will automatically generate a user-specific key SK and a key TK for data conversion.

[0128] When a user connects to the system, the system will obtain a globally unique identification information G from the Property Manager AM. IDu ∈{0,1} * .

[0129] The system will process the attribute set s provided by the user, select three natural numbers, and set the conversion key UK=z.

[0130] The corresponding user key SK and conversion key TK are obtained by using certain algorithms and methods.

[0131] Calculate β = H(G) IDu For each attribute value x, calculate K. x K u L u The values ​​of D and E.

[0132] Set the user key SK = (K u ,L u , {K x} x∈S , D, E), calculate K = (K u ) 1 / z L = (L u ) 1 / zSet the conversion key TK = (K, L, {K} x} x∈S ).

[0133] After completing user registration and entering the data processing phase, the data owner (DO) must first access the blockchain network to obtain the crucial system parameter (PP) before starting any tasks. During system downtime, the DO will perform pre-defined offline computation tasks. Upon receiving the electricity dataset N, the DO will immediately initiate an online hybrid encryption process to generate the corresponding encrypted data (CT). This encryption process consists of two phases: offline and online. In the online phase... DO Select a symmetric key K ey, and on the data N Perform double encryption calculations to generate encrypted versions of the two data points, C f and Choose access strategy (M,9) such that q(i) = x maps row number i of matrix M to attribute x.

[0134] Select a random number s as the shared secret value, and then select another random number. Set vector make Calculate share λ i As a secret shared value of s.

[0135] Calculate C, C1, C0, C′0, f i And set C i =W q(i) .

[0136] During the offline phase, a random number s′ is selected, and W = (P) is calculated. K ) s W0 = g s W0 = h s For attribute x∈ATT, select another random number λ′ x ,calculate

[0137] Smart contracts are deployed on the blockchain, with built-in logic used to verify user attributes and distribute decryption keys. Users generate an attribute proof containing their attribute information but not revealing the specific attribute values. The smart contract verifies the attribute proof submitted by the user to ensure that the user has the permission to access the data.

[0138] The data encryption step is implemented by the data owner, DO, whose input parameters include the public key PK, the original data data, and the access policy W. During the key generation phase, DO randomly selects a temporary symmetric key k within the key space and uses this key to encrypt the original data data data. During encryption, an access tree constructed based on the access policy W is used, combined with a selected random number s, to perform the necessary calculations C′1=k·e(g, g). as C′2=g s After completing this series of encryption steps, the resulting encrypted data is then securely transmitted to the recipient.

[0139] To identify unread non-leaf nodes, set 's' to the value of the root node and mark the root node as read. Simultaneously, change the state of all its child nodes to unread.

[0140] By performing recursive operations, the entire tree structure is systematically traversed to accurately identify non-leaf nodes that are not yet read. During the recursion, each node is checked to determine if it is a non-leaf node and if it is not yet read. Once the unread non-leaf nodes are identified, appropriate processing operations can be performed according to actual needs, such as updating the node's state or executing specific logic. This method effectively helps us manage and manipulate data within the tree structure.

[0141] When child nodes are in an unread state, if the non-leaf node is an AND gate, the encryption operation can only be performed after all child nodes have been read. For the last non-leaf node, DO will set the node as read before performing the computation.

[0142] When a non-leaf node is scanned, if there are unread nodes among its child nodes, and the non-leaf node is an OR gate, then the non-leaf node needs to be marked as read. Simultaneously, the values ​​of all unread child nodes are set to a specific value s.

[0143] The intermediate ciphertext CT′ = {W, C′, C′1, C′2, C′3, C′4} is calculated and executed by the Attribute Manager (AM). The AM receives the public key PK and the intermediate ciphertext CT′ after the DO sends it. Once the AM obtains the intermediate ciphertext, it can begin the corresponding processing and decryption operations. By acquiring the intermediate ciphertext, the AM can continue with subsequent calculations or decryption steps to complete specific tasks or obtain necessary information.

[0144] Attribute Manager AM randomly selects k i ∈Z p Calculate C4, C3, C2, C1, and C to obtain the final ciphertext CT and ciphertext header Hdr.

[0145] During the encryption process, the Attribute Manager (AM) not only calculates the ciphertext CT but also generates the corresponding hash value H(CT). AM then passes this hash value to the data owner (DO), who further processes it through the cloud service provider (CSP). This continuous process aims to ensure data security and integrity during transmission and storage.

[0146] After receiving the data, the cloud service provider (CSP) calculates the hash value of CT to derive H(CT) and generates a signature Sig. CSP (CT)=H(CT) D mod n, when the CSP receives the hash value and signature, it will send the signature along with the data storage location Loc to the DO, so that the DO can read and process the data in subsequent operations.

[0147] Finally, the data decryption operation is performed by the data user DU, who inputs the public key PK, private key SK, ciphertext CT, ciphertext header Hdr, and group key KEK. At this stage, DU sends a request to the blockchain to obtain the necessary transaction information and then waits for the blockchain to return the corresponding transaction record.

[0148] Data user DU will store the encrypted data at location Lo. c As a parameter, a request is sent to the CSP to obtain the encrypted information.

[0149] Once a data user (DU) receives the encrypted text, they perform a hash function on it. The DU then compares the resulting hash value with the corresponding hash value H(CT) pre-stored in the blockchain. This process ensures the integrity and verifiability of the data.

[0150] When the two H(CT) values ​​are the same, the ciphertext returned by the CSP can be confirmed to be complete and error-free. When the two H(CT) values ​​are different, the correctness of the ciphertext cannot be confirmed, and the decryption operation cannot be completed. Through this verification process, the data owner DU can confidently decrypt the ciphertext and obtain a reliable plaintext result.

[0151] By performing the decryption operation DU using Data = Dec(k, C), the symmetric key k can be successfully obtained, thus enabling the decryption of the ciphertext information and the restoration of the plaintext document.

[0152] Finally, for the user group whose accounts have not been revoked, the authorizing agency TA will select a random number β'. A new version K of the key is generated, and the key SK is updated after the calculation is complete. i ′=SK i This ensures that these users can continue to access the data. For users whose accounts are revoked, their attribute set will be modified, and a new random number 'a' will be selected.i ' ≠ a i (i = 1, 2,..., n), so that those users whose access rights are revoked will not be able to obtain the random number information β' in the new key version K, and t' = Z p * related information, resulting in their inability to obtain a valid access key SK i '.

[0153] Use the pairing-based cryptography (PBC) library for simulation experiments. According to the evaluation methods in the literature

[16] XU Shengwei, WANG Feijie. Attribute-based encryption scheme traced under multi-authority [J]. Netinfo Security, 2020, 20(1): 33 - 39 (in Chinese). [Xu Shengwei, Wang Feijie. Traceable and hidden attribute-based encryption scheme under multi-authority [J]. Information Network Security, 2020, 20(1): 33 - 39.] and the literature

[17] Yao W, Han J, Li J, et al. User collusion avoidance CP-ABE with efficient attribute revocation for cloud storage [J]. IEEE Systems Journal, 2021, 12(2): 767 - 1777. Conduct experimental evaluations. In the experimental evaluations, the method of the present invention has a slightly increased encryption time under the same number of attributes because additional bilinear calculations are introduced to maintain the consistency of the ciphertext length, increasing the computational burden. However, compared with high storage cost schemes such as those described in the literature 16 and the literature 17 TA The storage overhead is 2|Z p | 、 4|Z p | , TA The storage overhead is mainly determined by the length of the system master private key, and the overhead required by the scheme of the present invention is |G1| + n u |Z p |, G is a multiplicative cyclic group, n u represents the number of system attributes, Z p is a multiplicative cyclic group with order p. The present invention demonstrates the advantage of low storage overhead, indicating its significant advantage in storage optimization with a slight compromise in encryption time. See Figure 5 and Figure 6 shown ( Figure 5 and Figure 6 The specific operation methods are carried out according to the method of Embodiment 2).

[0154] This invention proposes a method for protecting the privacy and security of power data based on ciphertext policy attribute-based encryption. This method studies the protection of power data privacy and security from five aspects: system initialization, user registration, data processing, data encryption, and data decryption. In this invention, blockchain technology is used to effectively address the dependence on centralized entities in traditional condition-based attribute-based encryption (CP-ABE) schemes, thereby eliminating the risk of single points of failure. Simultaneously, this invention introduces smart contract technology to execute ciphertext policy attribute-based encryption, providing an innovative solution for the encrypted processing of power data. Furthermore, this invention involves securely storing the symmetric decryption key on a cloud server, while recording core information such as data digests and file storage locations on the blockchain. This strategy provides strong privacy protection during power data transmission, ensuring that data security and privacy are effectively maintained. Finally, the access policy is transformed into an access tree structure and completely hidden in the ciphertext. A user revocation algorithm is designed using a chameleon hash function. This strategy not only effectively curbs unauthorized access but also prevents potential data tampering by the cloud server. Thus, the privacy and security of power data are effectively strengthened and guaranteed.

[0155] Compared to traditional public-key encryption schemes, attribute-based encryption methods that utilize smart contracts to implement ciphertext policies effectively reduce the risk of data tampering by cloud servers. This method transforms the access policy into an access tree structure and completely hides the policy within the ciphertext, ensuring its concealment. Combined with a chameleon hash function, a user revocation mechanism was designed, which not only effectively mitigates the risk of unauthorized access but also enhances data security and confidentiality. Applying this method, the privacy of electricity data is comprehensively protected. Through comparative experimental testing, under five different access strategies, the encryption and decryption times of this invention are significantly shorter. File sizes range from 1000KB to 8000KB, increasing by 1000KB each time. When the file size is 1000KB, the encryption time is comparable to the scheme proposed in Reference 17 and superior to the scheme proposed in Reference 16. In each stage from 2000KB to 8000KB, the encryption time of the proposed scheme is significantly shorter than that of References 16 and 17. During decryption, when the file size is between 1000KB and 3000KB, the decryption time of this scheme is comparable to that of Reference 17 and significantly superior to that of Reference 16. However, in the stage from 4000KB to 8000KB, the proposed scheme is significantly shorter than that of References 16 and 17. In summary, the ciphertext policy attribute-based encryption technology implemented using smart contracts provides a solution for enhanced data protection. This approach not only enhances data security and confidentiality but also optimizes data sharing and processing workflows, improving overall efficiency. Through the automation capabilities of smart contracts and precise access control via attribute-based encryption, this scheme ensures that data can only be accessed under specific conditions, thereby promoting the rational use of data while protecting privacy.

[0156] Although embodiments of the invention have been disclosed for illustrative purposes, those skilled in the art will understand that various substitutions, variations, and modifications are possible without departing from the spirit and scope of the invention and the appended claims. Therefore, the scope of the invention is not limited to the contents disclosed in the embodiments.

Claims

1. A ciphertext policy attribute-based encryption based power data privacy security protection method using a power data privacy security protection system, the power data privacy security protection system comprising an entity data role owner DO, a data user DU, a trusted authority center TA, a blockchain BC, a cloud service provider CSP and an attribute manager AM; wherein The entity data role owner DO can select key encrypted data and update the key using the ciphertext sent by the attribute manager AM, the data user can generate an identity identifier to build a private key and verify data integrity, the trusted authority center can generate a private key and an attribute group initial key and update the attribute group key when attribute revocation occurs, the blockchain can publish attribute state change information and record the mapping relationship between the data user DU and the attribute set, the cloud service provider can sign the hash value of the ciphertext and ensure the integrity and credibility of the data, and the attribute manager can re-encrypt the ciphertext and ensure that the cloud service provider CSP does not collude when revocation occurs, characterized in that it comprises the following steps: (1) System initialization System initialization is performed by a trusted authority center TA, and security parameters are input and attribute U, and system public key PK and system master secret key MSK are obtained; the TA defines a bilinear mapping, , G and G T represent a multiplicative cyclic group, the generator of G is g, and the order of G is a prime number p; for constructing the system, the TA selects a hash function to ensure data security and privacy, and at the same time, the TA also selects a random element , representing a random element in a multiplicative cyclic group of order p, is a multiplicative cyclic group of order p, and n values are defined for system attributes, , representing system attribute definition values, and att represents system attribute values, i represents a random number greater than or equal to 1 and less than or equal to n; each attribute can take multiple values, and can be represented as , representing a system attribute value set, b represents a random number related to the attribute, and i represents a random number greater than or equal to 1 and less than or equal to n; then, the TA selects a random number p from Z , calculates , , z i,bi is a random number in a multiplicative cyclic group of order p, g is a generator in a multiplicative cyclic group, Z i,bi is an encrypted representation of an attribute value, T i,bi is another element generated by the TA for the attribute value, and b i is a random number related to the attribute, so that the public key PK and the master secret key MSK of the system are obtained, which will be used for encrypting and decrypting data and realizing fine-grained access control; ; wherein denotes a bilinear map of a generator g of a multiplicative cyclic group, denotes the α-th power of a generator g of a multiplicative cyclic group G, the rest of the formula being as above. executed by the TA, inputting a public key PK, outputting a public key CPK and a private key CSK, the TA selects two prime numbers p and q, p represents a random prime number different from q, q represents a random prime number different from p, and calculates the product n = p q, thereafter, the TA selects a random integer E, , ensuring that E and the Euler function φ(n) of n are prime to each other, executed by the cloud service provider CSP, , D is a private key exponent in a symmetric encryption algorithm, E is a random integer prime to the Euler function φ(n), and the public key CPK and the private key CSK of the CSP are calculated according to these parameters, and CSK = D; executed by the entity role data owner DO, inputting a system public key PK, outputting a public key DPK and a private key DSK of the DO, and the private key DSK; (2) User registration A global identity identifier is used to identify a specific user, and a corresponding user key SK and a conversion key TK are generated according to the attribute set submitted by the user, the global identity identifier is a user identity recognition mechanism that can be shared between multiple applications and platforms to ensure safe access and processing of the user's data; (3) Data processing Before the entity role data owner DO starts processing work, it needs to connect to the blockchain network to obtain necessary system parameters PP, and perform offline pre-computation operation in idle time to ensure that the subsequent encryption process can be completed efficiently, once the DO receives the power data N, it will immediately perform online hybrid encryption operation to generate corresponding ciphertext data CT, this process can be divided into offline and online states; (4) Data encryption Executed by DO, input public key PK, plaintext data data, access policy W, output intermediate ciphertext In the key space, the DO randomly selects a symmetric key k to symmetrically encrypt the plaintext data Data.

2. The method of claim 1, wherein the method is a ciphertext-policy attribute-based encryption method for power data privacy security protection. The ciphertext policy attribute-based encryption based power data privacy security protection method further comprises generating a key for an individual user by the AM, and the specific operation of the AM is as follows: When a user accesses the system, the system will obtain a globally unique identity from the AM , then the system will process according to the attribute set provided by the user , and obtain the corresponding user key SK and conversion key TK, which are implemented by the AM ① Select three natural numbers r, t, z ∈ G, G represents a multiplicative cyclic group, and set the conversion key UK = z; ii. Calculate H denotes a hash function; iii. For each attribute x e S, compute S denotes the set of attributes of the user, x denotes a single attribute in the set of attributes S, K x denotes the key component associated with the attribute x, A x denotes the encrypted representation of the attribute value, r and t are randomly chosen values, and β is a value obtained by processing the user's global identity identifier GIDu through a hash function H; IV. The values of D are calculated respectively , , D, ; Setting a user key , calculating , setting a conversion key where D is a private key exponent in a symmetric encryption algorithm, E is a random integer that is prime to Euler's function φ(n), K x is a corresponding key of the attribute x, K, L are parts of the conversion key TK, Ku, Lu are parts used for generating a user key.

3. The method of claim 1 or 2, wherein the method is a ciphertext-policy attribute-based encryption method for power data privacy security protection. The ciphertext policy attribute-based encryption based power data privacy security protection method further comprises an intelligent contract interaction process, including a fair trade contract FTC, a result verification contract RVC and a result receiving contract RRC, and the operation processes of the three intelligent contracts are as follows: The intelligent contract FTC is responsible for ensuring that the user has pre-paid the corresponding search fee before the search operation starts, when the server provides the search results, another intelligent contract RVC will intervene to verify the correctness and integrity of the results, only when the results meet the established standards and requirements, the server can obtain the deserved remuneration from the contract, if the results fail to pass the verification, the intelligent contract will automatically trigger the refund mechanism to return the pre-paid fee to the user.

4. The method of claim 1, wherein the method is a ciphertext-policy attribute-based encryption method for power data privacy security protection. The step (3) further comprises the following steps: ① Online phase a) selecting a symmetric key , calculating two data ciphertexts of N, , N represents power data, C f and represent two data ciphertexts of N, Enc() represents a symmetric encryption algorithm, Key is a symmetric key, and H(N) represents a hash function of power data N; b) selecting an access strategy (M, q), M is a matrix of l rows and n columns, q is a single function, q(i) = x, which can map the row number i of the matrix M to the attribute x, i = 1, 2, …, n; c) Select a random number s, let , and select a random number , set vector , s is a random number belonging to the p order multiplicative cyclic group, is the p order multiplicative cyclic group, v2...v n are n random numbers belonging to the multiplicative cyclic group, is a vector composed of random numbers in the multiplicative cyclic group; d) for each row M i of the matrix M , compute a share , λ i is a computed share, M i is each row of the matrix M, is a vector, and T is the transpose symbol; e) calculating the value of , represents the ciphertext obtained by symmetrically encrypting the plaintext with the encryption key Key, represents the encryption parameter obtained by operating the public key PK with the random number s’, represents another encryption parameter obtained by operating the generator g with the random number s’, represents another encryption parameter obtained by operating the generator h with the random number s’. f) calculating , and setting ; The offline stage a) Select a random number , let , compute the value of denotes a public key; b) for attribute , another random number is chosen , the value of is calculated, A x denotes the function parameter of attribute x, h is a random element in the multiplicative cyclic group, W x is the encryption parameter calculated for attribute x, is a random number.

5. The method of claim 1, wherein the method is a ciphertext-policy attribute-based encryption method for power data privacy security protection. The step (4) further comprises the following steps: After the encryption operation is completed, the DO transmits the encrypted data to the recipient, and the recipient decrypts the data using the symmetric key k to obtain the plaintext data Data. , C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, Data represents the encrypted plaintext data, and the key encryption key tree method is used here. The DO converts the access policy W into an access tree, selects a random number s, and sets , calculates , , k is the symmetric key, g is the generator of the multiplicative cyclic group, α is a random element of the p-order multiplicative cyclic group, s is a random number of the p-order multiplicative cyclic group Z p , e is a bilinear mapping of two multiplicative cyclic groups. In order to determine the unread non-leaf nodes, first set s as the value of the root node, mark the node as read, and modify all child nodes to the unread state. Recursively operating in this way can accurately determine the unread non-leaf nodes and perform corresponding processing operations. ①When the child node is in the unread state, if the non-leaf node is an "and" gate, then the encryption operation can only be performed when all child nodes are read, that is, in the case of an "and" gate, all access attributes need to be met to perform the decryption operation, at which time the DO randomly selects , , s i is a random number in a multiplicative cyclic group, Z p is a multiplicative cyclic group of order p, and for the last non-leaf node, the DO will set the node as read and calculate the value , p is the order of the multiplicative cyclic group, s j is the last leaf node, s, s i is a random number in a multiplicative cyclic group, and mod is the modulus operator; If the non-leaf node is an "or" gate, the non-leaf node is marked as read, and the values of all unread child nodes are set to a specific value s, so that the value of the non-leaf node correctly reflects the state of its child nodes during logical calculation, and repeated calculation of read nodes is avoided. ; ; wherein Z i,bi is an encrypted representation of an attribute value, s is a random number selected in a multiplicative cyclic group, i is a random element in an attribute set, W represents an access policy, g is a generator of the multiplicative cyclic group, e is a bilinear mapping of two multiplicative cyclic groups, I represents an attribute index set related to the access policy, C 3' represents a ciphertext intermediate value, C 4' represents a ciphertext intermediate value; Derive intermediate ciphertext , input public key PK and intermediate ciphertext , derive final ciphertext CT and ciphertext header Hdr, After the DO sends the intermediate ciphertext, the AM obtains the ciphertext and can start the corresponding processing and decryption operations. By obtaining the intermediate ciphertext, the AM can continue subsequent calculation or decryption steps to complete a specific task or obtain the required information. Then, the AM randomly selects , calculate , , C, C1, C2, C3, C4 are different components of the ciphertext, so that the ciphertext and the ciphertext header are derived: ; wherein k i is a random element in a p-th order multiplicative cyclic group Z p , i is a random element in an attribute set, W represents an access policy, g is a generator of a multiplicative cyclic group, e is a bilinear mapping of two multiplicative cyclic groups, E is a random integer which is prime to Euler function φ(n), T is an encryption attribute, θ is an attribute encryption coefficient, Mincs represents a minimum common subset, v is an attribute variable, j represents a random element different from i, CT represents a ciphertext, Hdr represents a ciphertext header; In the process of computing the ciphertext CT in AM, it will generate the hash value H(CT) corresponding to the ciphertext and send it to DO, and send it to CSP for processing to ensure the security and integrity of data transmission and storage, and CSP will calculate the hash value of CT to obtain H(CT) and generate a signature Sig is a digital signature, H(CT) represents the hash value of the ciphertext CT, and when CSP receives the hash value and the signature, it will send the signature together with the data storage location Loc to DO.

6. The method of claim 1, wherein the method is a ciphertext-policy attribute-based encryption method for power data privacy and security protection. The method further comprises the following steps: (5) User revocation The TA executes, inputs the public parameter parameter, random number a, new key version K and user attribute set S, obtains updated data user key SK, and in this stage, a random number β' is selected for the user TA which is not revoked, i ' and the user attribute set S', to obtain an updated data user key SK', and in this stage, a random number β' is selected for the user TA which is not revoked, , is a p-order multiplicative cyclic group, a new key version K is generated, and , wherein , att is one of the attribute sets, i represents an element in the attribute set, g is a generator of the multiplicative cyclic group G, e is a bilinear mapping, H is a hash function, ID is a user alias, β' is a random number, t is a random number of the p-order multiplicative cyclic group, and α is a random value; because ; The set of user attributes and the corresponding random value remain unchanged, the key is updated after calculation The revoked user can continue to access, and the TA updates the corresponding attribute set for the revoked user Select a new random number Thus, the revoked user will not obtain the random number β' in the new key version K, The relevant information, so as to obtain the effective key .

Citation Information

Patent Citations

  • Internet of vehicles revocable data sharing method based on block chain and strategy hiding technology

    CN117579269A