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

By adopting a ciphertext policy attribute-based encryption system in the cloud environment of power data, combined with blockchain and smart contract technology, the problems of power data privacy security and access policy concealment are solved, and efficient data protection and security improvement are achieved.

CN119892452AActive Publication Date: 2025-04-25TIANJIN UNIV OF SCI & TECH +2

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when power data is stored and transmitted in a cloud environment, it is difficult to effectively ensure the privacy and security of data and the concealment of access policies, especially when user attributes are dynamically changed.

Method used

A system based on ciphertext policy attribute-based encryption is adopted, combined with blockchain and smart contract technology, to ensure the transparency and traceability of the data encryption and decryption process, and a user revocation algorithm is designed through the chameleon hash function to prevent unauthorized access.

Benefits of technology

It realizes efficient privacy protection for power data, ensures the security and integrity of data during transmission and storage, reduces the risk of data being tampered with and leaked, and improves the security and credibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892452A_ABST
    Figure CN119892452A_ABST
Patent Text Reader

Abstract

The invention 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, and the system comprises an entity role 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. According to the invention, the block chain platform is used to solve the single-point fault problem caused by dependence on a central entity in the traditional CP-ABE scheme, the encryption algorithm is executed by the smart contract, the symmetric decryption key is securely hosted on the cloud server, and key information such as a data abstract and a file position is stored on the block chain, so that the security of the symmetric decryption key is improved. And the transparency and traceability of the data are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power data encryption, and in particular to a power data privacy security protection system, method and application based on ciphertext strategy attribute-based encryption. Background Art

[0002] As the power industry embarks on its journey towards digital transformation, storing power data in a cloud environment has become a key initiative. Cloud computing technology provides a flexible and efficient data storage solution that allows storage resources to be virtualized and hosted on remote servers, allowing users to access these resources at any time as needed. This model is popular for its cost-effectiveness, enhanced data backup options, and the convenience of accessing data from any location. Power data not only includes information for real-time monitoring of the power grid status, but also covers fine-grained indicators such as power consumption, frequency fluctuations, and voltage levels, which are essential to ensure the efficient operation and reliability of the power grid. Given the high sensitivity of this type of data, it is crucial to ensure that it is properly protected in a cloud environment. This requires the implementation of strict security measures to prevent unauthorized access, tampering, or leakage of data, while ensuring that the confidentiality and integrity of the data are impeccably protected during storage and transmission.

[0003] The way to protect the privacy of power data is generally to encrypt it and adopt a multi-layer defense strategy to protect the data. Through advanced encryption technology and strict access control strategy, the risk of data being maliciously attacked is greatly reduced, while also ensuring compliance with industry compliance requirements. There is a strict theoretical proof that the use of attribute-based ecryption (ABE) can achieve privacy protection of power data. This method allows the definition of complex access control policies and controls data access rights through attribute sets rather than single user identities. This means that rich access rules can be created to meet diverse permission management needs. Unlike traditional public key encryption schemes, ABE can achieve scenarios where multiple users encrypt and decrypt at one time. As long as the attributes owned by the user meet the policies defined in the ciphertext or key, they can be successfully decrypted. This method has a good effect on the privacy protection of power data, but implementing ABE may require large computing resources and time, especially when dealing with large amounts of data or involving complex policies, it may be difficult to balance the contradiction between security and feasibility.

[0004] In the prior art, Sahai et al. proposed an advanced framework called "Revocable Attribute-Based Encryption" (Revocable ABE) based on attribute-based encryption technology. It provides a key capability for data owners: that is, they can also recover or revoke the decryption permissions they previously granted to users, provided that the users comply with the established access policy. This mechanism makes permission management more flexible and responsive, and can be applied in many practical scenarios, especially in environments where user permissions change frequently. However, the use of this scheme involves a series of complex cryptographic algorithms and carefully designed protocols to ensure that even if the user's private key is leaked or abused, the system can still effectively revoke the right to use these private keys. To achieve this, the existing ABE framework needs to be further expanded and optimized to support an efficient key revocation mechanism. In addition, the complexity of the system is further increased by the need to maintain additional lists for revocation, regularly update keys, and periodically re-encrypt data. Although this improvement has significantly improved the security and flexibility of the system, it also puts higher requirements on system design and management.

[0005] In the prior art, Zhao Zhiyuan et al. proposed an innovative and verifiable fully outsourced Ciphertext Policy Attribute-Based Encryption (CP-ABE) scheme. In this scheme, users are allowed to focus on their core business logic, and can completely entrust intensive computing tasks involving key generation, data encryption, and decryption processes to cloud servers. This outsourcing model not only takes advantage of the efficiency and flexibility of the cloud platform, but also significantly reduces the computing pressure and resource consumption of user devices, so that user devices can handle complex encryption operations without powerful computing power. However, in terms of key management, the number of key versions in the system may increase due to the need to support verifiability and outsourcing operations, making key management more complicated. Different versions of keys must be accurately synchronized and managed to ensure that the integrity and security of the data are not affected. In addition, with the increase in key versions, maintaining compatibility and update mechanisms between versions is also a new challenge.

[0006] In the process of digital transformation of the power industry, migrating key power data to the cloud environment has become a key step in promoting the development of the industry. As a flexible and efficient data storage solution, cloud computing 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. Once these data are leaked during the collection, transmission or analysis process, they may easily become prey for cyber attackers, resulting in serious economic losses and security risks. Therefore, it is crucial to ensure that these data are fully protected in the cloud environment to avoid any form of unauthorized access, tampering or leakage.

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

[0008] Therefore, one or several new related methods are urgently needed to ensure the security of power data. Summary of the invention

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

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

[0011] A power data privacy security protection system based on ciphertext policy attribute-based 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] Among them, the entity roles include data owners who can select keys to encrypt data and use the ciphertext sent by the attribute manager AM to update the keys, the data users who can generate identity identifiers to build private keys and verify data integrity, the trusted authorization center who can generate private keys and attribute group initial keys and update attribute group keys when attributes are revoked, the blockchain who can publish information such as attribute status changes and record the mapping relationship between data users DU and their attribute sets, the cloud service provider who can sign the hash value of the ciphertext and ensure the integrity and credibility of the data, and the attribute manager who can re-encrypt the ciphertext and ensure that there is no collusion with the cloud service provider CSP when revocation occurs.

[0013] Such as the application of the power data privacy and security protection system mentioned above in power data privacy and security protection.

[0014] The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system mentioned above includes the following steps:

[0015] (1) System initialization

[0016] The trusted authorization center TA initializes the system, inputs the security parameter λ and the attribute U, obtains the system public key PK and the system master private key MSK, and defines a bilinear mapping, e: G×G→G T , G and G T represents the multiplication cyclic group, the generator of G is g, and its order is a prime number p. To build this system, TA selected a hash function H: {0, 1}*→G to ensure the security and privacy of the data. At the same time, TA also selected a random element α∈Z p , α represents a random element in the p-factorial cyclic group, Z p is a multiplicative cyclic group of order p and defines n values ​​for the system properties, L n ={att i} 1≤i≤n , L n Indicates the system attribute definition value, att i Represents the system attribute value, i represents a random number greater than or equal to 1 and less than or equal to n, and each attribute can take n values. i Multiple values ​​can be expressed as represents the set of system attribute values, 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, TA starts from Z p A random number was chosen from calculate Z i,bi is a random number in the p-order multiplication cyclic group, g is a generator in the multiplication cyclic group, Z i,bi is the encrypted representation of the attribute value, T i,bi is another element generated by TA for the attribute value, b i It is a random number related to the attribute, which can be used to derive the system's public key PK and master private key MSK. These keys will be used to encrypt and decrypt data and implement fine-grained access control;

[0017]

[0018] Among them, e(g, g) a represents the bilinear map of the generator g of the multiplicative cyclic group, g a represents the generator g of the multiplicative cyclic group G to the power of α, and the rest of the formula is the same as above;

[0019] Executed by TA, input public key PK, output public key CPK and private key CSK, 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 their product n = p q, then TA selects a random integer E, Ensure that the Euler function of E and n Mutually prime numbers, cloud service provider CSP: D is the private key exponent in the symmetric encryption algorithm, and E is the Euler function Random integers that are prime to each other. Based on these parameters, the public key CPK of CSP is calculated, CPK = {E, n} and the private key CSK, CSK = D;

[0020] The entity role is executed by the data owner DO, inputs the system public key PK, and outputs the public key DPK and private key DSK of DO. A similar method can also be used to generate the public key DPK of the data owner DO, DPK = {E', n'} and the private key DSK. In this way, the security and uniqueness of the key are ensured for subsequent encryption, decryption and data transmission operations;

[0021] (2) User Registration

[0022] A global identity is used to identify a specific user, and the corresponding user key SK and conversion key TK are generated according to the attribute set submitted by the user;

[0023] (3) Data processing

[0024] Before the entity role data owner DO starts processing, it needs to connect to the blockchain network to obtain the necessary system parameters PP and perform offline pre-calculation operations in 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 operation of the system.

[0025] ①Online stage

[0026] a) Choose a symmetric key K ey , calculate the two data ciphertexts of N, N represents power data, C f and represents two data ciphertexts of N, Enc() represents the 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 a matrix with l rows and n columns, and q is an injective function, q(i) = x, which can map the row number i of the matrix M to the attribute x, i = 1, 2, ..., n;

[0028] c) Select a random number s, let As a shared secret value, and then choose a random number Set Vector s is a random number belonging to the p-order multiplicative cyclic group, is a p-order multiplicative cyclic group, v2…vn are n random numbers belonging to the multiplicative cyclic group, is a vector of random numbers in the multiplicative cyclic group;

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

[0030] e) Calculate the values ​​of C, C1, C0, C′0, C=K ev ×W, C1=ss′, C0=W0, C′0=W′0, C represents the ciphertext obtained by symmetric encryption of the plaintext and the encryption key Key, W represents the encryption parameter obtained by the operation of the public key PK and the random number s′, W0 represents another encryption parameter obtained by the operation of the generator g through the random number s′, and W′0 represents another encryption parameter obtained by the operation of the generator h through the 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 a public key;

[0034] b) For attribute x∈ATT, pick another random number λ′ x ,make Calculate The value of A x represents the function parameter of the property x, h is a random element in the multiplicative cyclic group, Wx is the encryption parameter calculated for attribute x,

[0035] λ′ x is a random number;

[0036] (4) Data encryption

[0037] Executed by DO, input public key PK, plaintext data data, access policy W, output intermediate ciphertext CT′, in the key space, DO will randomly select a symmetric key k to symmetrically encrypt the plaintext data Data, after completing the encryption operation, DO will transmit the encrypted data to the receiver, let C′ = Enc k (Data), C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, 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, selects a random number s, let 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 p-order multiplicative cyclic group Z p A random number, e is a bilinear map of two multiplication cycle groups. In order to determine the unread non-leaf nodes, first set s to the value of the root node, and mark the node as read, and modify all child nodes to unread. By performing recursive operations, the unread non-leaf nodes can be accurately determined and the corresponding processing operations can be performed.

[0038] ① When the child node is in the unread state, if the non-leaf node is an AND gate, the encryption operation can only be performed when all child nodes are read. That is to say, in the case of an AND gate, all access attributes must be met before the decryption operation can be performed. At this time, DO randomly selects s i ∈Z p , 1≤≤s i ≤p-1, si is a random number in the multiplicative cyclic group, Z p is a p-order multiplication cyclic group, and for the last non-leaf node, DO will set the node to be read and then calculate the value p is the order of the multiplication cyclic group, sj is the last leaf node, s and si are random numbers in the multiplication cyclic group, and mod is the modulus operator;

[0039] ② When scanning a non-leaf node, if there is an unread node in the child node of the node, and the non-leaf node is an "OR" gate, then the non-leaf node needs to be marked as read, and at the same time, the values ​​of all unread child nodes are set to a specific value s, and DO is calculated:

[0040]

[0041]

[0042] Among them, Z i,bi is the encrypted representation of the attribute value, s is a random number selected in the multiplicative cyclic group, i is a 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 two multiplicative cyclic groups, I represents the attribute index set 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}CT′={W,C′,C′1,C′2,C′3,C′4} is obtained and executed by AM. The public key PK and the intermediate ciphertext CT' are input to obtain the final ciphertext CT and the ciphertext header Hdr. After DO sends the intermediate ciphertext, AM can obtain the ciphertext and start the corresponding processing and decryption operations. By obtaining the intermediate ciphertext, AM can continue the subsequent calculation or decryption steps to complete a specific task or obtain the required information. Then, AM randomly selects k i ∈Z p ,calculate C3=C′3,C2=C′2,C1=C′1,C=C′,C、C1、C2、C3、C4 are different components of the ciphertext, thus the ciphertext and ciphertext header are obtained:

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

[0045]

[0046] Among them, k i is the p-th order multiplicative cyclic group Z p , i is a random element in the attribute set, W represents the access strategy, g is the generator of the multiplicative cyclic group, e is the bilinear map of two multiplicative cyclic groups, and E is the Euler function Random integers that are prime to each other, T is the encryption attribute, θ is the attribute encryption coefficient, Mincs represents the minimum 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] When AM calculates the ciphertext CT, it generates a hash value H(CT) corresponding to the ciphertext and sends the hash value to DO. It sends (CT, Hdr) to CSP for processing to ensure the security and integrity of data transmission and storage. After receiving it, CSP calculates the hash value of CT to obtain H(CT) and generates the signature SigCSP (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 signature, it will store the signature together with the data storage location Lo c Send it to DO together to facilitate DO to read and process the data in subsequent operations. The data encryption process is as follows Figure 3 As shown;

[0048] (6) User Revocation

[0049] Executed by TA, input public parameter parameter, random number ai′, new key version K′ and user attribute set S′, and obtain the updated data user key SK′. At this stage, for the unrevoked user, 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 is one of the attribute sets, i represents an element in the attribute set, g is the generator of the multiplicative cyclic group G, e is a bilinear map, H is a hash function, ID is the user alias, β' is a random number, t is a random number of 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 result and the corresponding random value remain unchanged, and the key SK is updated after calculation i =SK i , unrevoked users can continue to access, and for revoked users, TA updates the corresponding attribute set S′=S\{att i}, select a new random number a′ i ≠a i (i=1, 2, ..., n), thus, the revoked user will not obtain the random number β' in the new key version K. The relevant information of i The meanings of the letters in the formula are explained above.

[0051] The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system mentioned above is characterized by:

[0052] The power data privacy security protection method based on ciphertext policy attribute-based 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 identity information G from AM. IDu ∈{0, 1} * , then the system will use the attribute set provided by the user Processing is performed to obtain the corresponding user key SK and conversion key TK. These operations are implemented by AM:

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

[0055] ②Calculate β=H(G IDu ), H represents a 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, K x represents the key component associated with attribute x, A x represents the encrypted representation of the attribute value, r and t are randomly selected values, and β is the global identity identifier GID of the user through the hash function H u The value obtained by processing;

[0057] ④ Calculate K u , L u , the value of D, 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 Euler function Random integers that are prime to each other, Kx is the key corresponding to attribute x, K and L are part of the transformation key TK, and Ku and Lu are part of the key used to generate the user key.

[0059] The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system mentioned above is characterized by:

[0060] The power data privacy security protection method based on ciphertext policy attribute-based encryption also includes a smart contract interaction process, including a fair trade contract FTC, a result verification contract RVC, and a result reception contract RRC. The operation procedures of the three smart contracts are 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. When 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 deserved compensation from the contract. If the results fail to pass the verification, the smart contract will automatically trigger the refund mechanism and return the prepaid fees to the user.

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

[0063] 1. The present invention considers the data integrity, data confidentiality, access policy hiding of the project, etc., and proposes a power data privacy security protection method based on ciphertext policy attribute-based encryption to prevent the leakage of power data during the collection, transmission or analysis process, which may lead to serious economic losses and security risks. The present invention solves the single point failure problem caused by the reliance on central entities in the traditional CP-ABE solution by using a blockchain platform. The encryption algorithm is executed by a smart contract, the symmetric decryption key is securely hosted on the cloud server, and key information such as data summary and file location is stored on the blockchain, ensuring the transparency and traceability of the data.

[0064] 2. In the present invention, the plain text of the data is first encrypted by a symmetric encryption algorithm, and then the symmetric key is encrypted by using the CP-ABE technology to achieve precise control of data access rights. In order to further improve security, the access policy is converted into an access tree structure and cleverly embedded in the ciphertext, so that the policy itself is effectively hidden.

[0065] 3. The user revocation algorithm constructed by the present invention using the Chameleon hash function can ensure that once the user's access rights are revoked, they will not be able to obtain new key information and thus cannot decrypt data. This comprehensive design not only ensures the security and integrity of the data, but also realizes the reliable storage and privacy protection of data in the cloud environment through a trusted audit mechanism, thereby enhancing the security and efficiency of the entire system.

[0066] 4. The present invention realizes data security encryption, flexible attribute management, efficient blockchain recording, data integrity verification and anti-collusion design by clearly dividing the roles of data owners, data users, trusted authorization centers, blockchains, cloud service providers and attribute managers, effectively protecting the privacy security and integrity of power data and improving the security and credibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0068] Figure 2 This is a flow chart of smart contract interaction in the present invention;

[0069] Figure 3 This is a data encryption flow chart of the present invention;

[0070] Figure 4 This is a data decryption flow chart of the present invention;

[0071] Figure 5 It is a diagram of encryption time of different file sizes based on the method of the present invention;

[0072] Figure 6 The figure is a decryption time diagram of different file sizes based on the method of the present invention. DETAILED DESCRIPTION

[0073] The present invention will be further described in detail below in conjunction with specific examples. The following examples are only illustrative and not restrictive, and the protection scope of the present invention cannot be limited thereto.

[0074] The various experimental operations involved in the specific embodiments are all routine techniques in the field. For the parts not particularly annotated in the present invention, ordinary technicians in the field can implement them by referring to various commonly used reference books, scientific and technological literature or related instructions, manuals, etc. before the filing date of the present invention.

[0075] Example 1

[0076] A power data privacy security protection system based on ciphertext policy attribute-based encryption, such as Figure 1 As shown in the figure, the system includes entity roles such as data owner (DO), data user (DU), trusted authorization center (TA), blockchain (Blockchain c hain, BC), Cloud Service Providers (CSP) and Attribute Manager (AM);

[0077] Among them, the entity roles include data owners who can select keys to encrypt data and use the ciphertext sent by the attribute manager AM to update the keys, the data users who can generate identity identifiers to build private keys and verify data integrity, the trusted authorization center who can generate private keys and attribute group initial keys and update attribute group keys when attributes are revoked, the blockchain who can publish information such as attribute status changes and record the mapping relationship between data users DU and their attribute sets, the cloud service provider who can sign the hash value of the ciphertext and ensure the integrity and credibility of the data, and the attribute manager who can re-encrypt the ciphertext and ensure that there is no collusion with the cloud service provider CSP when revocation occurs.

[0078] The present invention realizes data security encryption, flexible attribute management, efficient blockchain recording, data integrity verification and anti-collusion design by clearly dividing the roles of data owners, data users, trusted authorization centers, blockchains, cloud service providers and attribute managers, effectively protecting the privacy security and integrity of power data and improving the security and credibility of the system.

[0079] The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system as described above is used, such as Figures 2 to 4 As shown, the following steps are included:

[0080] (1) System initialization

[0081] The trusted authorization center TA initializes the system, inputs the security parameter λ and the attribute U, obtains the system public key PK and the system master private key MSK, and defines a bilinear mapping, e: G×G→G T , G and G T represents the multiplication cyclic group, the generator of G is g, and its order is a prime number p. To build this system, TA selected a hash function H: {0, 1}*→G to ensure the security and privacy of the data. At the same time, TA also selected a random element α∈Z p , α represents a random element in the p-factorial cyclic group, Z p is a multiplicative cyclic group of order p and defines n values ​​for the system properties, L n ={att i} 1≤i≤n , L n Indicates the system attribute definition value, att i Represents the system attribute value, i represents a random number greater than or equal to 1 and less than or equal to n, and each attribute can take n values. i Multiple values ​​can be expressed as represents the set of system attribute values, 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, TA starts from Zp A random number was chosen from calculate z i,bi is a random number in the p-order multiplication cyclic group, g is a generator in the multiplication cyclic group, Z i,bi is the encrypted representation of the attribute value, T i,b i is another element generated by TA for the attribute value, b i It is a random number related to the attribute, which can be used to derive the system's public key PK and master private key MSK. These keys will be used to encrypt and decrypt data and implement fine-grained access control;

[0082]

[0083] Among them, e(g, g) a represents the bilinear map of the generator g of the multiplicative cyclic group, g a represents the generator g of the multiplicative cyclic group G to the power of α, and the rest of the formula is the same as above;

[0084] Executed by TA, input public key PK, output public key CPK and private key CSK, 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 their product n = p q, then TA selects a random integer E, Ensure that the Euler function of E and n Mutually prime numbers, cloud service provider CSP: D is the private key exponent in the symmetric encryption algorithm, and E is the Euler function Random integers that are prime to each other. Based on these parameters, the public key CPK of CSP is calculated, CPK = {E, n} and the private key CSK, CSK = D;

[0085] The entity role is executed by the data owner DO, inputs the system public key PK, and outputs DO's public key DPK and private key DSK. A similar method can also be used to generate the public key DPK of the data owner DO. DPK ={ E , n} and private key DSK, in this way, the security and uniqueness of the key are ensured for subsequent encryption, decryption and data transmission operations;

[0086] (4) User Registration

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

[0088] (5) Data processing

[0089] Before the entity role data owner DO starts processing, it needs to connect to the blockchain network to obtain the necessary system parameters PP and perform offline pre-calculation operations in 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 operation of the system.

[0090] ①Online stage

[0091] a) Choose a symmetric key K ey , calculate the two data ciphertexts of N, N represents power data, C f and represents two data ciphertexts of N, Enc() represents the 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 matrix with 1 row and n columns, and q is an injective function, q(i) = x, which can map the row number i of the matrix M to the attribute x, i = 1, 2, ..., n;

[0093] c) Select a random number s, let As a shared secret value, and then choose a random number Set Vector s is a random number belonging to the p-order multiplicative cyclic group, is a p-order multiplicative cyclic group, V2···vn are n random numbers belonging to the multiplicative cyclic group, is a vector of random numbers in the multiplicative cyclic group;

[0094] d) For each row Mi of the matrix M, calculate the share λ i As the secret shared value of s, let λ i is the calculation share, Mi is each row of the matrix M, is a vector, T is the transpose symbol;

[0095] e) Calculate the values ​​of C, C1, C0, C′0, C=K ev ×W, C1=ss, C0=W0, C0=W0, C represents the ciphertext obtained by symmetric encryption of the plaintext and the encryption key Key, W represents the encryption parameter obtained by the operation of the public key PK and the random number s', W0 represents another encryption parameter obtained by the operation of the generator g through the random number s', and W′0 represents another encryption parameter obtained by the operation of the generator h through the 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 a public key;

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

[0100] (4) Data encryption

[0101] Executed by DO, input public key PK, plaintext data data, access policy W, output intermediate ciphertext CT In the key space, DO will randomly select a symmetric key k to symmetric encrypt the plaintext data Data. After completing the encryption operation, DO transmits the encrypted data to the receiver. Let C′=Enc k (Data), C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, 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, selects a random number s, let s∈Z p , calculate C′1=k·e(g,g) as , 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 p-order multiplicative cyclic group Z p A random number, e is a bilinear map of two multiplication cycle groups. In order to determine the unread non-leaf nodes, first set s to the value of the root node, and mark the node as read, and modify all child nodes to unread. By performing recursive operations, the unread non-leaf nodes can be accurately determined and the corresponding processing operations can be performed.

[0102] ① When the child node is in the unread state, if the non-leaf node is an AND gate, the encryption operation can only be performed when all child nodes are read. That is to say, in the case of an AND gate, all access attributes must be met before the decryption operation can be performed. At this time, DO randomly selects s i ∈Z p , 1≤s i ≤p-1, si is a random number in the multiplicative cyclic group, Z p is a p-order multiplication cyclic group, and for the last non-leaf node, DO will set the node to be read and then calculate the value p is the order of the multiplication cyclic group, sj is the last leaf node, s and si are random numbers in the multiplication cyclic group, and mod is the modulus operator;

[0103] ② When scanning a non-leaf node, if there is an unread node in the child node of the node, and the non-leaf node is an "OR" gate, then the non-leaf node needs to be marked as read, and the values ​​of all unread child nodes are set to a specific value s. This ensures that when performing logical calculations, the value of the non-leaf node can correctly reflect the status of its child nodes and avoid repeated calculations of read nodes. DO performs calculations:

[0104]

[0105] Among them, Z i,bi is the encrypted representation of the attribute value, s is a random number selected in the multiplicative cyclic group, i is a 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 two multiplicative cyclic groups, I represents the attribute index set 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}CT′={W,C′,C′1,C′2,C′3,C′4} is obtained and executed by AM. The public key PK and the intermediate ciphertext CT' are input to obtain the final ciphertext CT and the ciphertext header Hdr. After DO sends the intermediate ciphertext, AM can obtain the ciphertext and start the corresponding processing and decryption operations. By obtaining the intermediate ciphertext, AM can continue the subsequent calculation or decryption steps to complete a specific task or obtain the required information. Then, AM randomly selects k i ∈Z p ,calculate C3=C′3,C2=C′2,C1=C′1,C=C′,C、C1、C2、C3、C4 are different components of the ciphertext, thus the ciphertext and ciphertext header are obtained:

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

[0108]

[0109] Among them, k i is the p-th order multiplicative cyclic group Z p , i is a random element in the attribute set, W represents the access strategy, g is the generator of the multiplicative cyclic group, e is the bilinear map of two multiplicative cyclic groups, and E is the Euler function Random integers that are prime to each other, T is the encryption attribute, θ is the attribute encryption coefficient, Mincs represents the minimum 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] When AM calculates the ciphertext CT, it generates a hash value H(CT) corresponding to the ciphertext and sends the hash value to DO. It sends (CT, Hdr) to CSP for processing to ensure the security and integrity of data transmission and storage. After receiving it, CSP calculates the hash value of CT to obtain H(CT) and generates the signature Sig CSP (CT)=H(CT) D modn, Sig is the digital signature, H(CT) represents the hash value of the ciphertext CT. When CSP receives the hash value and signature, it will store the signature together with the data storage location Lo c Send it to DO together to facilitate DO to read and process the data in subsequent operations. The data encryption process is as follows Figure 3 As shown;

[0111] (7) User Revocation

[0112] Executed by TA, input public parameter parameter, random number ai′, new key version K′ and user attribute set S′, and obtain the updated data user key SK′. At this stage, for the unrevoked user, 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 is one of the attribute sets, i represents an element in the attribute set, g is the generator of the multiplicative cyclic group G, e is a bilinear map, H is a hash function, ID is the user alias, β' is a random number, t is a random number of the p-order multiplicative cyclic group, and α is a random value; because S'=S, a' i =a i (i=1,2,...,n) The user attribute set and the corresponding random value remain unchanged, and the key is updated after calculation S Ki= SK i, unrevoked users can continue to access, and for revoked users, TA updates the corresponding attribute set S′=S\{att i}, select a new random number a′ i ≠a i (i=1, 2, ..., n), thus, the revoked user will not obtain the random number β' in the new key version K. The relevant information of SK i.

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

[0114] When a user accesses the system, the system will obtain a globally unique identity information G from AM. IDu ∈{0, 1} * , then the system will use the attribute set provided by the user Processing is performed to obtain the corresponding user key SK and conversion key TK. These operations are implemented by AM:

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

[0116] ②Calculate β=H(G IDu ), H represents a 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, K x represents the key component associated with attribute x, A x represents the encrypted representation of the attribute value, r and t are randomly selected values, and β is the global identity identifier GID of the user through the hash function H u The value obtained by processing;

[0118] ④ Calculate K u , L u , the value of D, G, L u =g zrt , D = g αr h b ;

[0119] ⑤Set 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 Euler function Random integers that are prime to each other, K x is the corresponding key of attribute x, K and L are part of the transformation key TK, and Ku and Lu are part of the key used to generate the user key.

[0120] Preferably, the power data privacy security protection method based on ciphertext policy attribute-based encryption also includes a smart contract interaction process, including a fair trade contract FTC, a result verification contract RVC, and a result reception contract RRC. The operation procedures of the three smart contracts are 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. When 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 deserved compensation from the contract. If the results fail to pass the verification, the smart contract will automatically trigger the refund mechanism and return the prepaid fees to the user.

[0122] Example 2

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

[0124] First, the trusted authorization center TA initializes the system, inputs relevant parameters, defines the bilinear map e, defines the hash function H, selects random elements as the system attribute definition values, and then selects random numbers in the multiplication cycle group.

[0125] By calculation and Thus, the system's public key PK and master private key MSK are obtained. Further, the trusted authorization center TA inputs the public key PK, selects two prime numbers and calculates their product n, and then multiplies them by 1 and the Euler function. Select an integer E from the set of The public key CPK and private key CSK of CSP are calculated based on the parameters.

[0126] The data owner DO inputs the system public key PK, and a similar method can also be used to generate the public key DPK and private key DSK of the data owner DO.

[0127] After the system is initialized and set up, the user registration process begins. Based on the attribute information set 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 accesses the system, the system obtains a globally unique identity information G from the attribute 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 , D, E values.

[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 / z, set 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 key system parameters PP before starting to process the task. During the idle period of the system, DO will perform the pre-planned offline calculation tasks. When DO receives the power data set N, it will immediately start the online hybrid encryption process to generate the corresponding encrypted data CT. The encryption process is divided into two stages: offline and online. In the online stage, DO A symmetric key will be selected K ey, and the data N Perform double encryption calculation to generate two encrypted versions of the data, C f and Select access strategy (M,9) so that q(i) = x to map row number i of matrix M to attribute x.

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

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

[0136] In the offline phase, a random number s′ is selected and W=(P 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 to verify user attributes and perform the distribution of decryption keys. Users generate an attribute proof that contains their attribute information but does not reveal the specific attribute value. Smart contracts verify the attribute proof submitted by the user to ensure that the user has the right to access the data.

[0138] The data encryption step is implemented by the data owner DO, and its input parameters include the public key PK, the original data data, and the access policy W. In the key generation phase, DO randomly selects a temporary symmetric key k in the key space and uses this key to encrypt the original data Data. During the encryption process, the access tree constructed based on the access policy W is used, and a selected random number s is combined to perform the necessary calculation 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 delivered to the recipient.

[0139] In order to identify unread non-leaf nodes, s is set to the value of the root node, and the root node is marked as read. At the same time, the status of all its child nodes is changed to unread.

[0140] By performing recursive operations, the entire tree structure is systematically traversed to accurately determine the non-leaf nodes that are in an unread state. During the recursive process, each node is checked to determine whether it is a non-leaf node and whether it is in an unread state. Once the unread non-leaf nodes are determined, we can perform corresponding processing operations according to actual needs, such as updating the node status, executing specific logic, etc. This method can effectively help us manage and operate the data in the tree structure.

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

[0142] When a non-leaf node is scanned, if there is an unread node in the child node of the node, and the non-leaf node is an "OR" gate, then the non-leaf node needs to be marked as read. At the same time, 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 public key PK and the intermediate ciphertext CT′ are input. After DO sends the intermediate ciphertext, AM obtains the ciphertext and can start the corresponding processing and decryption operation. By obtaining the intermediate ciphertext, AM can continue the subsequent calculation or decryption steps to complete a specific task or obtain the required information.

[0144] The attribute manager AM randomly selects k i ∈Z p , calculate C4, C3, C2, C1, C, and 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). Subsequently, AM passes this hash value to the data owner DO, and further processed by the cloud service provider CSP. This continuous step is designed to ensure the security and data integrity of the data during transmission and storage.

[0146] After receiving the data, the cloud service provider CSP calculates the hash value of CT to obtain H(CT) and generates the signature Sig CSP (CT)=H(CT) D mod n, when CSP receives the hash value and signature, it will send the signature together with the data storage location Loc to DO to facilitate DO to 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. In this stage, DU initiates a request to the blockchain to obtain the necessary transaction information, and then waits for the blockchain to return the corresponding transaction order.

[0148] Data user DU stores the ciphertext at location Lo c As a parameter, a request is made to the CSP to obtain the ciphertext information.

[0149] Once the data user DU receives the encrypted text, they will perform a hash function on the text. Subsequently, DU will compare and analyze 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) are the same, it can be confirmed that the ciphertext information returned by the CSP is complete and correct. When the two H(CT) are different, the correctness of the ciphertext information cannot be confirmed and the decryption operation cannot be completed. Through this verification process, the data owner DU can safely decrypt the ciphertext information and obtain a reliable plaintext result.

[0151] Through Data=Dec(k,C), the decryption operation DU can successfully obtain the symmetric key k, so that the ciphertext information can be successfully decrypted and the plaintext document can be restored.

[0152] Finally, for the user group that has not been revoked, the authorization agency TA will select a random number β'. Used to generate a new version K of the key and update the key SK after the calculation is completed i ′=SK i , ensuring that these users can continue to access data. For revoked users, TA will modify their attribute set and select a new random number ai ′≠a i (i=1, 2, ..., n), so that those users whose access rights have been revoked will not be able to obtain the random number information β′ in the new key version K, t′=Z p * , which prevents them from obtaining a valid access key SK i ′.

[0153] A simulation experiment was conducted using the pairing-based cryptography (PBC) library. The experimental evaluation was conducted according to the evaluation methods of the literature

[16] XU Shengwei, WAN Gfeijie. 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 authorization [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. In the experimental evaluation, the encryption time of the method of the present invention was slightly increased under the same number of attributes because the additional bilinear calculation was introduced to maintain the consistency of the ciphertext length, which increased the computational burden. However, compared with the high storage cost solutions such as those described in References 16 and 17, TA The storage cost 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 solution 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 multiplication cyclic group of order p. The present invention exhibits the advantage of low storage overhead, indicating that it has significant advantages in storage optimization, with a slight tradeoff in encryption time. Figure 5 and Figure 6 As shown ( Figure 5 and Figure 6 The specific operation method is carried out according to the method of Example 2).

[0154] The present invention proposes a method for protecting the privacy and security of power data based on attribute-based encryption of ciphertext policies. The method studies the privacy and security protection of power data from five aspects: system initialization, user registration, data processing, data encryption, and data decryption. In the present invention, by using blockchain technology, the dependence of the traditional conditional attribute-based encryption (CP-ABE) scheme on centralized entities is effectively dealt with, thereby eliminating the single point failure risk caused by the resulting situation. At the same time, the present invention also introduces smart contract technology to perform attribute-based encryption of ciphertext policies, providing an innovative solution for the encryption processing of power data. In addition, the present invention also involves storing the symmetric decryption key securely in the cloud server, and recording the core information such as the data summary and the file storage location on the blockchain. This strategy provides strong privacy protection in the process of power data transmission, ensuring that the security and privacy of the data are effectively maintained. Finally, the access policy is converted into an access tree structure, and the policy is completely hidden in the ciphertext. The user revocation algorithm is designed using the chameleon hash function. This strategy not only effectively curbs the behavior of unauthorized access, but also prevents the cloud server from potential tampering with the data. In this way, the privacy and security of power data are effectively strengthened and guaranteed.

[0155] Compared with the traditional public key encryption scheme, the attribute-based encryption method that uses smart contracts to implement ciphertext policies can effectively reduce the risk of data being tampered with by cloud servers. This method converts the access policy into an access tree structure and completely hides the policy in the ciphertext to ensure the concealment of the policy. Combined with the chameleon hash function, the study designed a user revocation mechanism, which not only effectively resists the risk of unauthorized access, but also enhances the security and confidentiality of the data. With this method, the privacy of power data is carefully protected. Through experimental comparison tests, in five different access strategy tests, the encryption and decryption time of the present invention is shorter. The file size increases by 1000KB each time from 1000KB to 8000KB. In this process, when the file size is 1000KB, the encryption time is almost the same as the scheme proposed in document 17, which is better than the scheme proposed in document 16. In each stage from 2000KB to 8000KB, the encryption time of the scheme proposed in the present invention is significantly lower than the schemes proposed in documents 16 and 17, and the encryption time is shorter; in the decryption process, when the file size is 1000KB to 3000KB, the decryption time of the scheme proposed in the present invention is almost the same as the scheme proposed in document 17, which is significantly better than the scheme proposed in document 16. However, when the file size is 4000KB to 8000KB, the scheme proposed in the present invention is significantly lower than the schemes proposed in documents 16 and 17, and the decryption time is shorter. In summary, the ciphertext policy attribute-based encryption technology implemented by smart contracts provides a solution for strengthening data protection. This approach not only enhances the security and confidentiality of data, but also optimizes the process of data sharing and processing, improving overall efficiency. Through the automation of smart contracts and precise access control of attribute-based encryption, the solution ensures that data can only be accessed when it meets specific conditions, thereby promoting the rational use of data while protecting privacy.

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

Claims

1. A power data privacy security protection system based on ciphertext policy attribute-based encryption, characterized by: The system includes entity roles such as data owner DO, data user DU, trusted authorization center TA, blockchain BC, cloud service provider CSP and attribute manager AM; Among them, the entity roles include data owners who can select keys to encrypt data and use the ciphertext sent by the attribute manager AM to update the key, the data user who can generate an identity identifier to build a private key and verify data integrity, the trusted authorization center who can generate a private key and an initial key for an attribute group and update the attribute group key when an attribute is revoked, the blockchain who can publish attribute status change information and record the mapping relationship between the data user DU and its attribute set, the cloud service provider who can sign the hash value of the ciphertext and ensure the integrity and credibility of the data, and the attribute manager who can re-encrypt the ciphertext and ensure that there is no collusion with the cloud service provider CSP when revocation occurs.

2. Application of the power data privacy and security protection system as described in claim 1 in power data privacy and security protection.

3. The power data privacy security protection method based on ciphertext policy attribute-based encryption using the power data privacy security protection system as claimed in claim 1 is characterized by: The steps include: (1) System initialization The trusted authorization center TA initializes the system, inputs the security parameter λ and attribute U, obtains the system public key PK and the system master private key MSK, and defines a bilinear mapping, e:G×G→G T , G and G T represents a multiplicative cyclic group. The generator of G is g, and its order is a prime number p. To build this system, TA chose a hash function H:{0,1} * →G H: {0, 1} * →G, to ensure the security and privacy of the data. At the same time, TA also selects a random element α∈Z p , α represents a random element in the p-factorial cyclic group, Z p is a multiplicative cyclic group of order p and defines n values ​​for the system properties, L n ={att i } 1≤i≤n , L n Indicates the system attribute definition value, att i Represents the system attribute value, i represents a random number greater than or equal to 1 and less than or equal to n, and each attribute can take n values. i Multiple values ​​can be expressed as represents the set of system attribute values, 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, TA starts from Z p A random number was chosen from calculate z i,bi is a random number in the p-order multiplication cyclic group, g is a generator in the multiplication cyclic group, Z i,bi is the encrypted representation of the attribute value, T i,bi is another element generated by TA for the attribute value, b i It is a random number related to the attribute, which can be used to derive the system's public key PK and master private key MSK. These keys will be used to encrypt and decrypt data and implement fine-grained access control; Among them, e(g, g) a represents the bilinear map of the generator g of the multiplicative cyclic group, g a represents the generator g of the multiplicative cyclic group G to the power of α, and the rest of the formula is the same as above; Executed by TA, input public key PK, output public key CPK and private key CSK, 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 their product n = p q, then TA selects a random integer E, Ensure that the Euler function of E and n Mutually prime numbers, cloud service provider CSP: D is the private key exponent in the symmetric encryption algorithm, and E is the Euler function Random integers that are prime to each other. Based on these parameters, the public key CPK of CSP is calculated, CPK = {E, n} and the private key CSK, CSK = D; It is executed by the entity role data owner DO, inputs the system public key PK, and outputs DO's public key DPK and private key DSK, DPK = {E', n'} and private key DSK; (2) User Registration A global identity is used to identify a specific user, and the corresponding user key SK and conversion key TK are generated according to the attribute set submitted by the user. The global identity is a user identification mechanism that can be shared among multiple applications and platforms to ensure secure access and processing of the user's data. Through this design, the system can accurately identify and manage user identities and data, thereby improving data security and controllability; (3) Data processing Before the entity role data owner DO starts processing, it needs to connect to the blockchain network to obtain the necessary system parameters PP and perform offline pre-calculation operations in 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 operation of the system. ①Online stage a) Choose a symmetric key K ey , calculate the two data ciphertexts of N, N represents power data, C f and represents two data ciphertexts of N, Enc() represents the symmetric encryption algorithm, Key is the symmetric key, and H(N) represents the hash function of the power data N; b) Select an access strategy (M, q), where M is a matrix with l rows and n columns, and q is an injective 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 As a shared secret value, and then choose a random number Set Vector s is a random number belonging to the p-order multiplicative cyclic group, is a p-order multiplicative cyclic group, v2…v n are n random numbers belonging to the multiplicative cyclic group, is a vector of random numbers in the multiplicative cyclic group; d) For each row M of the matrix M i , calculate the share λ i As the secret shared value of s, let λ i is the calculation share, M i is each row of the matrix M, is a vector, T is the transpose symbol; e) Calculate the values ​​of C, C1, C0, C′0, C=K ey ×W, C1=ss′, C0=W0, C′0=W′ C , C represents the ciphertext obtained by symmetric encryption of the plaintext and the encryption key Key, W represents the encryption parameter obtained by the operation of the public key PK and the random number s', W0 represents another encryption parameter obtained by the operation of the generator g through the random number s', and W′0 represents another encryption parameter obtained by the operation of the generator h through the random number s'; f) Calculate f i =λ i -λ′ q(i) , and set C i =W q(i) ; ②Offline stage 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 a public key; b) For attribute x∈ATT, pick another random number λ′ X ,make Calculate The value of A x represents the function parameter of the property x, h is a random element in the multiplicative cyclic group, W x is the encryption parameter calculated for attribute x, λ′ X is a random number; (4) Data encryption Executed by DO, input public key PK, plaintext data data, access policy W, output intermediate ciphertext CT′, in the key space, DO will randomly select a symmetric key k to symmetrically encrypt the plaintext data Data, after completing the encryption operation, DO will transmit the encrypted data to the receiver, let C′ = Enc k (Data), C' is the ciphertext, Enc() represents the symmetric encryption algorithm, k represents the symmetric key, 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, selects a random number s, let s∈Z n , 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 p-order multiplicative cyclic group Z p A random number, e is a bilinear map of two multiplication cycle groups. In order to determine the unread non-leaf nodes, first set s to the value of the root node, and mark the node as read, and modify all child nodes to unread. By performing recursive operations, the unread non-leaf nodes can be accurately determined and the corresponding processing operations can be performed. ① When the child node is in the unread state, if the non-leaf node is an AND gate, the encryption operation can only be performed when all child nodes are read. That is to say, in the case of an AND gate, all access attributes must be met before the decryption operation can be performed. At this time, DO randomly selects s i ∈Z p , 1≤s i ≤p-1,s i is a random number in the multiplicative cyclic group, Z p is a p-order multiplication cyclic group, and for the last non-leaf node, DO will set the node to be read and then calculate the value p is the order of the multiplication cyclic group, sj is the last leaf node, s and si are random numbers in the multiplication cyclic group, and mod is the modulus operator; ② When scanning a non-leaf node, if there is an unread node in the child node of the node, and the non-leaf node is an "OR" gate, then the non-leaf node needs to be marked as read, and the values ​​of all unread child nodes are set to a specific value s. This ensures that when performing logical calculations, the value of the non-leaf node can correctly reflect the status of its child nodes and avoid repeated calculations of read nodes. DO performs calculations: Among them, Z i,bi is the encrypted representation of the attribute value, s is a random number selected in the multiplicative cyclic group, i is a 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 two multiplicative cyclic groups, I represents the attribute index set related to the access policy, C3' represents the ciphertext intermediate value, and C4' represents the ciphertext intermediate value; The intermediate ciphertext CT′={W,C′,C′1,C′2,C′3,C′4}CT′={W,C′,C′1,C′2,C′3,C′4} is obtained and executed by AM. The public key PK and the intermediate ciphertext CT′ are input to obtain the final ciphertext CT and the ciphertext header Hdr. After DO sends the intermediate ciphertext, AM can obtain the ciphertext and start the corresponding processing and decryption operations. By obtaining the intermediate ciphertext, AM can continue the subsequent calculation or decryption steps to complete a specific task or obtain the required information. Then, AM randomly selects k i ∈Z p ,calculate C3=C′3,C2=C′2,C1=C′1,C=C′,C、C1、C2、C3、C4 are different components of the ciphertext, thus the ciphertext and ciphertext header are obtained: CT={C,C1,C2,C3,C4} Among them, k i is the p-th order multiplicative cyclic group Z p , i is a random element in the attribute set, W represents the access strategy, g is the generator of the multiplicative cyclic group, e is the bilinear map of two multiplicative cyclic groups, and E is the Euler function Random integers that are prime to each other, T is the encryption attribute, θ is the attribute encryption coefficient, Mincs represents the minimum 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; When AM calculates the ciphertext CT, it generates a hash value H(CT) corresponding to the ciphertext and sends the hash value to DO. It sends (CT, Hdr) to CSP for processing to ensure the security and integrity of data transmission and storage. After receiving it, CSP calculates the hash value of CT to obtain H(CT) and generates the 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 signature, it sends the signature together with the data storage location Loc to DO to facilitate DO to read and process the data in subsequent operations; (6) User Revocation Executed by TA, input public parameter parameter, random number a i ', the new key version K' and the user attribute set S', and the updated data user key SK' is obtained. At this stage, for the unrevoked user TA, a random number β' is selected. Generate a new key version K and calculate R = (g β′ ,e(g β ,H1(ID))), where g β =g β (H1(to i ) a′ ) t-i′ ,att i is one of the attribute sets, i represents an element in the attribute set, g is the generator of the multiplicative cyclic group G, e is a bilinear map, H is a hash function, ID is the user alias, β' is a random number, t is a random number of the p-order multiplicative cyclic group, and α is a random value; because S'=S,a' i =ai(i=1,2,...,n) The user attribute set and the corresponding random value remain unchanged, and the key SK′ is updated after calculation i =SK i , unrevoked users can continue to access, and for revoked users, TA updates the corresponding attribute set S′=S\{att i }, select a new random number a′ i ≠a i (i=1,2,...,n), thus, the revoked user will not obtain the random number β' in the new key version K. The relevant information of i .

4. The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system according to claim 3 is characterized by: The power data privacy security protection method based on ciphertext policy attribute-based encryption also includes the generation of keys for individual users by AM, and the specific operation of AM generation is as follows: When a user accesses the system, the system will obtain a globally unique identity information G from AM. IDu ∈{0,1} * , then the system will use the attribute set provided by the user Processing is performed to obtain the corresponding user key SK and conversion key TK. These operations are implemented by AM: ① Select three natural numbers r, t, z∈G, where G represents a multiplication cyclic group, and set the conversion key UK=z; ②Calculate β=H(C IDu ), H represents a hash function; ③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, K x represents the key component associated with attribute x, A x represents the encrypted representation of the attribute value, r and t are randomly selected values, and β is the value obtained by processing the user's global identity identifier GIDu through the hash function H; ④ Calculate K u , L u , the value of D, G, ⑤Set 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 Euler function Random integers that are prime to each other, K x is the corresponding key of attribute x, K and L are part of the transformation key TK, and Ku and Lu are part of the key used to generate the user key.

5. The power data privacy security protection method based on ciphertext policy attribute-based encryption of the power data privacy security protection system according to claim 3 or 4 is characterized in that: The power data privacy security protection method based on ciphertext policy attribute-based encryption also includes a smart contract interaction process, including a fair trade contract FTC, a result verification contract RVC, and a result reception contract RRC. The operation procedures of the three smart contracts are as follows: The smart contract FTC is responsible for ensuring that the user has prepaid the corresponding search fee before the search operation begins. When 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 deserved compensation from the contract. If the results fail to pass the verification, the smart contract will automatically trigger the refund mechanism and return the prepaid fees to the user.

Citation Information

Patent Citations

  • Distributed data security sharing method and system based on block chain, and computer readable medium

    CN113595971A

  • Multi-authorization attribute-based verifiable encryption method based on block chain

    CN114143094A

  • Block chain privacy protection method based on online and offline attribute encryption

    CN114640468A

  • Data dynamic access control method in cloud environment based on fabric block chain

    CN116361000A

  • Revocable access control method based on cloud edge collaboration

    CN116545715A

Cited By

  • Charging data-oriented traceable access authorization and recovery method and system

    CN120378168A

  • Data encryption method based on enterprise data security management

    CN120389915A