User information privacy protection method based on IoT-Friendly-ABE in smart power grid
By adopting the IoT-friendly-ABE-based user information privacy protection method in the smart grid, an access control structure is constructed and an access tree collection is generated, which solves the problem that the power company cannot effectively control the user information access rights in the prior art, and realizes lightweight and secure user information access control, which is suitable for the data analysis and decision-making needs of power companies.
Patent Information
- Application Number
- CN202411682033.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing CP-ABE-based user information privacy protection methods cannot effectively control the access rights of power companies to smart grid user information, and it is difficult to meet the needs of power companies themselves or their relevant departments to assist data analysis and decision-making.
A user information privacy protection method based on IoT-friendly-ABE is adopted, and an access control structure is constructed by a power company to generate a set of public keys, master keys and access trees. User information is encrypted and decrypted during transmission, allowing only users who meet the access structure to access user information.
It realizes the effective control of the access rights of smart grid user information by the power company itself or its assistance to relevant departments to conduct data analysis and decision-making. It also has the advantages of fast encryption and short ciphertext keys, and has smaller computing and communication overheads, and is suitable for smart meters with resource-constrained resources.
Smart Images

Figure SMS_2 
Figure SMS_51 
Figure SMS_88
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart grid technology, and specifically relates to a user information privacy protection method based on IoT-friendly-ABE in smart grid. While ensuring lightness, the power company can control the access rights of smart grid user information. Background Art
[0002] Due to the shortcomings of traditional power grids such as single energy and one-way information flow, it is difficult to meet the production and living needs of the current society. Most countries are actively promoting the construction of more information-based and intelligent smart grids. Smart grids integrate new green energy such as wind energy and solar energy in the traditional power layer, so that users can not only use electricity but also supply electricity; a two-way communication network, Advanced Metering Infrastructure (AMI), is integrated above the power layer. Through modern network communication, computers, sensors, automation and other technologies, the power layer is measured, sensed and controlled, realizing the two-way flow of electricity and information. This integration of new energy and AMI makes smart grids safer, more reliable, greener and more efficient than traditional power grids. AMI includes user-side smart meters (SM), data concentrators (DC) and power companies (PC). Smart meters measure user information in cycles (such as 15 minutes, 30 minutes), including user identity, smart meter number, smart meter readings, real-time bills, life patterns, power grid operation logs, etc. Then, in AMI, it is sent to the power company through wireless networks and high-speed wired networks. Finally, the power company receives and stores the data. These periodically collected data accumulate over time to form user information big data, which is widely and closely related to the economy and society and contains huge value. Power companies can monitor the state of the power grid, dynamically plan energy distribution, analyze pricing strategies, etc. based on user information big data, or assist relevant departments in analyzing economic trends, housing vacancy rates, etc. These data analyses and decision-making based on user information big data play a very important guiding role in the production and operation of the power system and the development of society.
[0003] However, it is precisely because user information big data contains huge value that a lot of important information can be inferred from it. If this information is not protected by a sufficiently secure privacy mechanism, once it is illegally obtained, it will cause trouble to the user's life and economic losses. Therefore, it is very important to provide privacy protection for user information measured by smart meters.
[0004] Since the smart meters that undertake data measurement tasks are deployed at the user end and in an open environment, it is very easy for criminals to steal user information from the smart meters. Therefore, encrypting data in the smart meters at the user end has become a suitable choice to provide privacy protection for user information. Among them, attribute-based encryption (ABE) has the characteristics of flexible and fine-grained data access, making it the only choice for encrypting data in smart grids. Attribute-based encryption mechanism is regarded as the most promising encryption primitive that supports fine-grained access control. It is divided into two categories, namely Ciphertext-Policy Attribute-Based Encryption (CP-ABE) and Key-Policy Attribute-Based Encryption (KP-ABE). In recent years, user information privacy protection based on ABE has been widely studied, most of which are based on CP-ABE. CP-ABE can indeed provide fine-grained privacy protection for user information in smart grids. However, in the user information privacy protection based on CP-ABE, the access control right of data belongs to the user-side smart meter. However, when the power company itself or its assisted relevant departments conduct data analysis and decision-making based on user information big data, the power company is required to have good control over the access rights to user information. That is, the power company, an authoritative institution, decides which data users can access user information. Therefore, the user information privacy protection based on CP-ABE is not suitable for scenarios where the power company itself or its assisted relevant departments conduct data analysis and decision-making.
[0005] In summary, how to effectively control the access rights of power companies to user information in smart grids based on a lightweight ABE algorithm is the key to solving the above problems. Summary of the invention
[0006] In order to overcome the problems existing in the above-mentioned technologies, the present invention proposes a user information privacy protection method based on IoT-friendly-ABE in smart grid.
[0007] To achieve the above purpose, the technical solution adopted by the present invention is:
[0008] A user information privacy protection method based on IoT-friendly-ABE in a smart grid comprises the following steps:
[0009] (1) Initialize and broadcast the public key:
[0010] (1-1) The power company, as an authoritative organization, determines the safety parameter λ and the total attribute set U = {a1, a2, ..., au} and attribute number set U i ={1,2,3,......,u},u=|U|, where || represents the number of attributes in the attribute set, the security parameter λ is a parameter used to describe and measure the security strength of the cryptographic system, a1,a2,......,a u Indicates attributes; U i The numbers in U correspond one to one with the elements in U, that is, U i The number i in U represents the i-th attribute a in U i ; Then, define a prime q-order asymmetric optimal Ate mapping e: G1×G2=G T , the size of the prime number q is the security parameter λ;
[0011] (1-2) Random selection by power companies 1≤i≤u; then, generate the public key PK and the master key MSK, as shown in formula (1):
[0012]
[0013] (1-3) The power company generates a set of access trees As shown in formula (2):
[0014]
[0015] in Indicates the number of visited trees; each visited tree Used to define access structures, consisting of attribute sets And the threshold gate definition, the subsequent method is as follows Other parameters Both U or U i The attribute subset of the tree is referred to as the attribute set; for a node x in the tree, parent(x) represents the parent node of node x, SS x (|SS x |=num x ) represents the set of all child nodes of x, Represents the set of some child nodes of x, z∈SS x or z∈S x represents the child node of x; if x is a non-leaf node, then x is associated with the threshold gate, through (num x ,d x ) means; if d x =1, the threshold gate is an “OR” gate, if d x =num x , the threshold gate is an AND gate; if x is a leaf node, then x and is associated with an attribute in , represented by (i,1), where i represents the attribute represented by node x in The number in the table, 1 represents the threshold d x The value of is 1; that is, in the access tree, the leaf node x(i,1) is The number is The non-leaf nodes are associated with the attributes of the nodes, while the non-leaf nodes only represent the "AND" and "OR" threshold gates; in addition, index(x) represents the number of the node x: if x is a leaf node, index(x) = i; if x is a non-leaf node, index(x) is associated with all index(z), z∈SS parent(x) are all different. In addition, the parent node of the leaf node is called the start node;
[0016] (1-4) The power company broadcasts the public key PK to the outside world and sets the master key MSK and the access tree Private storage;
[0017] (2) Data measurement:
[0018] In each cycle t, each user-side smart meter SM n Measure the user information m in this cycle n,t , as shown in formula (3):
[0019] m n,t ={read n,t ,fault n,t ,ID n,t ,weather n,t ,bill n,t ,customer n,t ,Log n,t ,...}, (3)
[0020] Where n represents the number of the smart meter, which satisfies 1≤n≤num, and num represents the number of smart meters; read n,t Indicates the real-time meter reading of the current cycle, fault n,t Indicates the fault count of the current cycle, ID n,t Indicates the smart meter number, weather n,t Indicates the weather data of the current period, bill n,t Indicates the real-time bill of the current period, customer n,t Indicates user information, Log n,t It represents the residential electricity operation log;
[0021] (3) Data encryption and transmission:
[0022] (3-1) Determine the encryption attribute set:
[0023] In each cycle t, each user-side smart meter SM n Random Generation Then randomly generate a random number And determine the attribute set corresponding to the user information
[0024] (3-2) Data encryption:
[0025] In each cycle t, each user-side smart meter SM n User information n,t To encrypt, encryption servers Server1 and Server2 are needed during the encryption process. The calculation commands of the encryption servers are as follows:
[0026] ①(mult,P,x): server multiplication command. By sending (mult,P,x) to the server, the server will calculate x·P and return the result.
[0027] ②(exp,g,x): Server exponentiation command. By sending (exp,g,x) to the server, the server will calculate g x And return the result;
[0028] Each user-side smart meter SM n By using the encryption server, the plaintext m n,t Encrypted to ciphertext Ctx n,t , the specific encryption process is as follows:
[0029] ①Send (exp,ψ,r to encryption server Server1 n,t ), and then sends (exp,ψ,s n,t -r n,t ), get the return values A1 and A2 of Server1 and Server2 and multiply them to get
[0030] ②Send to encryption server Server1 Then send it to the encryption server Server2 Get the return value B1 and B2 and add them together
[0031] ③Send to the encryption server Server1 in sequence (mult, T i ,r n,t ), sends (mult,T i ,s n,t -r n,t ), where i∈ω n ',t , after getting the corresponding return values C1 and C2, add them together to calculate s n,t ·T i =C1+C2;
[0032] ④Smart meters transmit user information n,t Encrypted into ciphertext Ctx n,t , as shown in formula (4):
[0033]
[0034] (3-3) Data transmission:
[0035] In each cycle t, each user-side smart meter SM n The ciphertext Ctx n,t After being forwarded by other smart meters and data concentrators, it is sent to the power company;
[0036] (4) Data reception and storage:
[0037] The power company receives each smart meterSM n The user information m collected in each cycle t n,t The ciphertext Ctx n,t After that, Ctx n,t To store;
[0038] (5) Private key request:
[0039] Data user User l Submit a private key request to the power company when user information is needed for data analysis or decision making;
[0040] (6) Send private key:
[0041] (6-1) User l Generate private key SK l :
[0042] The power company receives the User l After requesting the private key of Matches the access tree collection Subset of That is, as shown in formula (5):
[0043]
[0044] Then the power company accesses the tree set Follow the following specific steps ①-③ to set up User l Generate a unique private key SK l ; where the attribute set ω l Satisfy access tree Right now The definition is: Let x be the visit tree A node of Represents a tree with node x as the root node If x is a subtree of The root node of If the attribute set ω l Satisfy the access subtree Define it as When x is When the root node is The attribute set ω l Satisfy access tree Right now in The calculation is recursive as follows: When x is a non-leaf node, d x is its threshold, node z represents the child node of node x, if there are at least d x z satisfies but otherwise When x is a leaf node, if the attribute set ω l There is an attribute associated with node x in otherwise
[0045] ① is a collection Each visited tree Each node x, including leaves, randomly selects a polynomial p x ; For the threshold value d x The node x of the polynomial p x The number of times is d x -1, in addition, for the root node r, set p r (0) = y, for each other node x, set p x (0) = p parent(x) (index(x)), this process continues until it reaches a leaf node;
[0046] ②Assumption The in-degree of each starting node s is n s , whose threshold is d s , divide the child nodes of the starting node into two groups: one group is denoted as F s , indicating that the attributes corresponding to the child nodes are common attributes; the other group is denoted as D s , indicating that the attribute corresponding to the child node is an uncommon attribute, F s The number of nodes in is equal to d s -1, D s The number of nodes in is equal to n s -ds +1; Generate a key SK for each leaf node x of the child node of the starting node s j,x , as shown in formula (6):
[0047]
[0048] Where i represents the attribute number represented by the leaf node x; visit the tree The set of keys of all leaf nodes is the access tree The corresponding key SK j , as shown in formula (7):
[0049]
[0050] ③Collection All visited trees in The corresponding key SK j Composed of User l Exclusive private key SK l , as shown in formula (8):
[0051]
[0052] (6-2) User l Generate access tree key path set Path l :
[0053] Power company for User l According to the attribute set ω l Generate Collection The key path set is as follows:
[0054] ① Generate a unique path from the leaf node to the root node in the access tree
[0055] Let node x be the visited tree A leaf node of Then iterate: For the collection Any element in If parent(z) exists and but Otherwise, the iteration terminates. That is, the leaf node x in the tree The only path to the root node;
[0056] ②Generate attribute set ω l In the access tree The critical path in
[0057] Let the set att = {x1, x2, ..., x n}express With attribute set ω l The set of associated leaf nodes that satisfies att|=|ω l | and the nodes in att and ω l The attributes in one-to-one correspondence, attribute set ω l In the access tree The set of critical path nodes in As shown in formula (9):
[0058]
[0059] Attribute Setω l In the access tree The critical path in As shown in formula (10):
[0060]
[0061] in
[0062]
[0063] Among them, x→parent represents the node exist The parent node on must belong to x→son means exist The collection of child nodes on x→son1,x→son2,......means x is in The child node on S x Each node in
[0064] ③Generate attribute set ω l When accessing a tree collection The critical path set in
[0065] Power company for User l According to the attribute set ω l Generate a collection of visit trees The key path collection Path l , as shown in formula (12):
[0066]
[0067] (6-3) Send private key:
[0068] The power company will use the key SK l and the key path collection Path l Transmitted to User via secure channel l ;
[0069] (7) Data decryption and use:
[0070] (7-1) Execute the DecNode algorithm to decrypt user information:
[0071] Data user User l Upon receiving the key SK l and the key path collection Path l After that, for each encrypted user information Ctx stored in the power company with the attribute set ω′ ω′ , through DecNode(Ctx ω′ ,SK l ,Path l ) algorithm to decrypt; DecNode(Ctx ω′ ,SK l ,Path l )The input of the algorithm is the ciphertext Ctx ω′ =(ω′,E l ,{E i} i∈ω′ ), private key SK l and access tree key path collection Path l , the output is plain text m ω′ Or ⊥, the specific steps are as follows:
[0072] ①For the key path set Path l Each critical path in Each node in x , do the following calculation:
[0073] like Satisfying {x→son}=NULL, calculate:
[0074]
[0075] like Satisfy {x→son}≠NULL, calculate:
[0076]
[0077] Among them, z∈S x ; i is the number of the attribute represented by node x, represents the Lagrange interpolation coefficient when x=0. The calculation method of the Lagrange coefficient is shown in formula (15):
[0078]
[0079] Among them, S (x) Indicates S x The corresponding number set;
[0080] ② Repeat the process of ① to determine whether there is a condition that satisfies {x→parent}=NULL and H x ≠⊥ If the node x does not exist, output ⊥; otherwise, calculate the plaintext m ω′ , as shown in formula (16):
[0081]
[0082] (7-2) Data usage:
[0083] Data user User l According to the obtained user information plaintext m ω′ Perform data analysis or decision making.
[0084] The step (1) of the invention method is executed once by the power company; the steps (2)-(3) are executed by the smart meter in cycles; the step (4) is executed by the power company in cycles; the steps (5)-(7) are executed by the data user and the power company when the data user needs to use the user information, and all the steps are based on the IoT-friendly-ABE algorithm. IoT-friendly-ABE is a KP-ABE scheme. The power company constructs an access control structure to set the access rights to user information. Only the internal users of the power company or the relevant departments who meet the access structure can access the user information, so as to realize the control of the access rights by the power company. In addition, it has the following two advantages, making it more suitable for user-side smart meters with limited computing resources and storage resources: ① Use as few pairing operations as possible and implement it with the help of more efficient asymmetric Ate pairing, and provide computing power support for the encryption operation of the user-side smart meter with the help of the encryption server, thereby reducing the computing overhead of the user-side smart meter; ② Unlike the traditional ABE scheme based on the high-complexity bilinear pairing, IoT-friendly-ABE uses elliptic curves to ensure that the ciphertext key is short, which can greatly reduce the communication overhead. First, in step (1), the power company, as an authoritative organization, determines the attribute set and executes the initialization algorithm to generate a public key, a master key and an access tree set, and broadcasts the public key; in steps (2)-(4), the user-side smart meter, as the data sender, periodically collects user information, selects some attributes that match the user information of the current period from the attribute set published by the power company to form an attribute subset, and encrypts the user information with the help of an encryption server based on the attribute subset and the public key of the power company, and then uploads the encrypted user information to the power company, which stores it after receiving it, and accumulates it over time to form user information big data; in steps (5)-(7), the power company or When data users such as relevant departments need to access user information big data for data analysis or decision making, they submit a key application to the power company; after receiving the key application from the data user, if the user's attribute set matches certain access trees in the access tree set generated by the power company, the power company executes the key generation algorithm according to the matched access tree to generate an exclusive private key for it, and then transmits the private key to the data user through a secure channel; after receiving the private key, the power company or relevant departments and other data users download the user information ciphertext from the power company and try to decrypt it through the private key. If decryption is successful, they can perform data analysis or decision making based on the decrypted user information plaintext.
[0085] Therefore, the present invention has the following advantages:
[0086] In terms of lightness, it has the advantages of fast encryption and short ciphertext keys, with smaller computational and communication overheads, making it very suitable for resource-constrained smart meters.
[0087] In terms of privacy protection, the power company constructs an access control structure to set access rights to user information. Only internal users of the power company or relevant departments who meet the access structure can access user information. This enables the power company to control access rights and is suitable for scenarios where the power company itself or it assists relevant departments in conducting data analysis and decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 It is a flow chart of a user privacy protection method based on IoT-friendly-ABE in smart grid;
[0089] Figure 2 is the average encryption time graph of random plaintext encrypted by smart meters;
[0090] Figure 3 It is a graph of the average decryption time for data users to decrypt random ciphertext;
[0091] Figure 4 This is a comparison chart of encryption time between IoT-friendly-ABE and other KP-ABE algorithms;
[0092] Figure 5 This is a comparison chart of the key lengths of IoT-friendly-ABE and other KP-ABE algorithms;
[0093] Figure 6 This is a comparison chart of the ciphertext length between IoT-friendly-ABE and other KP-ABE algorithms. DETAILED DESCRIPTION
[0094] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0095] like Figure 1 As shown, the user information privacy protection method based on IoT-friendly-ABE in the smart grid described in this embodiment has the following specific steps:
[0096] A user information privacy protection method based on IoT-friendly-ABE in a smart grid comprises the following steps:
[0097] (1) Initialize and broadcast the public key:
[0098] (1-1) The power company, as an authoritative organization, determines the safety parameter λ and the total attribute set U = {a1, a2, ..., a u} and attribute number set U i={1,2,3,......,u},u=|U|, where | | represents the number of attributes in the attribute set, the security parameter λ is a parameter used to describe and measure the security strength of the cryptographic system, a1,a2,......,a u Indicates attributes (such as power company, Ministry of Housing and Urban-Rural Development, Minister, etc.); U i The numbers in U correspond one to one with the elements in U, that is, U i The number i in U represents the i-th attribute a in U i ; Then, define a prime q-order asymmetric optimal Ate mapping e: G1×G2=G T , the size of the prime number q is the security parameter λ;
[0099] (1-2) Random selection of power companies 1≤i≤u; then, generate the public key PK and the master key MSK, as shown in formula (1):
[0100]
[0101] (1-3) The power company generates an access tree set TT, as shown in formula (2):
[0102]
[0103] in Indicates the number of visited trees; each visited tree Used to define access structures, consisting of attribute sets And the threshold gate definition, the subsequent method is as follows Other parameters (i.e. a1, a2, ..., a m ∈U) are both U or U i The attribute subset of the tree is referred to as the attribute set; for a node x in the tree, parent(x) represents the parent node of node x, SS x (|SS x |=num x ) represents the set of all child nodes of x, Represents the set of some child nodes of x, z∈SS x or z∈S x represents the child node of x; if x is a non-leaf node, then x is associated with the threshold gate, through (num x ,d x ) means; if d x =1, the threshold gate is an OR gate, if d x =num x , the threshold gate is an AND gate; if x is a leaf node, then x and is associated with an attribute in , represented by (i,1), where i represents the attribute represented by node x in The number in the table, 1 represents the threshold d x The value of is 1; that is, in the access tree, the leaf node x(i,1) is The number is The non-leaf nodes are associated with the attributes of the nodes, while the non-leaf nodes only represent the "AND" and "OR" threshold gates; in addition, index(x) represents the number of the node x: if x is a leaf node, index(x) = i; if x is a non-leaf node, index(x) is associated with all index(z), z∈SS parent(x) are all different. In addition, the parent node of the leaf node is called the start node;
[0104] (1-4) The power company broadcasts the public key PK to the outside world and sets the master key MSK and the access tree Private storage;
[0105] (2) Data measurement:
[0106] In each cycle t, each user-side smart meter SM n Measure the user information m in this cycle n,t , as shown in formula (3):
[0107] m n,t ={read n,t ,fault n,t ,ID n,t ,weather n,t ,bill n,t ,customer n,t ,Log n,t ,...}, (3)
[0108] Where n represents the number of the smart meter, which satisfies 1≤n≤num, and num represents the number of smart meters; read n,t Indicates the real-time meter reading of the current cycle, fault n,t Indicates the fault count of the current cycle, ID n,t Indicates the smart meter number, weather n,t Indicates the weather data of the current period, bill n,t Indicates the real-time bill of the current period, customer n,t Indicates user information, Log n,t It represents the residential electricity operation log;
[0109] (3) Data encryption and transmission:
[0110] (3-1) Determine the encryption attribute set:
[0111] In each cycle t, each user-side smart meter SM n Random Generation Then randomly generate a random number And determine the attribute set corresponding to the user information
[0112] (3-2) Data encryption:
[0113] In each cycle t, each user-side smart meter SM n User information n,t To encrypt, encryption servers Server1 and Server2 are needed during the encryption process. The calculation commands of the encryption servers are as follows:
[0114] ①(mult,P,x): server multiplication command. By sending (mult,P,x) to the server, the server will calculate x·P and return the result.
[0115] ②(exp,g,x): Server exponentiation command. By sending (exp,g,x) to the server, the server will calculate g x And return the result;
[0116] Each user-side smart meter SM n By using the encryption server, the plaintext m n,t Encrypted to ciphertext Ctx n,t , the specific encryption process is as follows:
[0117] ①Send (exp,ψ,r to encryption server Server1 n,t ), and then sends (exp,ψ,s n,t -r n,t ), get the return values A1 and A2 of Server1 and Server2 and multiply them to get
[0118] ②Send to encryption server Server1 Then send it to the encryption server Server2 Get the return value B1 and B2 and add them together
[0119] ③Send to the encryption server Server1 in sequence (mult, T i ,r n,t ), sends (mult,T i ,s n,t -r n,t ), where i∈ω n ',t , after getting the corresponding return values C1 and C2, add them together to calculate s n,t ·T i =C1+C2;
[0120] ④Smart meters transmit user information n,t Encrypted into ciphertext Ctx n,t , as shown in formula (4):
[0121]
[0122] (3-3) Data transmission:
[0123] In each cycle t, each user-side smart meter SM n The ciphertext Ctx n,t After being forwarded by other smart meters and data concentrators, it is sent to the power company;
[0124] (4) Data reception and storage:
[0125] The power company receives each smart meterSM n The user information m collected in each cycle t n,t The ciphertext Ctx n,t After that, Ctx n,t To store;
[0126] (5) Private key request:
[0127] Data user User l Submit a private key request to the power company when user information is needed for data analysis or decision making;
[0128] (6) Send private key:
[0129] (6-1) User l Generate private key SK l :
[0130] The power company receives the User l After requesting the private key of Matches the access tree collection Subset of That is, as shown in formula (5):
[0131]
[0132] Then the power company accesses the tree set Follow the following specific steps ①-③ to set up User l Generate a unique private key SK l ; where the attribute set ω l Satisfy access tree Right now The definition is: Let x be the visit tree A node of Represents a tree with node x as the root node If x is a subtree of The root node of If the attribute set ω l Satisfy the access subtree Define it as When x is When the root node is The attribute set ω l Satisfy access tree Right now in The calculation is recursive as follows: When x is a non-leaf node, d x is its threshold, node z represents the child node of node x, if there are at least d x z satisfies but otherwise When x is a leaf node, if the attribute set ω l There is an attribute associated with node x in otherwise
[0133] ① is a collection Each visited tree Each node x, including leaves, randomly selects a polynomial p x ; For the threshold value d x The node x of the polynomial p x The number of times is d x -1, in addition, for the root node r, set p r (0) = y, for each other node x, set p x (0) = p parent(x) (index(x)), this process continues until it reaches a leaf node;
[0134] ②Assumption The in-degree of each starting node (parent node of a leaf node) s is n s , whose threshold is d s , divide the child nodes of the starting node into two groups: one group is denoted as F s , indicating that the attributes corresponding to the child nodes are common attributes; the other group is denoted as D s , indicating that the attribute corresponding to the child node is an uncommon attribute, F s The number of nodes in is equal to d s -1, D s The number of nodes in is equal to n s-d s +1; Generate a key SK for each leaf node x of the child node of the starting node s j,x , as shown in formula (6):
[0135]
[0136] Where i represents the attribute number represented by the leaf node x; visit the tree The set of keys of all leaf nodes is the access tree The corresponding key SK j , as shown in formula (7):
[0137]
[0138] ③Collection All visited trees in The corresponding key SK j Composed of User l Exclusive private key SK l , as shown in formula (8):
[0139]
[0140] (6-2) User l Generate access tree key path set Path l :
[0141] Power company for User l According to the attribute set ω l Generate Collection The key path set is as follows:
[0142] ① Generate a unique path from the leaf node to the root node in the access tree
[0143] Let node x be the visited tree A leaf node of Then iterate: For the collection Any element in If parent(z) exists and but Otherwise, the iteration terminates. That is, the leaf node x in the tree The only path to the root node;
[0144] ②Generate attribute set ω l In the access tree The critical path in
[0145] Let the set att = {x1, x2, ..., x n}express With attribute set ω l The set of associated leaf nodes that satisfies att|=|ω l | and the nodes in att and ω l The attributes in one-to-one correspondence, attribute set ω l In the access tree The set of critical path nodes in As shown in formula (9):
[0146]
[0147] Attribute Setω l In the access tree The critical path in As shown in formula (10):
[0148]
[0149] in
[0150] node x ={{x→parent},x,{x→son|x→son1,x→son2,...,x→son |Sx|}}, (11)
[0151] Among them, x→parent represents the node exist The parent node on must belong to x→son means exist The set of child nodes S on x ( In the next steps x All represent the child nodes of node x on the critical path); x→son1, x→son2, ... represent the child nodes of x on the critical path. The child node on S x Each node in
[0152] ③Generate attribute set ω l When accessing a tree collection The critical path set in
[0153] Power company for User l According to the attribute set ω l Generate a collection of visit trees The key path collection Path l , as shown in formula (12):
[0154]
[0155] (6-3) Send private key:
[0156] The power company will use the key SK l and the key path collection Path l Transmitted to User via secure channel l ;
[0157] (7) Data decryption and use:
[0158] (7-1) Execute the DecNode algorithm to decrypt user information:
[0159] Data user User l Upon receiving the key SK l and the key path collection Path l After that, for each encrypted user information Ctx stored in the power company with the attribute set ω′ ω′ , through DecNode(Ctx ω′ ,SK l ,Path l ) algorithm to decrypt; DecNode(Ctx ω′ ,SK l ,Path l )The input of the algorithm is the ciphertext Ctx ω′ =(ω′,E l ,{E i} i∈ω′ ), private key SK l and access tree key path collection Path l , the output is plain text m ω′ Or ⊥, the specific steps are as follows:
[0160] ①For the key path set Path l Each critical path in Each node in x , do the following calculation:
[0161] like Satisfying {x→son}=NULL, calculate:
[0162]
[0163] like Satisfy {x→son}≠NULL, calculate:
[0164]
[0165] Among them, z∈S x ; i is the number of the attribute represented by node x, represents the Lagrange interpolation coefficient when x=0. The calculation method of the Lagrange coefficient is shown in formula (15):
[0166]
[0167] Among them, S (x) Indicates S x The corresponding number set;
[0168] ② Repeat the process of ① to determine whether there is a condition that satisfies {x→parent}=NULL and H x ≠⊥ If the node x does not exist, output ⊥; otherwise, calculate the plaintext m ω′ , as shown in formula (16):
[0169]
[0170] (7-2) Data usage:
[0171] Data user User l According to the obtained user information plaintext m ω′ Perform data analysis or decision making.
[0172] The present invention verifies and designs experiments for two aspects: (1) verification of the effectiveness of the invention method and (2) verification of the efficiency of the invention method.
[0173] Regarding “(1) Verification of the effectiveness of the invention method”, 500 sets of random experiments were conducted to verify whether the invention method can run normally and in a short time. First, each set of experiments was set as follows: the elliptic curve was MNT244; q was a large prime number of 577 bits; the attribute number set was U i ={1,2,3,......,500}; The number of attributes in the encrypted attribute set is random and does not exceed 500, set to ω ={1,2,3,......,n}(n≤500); Access tree set There are 500 visited trees (num T =500), and the access tree therein corresponds to ω one-to-one, that is, the access policy is set to (1and 2and 3and....andn), the access tree structure is two-layer, the second layer has n leaf nodes, and corresponds to ω one-to-one, and the secret value y stored in the root node of each access tree is The num value is randomly selected and the same value is used in each group of experiments; the user-side smart meter and the data user are random (that is, the num value is random, User l The number is random); the user-side smart meter randomly selects G from the bilinear mapping TSelect one element from the data as plaintext to encrypt. Then, the encryption time of each smart meter in each group of experiments is averaged as the encryption time of the group of experiments (in ms), and the decryption time of each data user in each group of experiments is averaged as the decryption time of the group of experiments (in ms).
[0174] Regarding “(2) Verification of the efficiency of the invention method”, two different experiments were conducted. In the first experiment, 500 random experiments were conducted, with encryption time (ms) (average encryption time of each smart meter) as the comparison standard. In the case of plain text Hello World mapped to bilinear mapping G by hash function, T In the experiment (1), the rest of the parameters such as attribute number set and access tree set were set the same as those in the experiment (1), and the computational overhead of IoT-friendly-ABE used in the method of the present invention was compared with FABEO, ABGW, and FAM. In the second group of experiments, the communication overhead of IoT-friendly-ABE used in the method of the present invention was compared with FABEO, ABGW, and FAME, taking the ciphertext key length (bit) as the comparison standard. The plaintext setting was the same as the computational overhead comparison experiment, and the number of encrypted attributes was set to start from 5 attributes, and 5 attributes were increased each time until 100 attributes. The other settings were the same as those in experiment 1, and 20 groups of random experiments were conducted. In each group of experiments, 500 experiments were conducted using IoT-friendly-ABE, FABEO, ABGW, and FAME for each number of encrypted attributes. Then, the results of the 500 experiments were averaged after removing the maximum and minimum values, and the ciphertext length and key length corresponding to each number of attributes of IoT-friendly-ABE, FABEO, ABGW, and FAME were obtained.
[0175] For all 500 random experiments in experiment (1), Figure 2 The average encryption time of each smart meter in 500 random experiments is shown. Figure 3 The figure shows the average decryption time of each data user in 500 random experiments. It can be seen from the figure that the method of the present invention can be executed normally and the encryption and decryption time is very short. Figure 2 It can be seen that the average encryption time of each group of experiments does not exceed 675ms, among which the average encryption time of group 152 is the longest, which is 673.34ms. Figure 3 It can be seen that the average decryption time of each group of experiments does not exceed 4700ms, among which the average decryption time of group 153 is the longest, which is 4604.74ms.
[0176] Figure 4The encryption time overhead of IoT-friendly-ABE used in the method of the present invention is compared with other KP-ABE schemes in the first group of 500 random experiments in experiment (2). As shown in the figure, IoT-friendly-ABE has the lowest running time overhead, followed by FABEO, while ABGW and FAME show significantly higher time overhead. For example, in the 200th random experiment, the encryption time consumption of IoT-friendly-ABE is 128.85ms, the time consumption of FABEO is 146.85ms, the time consumption of ABGW is 267.84ms, and the time consumption of FAME is 851.38ms. The above experiments verify the lightweight nature of the encryption algorithm of IoT-friendly-ABE used in the method of the present invention.
[0177] Figure 5 and Figure 6 The second group of experiments (2) shows a comparison of the ciphertext key lengths of IoT-friendly-ABE and other KP-ABE schemes under various encryption attribute numbers in 20 random experiments. As shown in the figure, IoT-friendly-ABE produces the shortest ciphertext and key lengths, followed by FABEO, while the other two schemes FAME and ABGW show significantly longer ciphertext and key lengths. For example, Figure 5 In , when the number of encrypted attributes is 60, the key length of IoT-friendly-ABE is 9952 bits, the key length of FABEO is 10024 bits, the key length of FAME is 68248 bits, and the key length of ABGW is 63976 bits; Figure 6 In the experiment, the ciphertext length of IoT-friendly-ABE is 13920 bits, the ciphertext length of FABEO is 13992 bits, the ciphertext length of FAME is 28144 bits, and the ciphertext length of ABGW is 23872 bits. The above experiments verify that the communication overhead of IoT-friendly-ABE used in the method of the present invention is relatively small.
Claims
1. A user information privacy protection method based on IoT-friendly-ABE in smart grid, characterized in that: The following steps are involved: (1) Initialize and broadcast the public key: (1-1) The power company, as an authoritative organization, determines the safety parameter λ and the total attribute set U = {a1, a2, ..., a u } and attribute number set U i ={1,2,3,......,u},u=|U|, where || represents the number of attributes in the attribute set, the security parameter λ is a parameter used to describe and measure the security strength of the cryptographic system, a1,a2,......,a u Indicates attributes; U i The numbers in U correspond to the elements in U one by one, that is, U i The number i in U represents the i-th attribute a in U i ; Then, define a prime q-order asymmetric optimal Ate mapping e: G1×G2=G T , the size of the prime number q is the security parameter λ; (1-2) Random selection of power companies Then, the public key PK and the master key MSK are generated as shown in formula (1): (1-3) The power company generates a set of access trees As shown in formula (2): in Indicates the number of visited trees; each visited tree Used to define access structures, consisting of attribute sets And the threshold gate definition, the subsequent method is as follows Other parameters Both U or U i The attribute subset of the tree is referred to as the attribute set; for a node x in the tree, parent(x) represents the parent node of node x, SS x (|SS x |=num x ) represents the set of all child nodes of x, Represents the set of some child nodes of x, z∈SS x or z∈S x Represents the child node of x; If x is a non-leaf node, then x is associated with the threshold gate, through (num x ,d x ) means; if d x =1, the threshold gate is an "OR" gate, if d x =num x , the threshold gate is an AND gate; if x is a leaf node, then x and is associated with an attribute in , represented by (i,1), where i represents the attribute represented by node x in The number in the table, 1 represents the threshold d x The value of is 1; that is, in the access tree, the leaf node x(i,1) is The number is The non-leaf nodes are associated with the attributes of the nodes, while the non-leaf nodes only represent the "AND" and "OR" threshold gates; in addition, index(x) represents the number of the node x: if x is a leaf node, index(x) = i; if x is a non-leaf node, index(x) is associated with all index(z), z∈SS parent(x) are all different. In addition, the parent node of the leaf node is called the start node; (1-4) The power company broadcasts the public key PK to the outside world and sets the master key MSK and the access tree Private storage; (2) Data measurement: In each cycle t, each user-side smart meter SM n Measure the user information m in this cycle n,t , as shown in formula (3): m n,t ={read n,t ,fault n,t ,ID n,t ,weather n,t ,bill n,t ,customer n,t ,Log n,t ,...}, (3) Where n represents the number of the smart meter, which satisfies 1≤n≤num, and num represents the number of smart meters; read n,t Indicates the real-time meter reading of the current cycle, fault n,t Indicates the fault count of the current cycle, ID n,t Indicates the smart meter number, weather n,t Indicates the weather data of the current period, bill n,t Indicates the real-time bill of the current period, customer n,t Indicates user information, Log n,t It represents the residential electricity operation log; (3) Data encryption and transmission: (3-1) Determine the encryption attribute set: In each cycle t, each user-side smart meter SM n Random Generation Then randomly generate a random number And determine the attribute set corresponding to the user information (3-2) Data encryption: In each cycle t, each user-side smart meter SM n User information n,t To encrypt, encryption servers Server1 and Server2 are needed during the encryption process. The calculation commands of the encryption servers are as follows: ①(mult,P,x): server multiplication command. By sending (mult,P,x) to the server, the server will calculate x·P and return the result. ②(exp,g,x): Server exponentiation command. By sending (exp,g,x) to the server, the server will calculate g x And return the result; Each user-side smart meter SM n By using the encryption server, the plaintext m n,t Encrypted to ciphertext Ctx n,t , the specific encryption process is as follows: ①Send (exp,ψ,r to encryption server Server1 n,t ), and then sends (exp,ψ,s n,t -r n,t ), get the return values A1 and A2 of Server1 and Server2 and multiply them to get ②Send to encryption server Server1 Then send it to the encryption server Server2 Get the return value B1 and B2 and add them together ③Send to the encryption server Server1 in sequence (mult, T i ,r n,t ), sends (mult,T i ,s n,t -r n,t ), where i∈ω n ' ,t , after getting the corresponding return values C1 and C2, add them together to calculate s n,t ·T i =C1+C2; ④Smart meters transmit user information n,t Encrypted into ciphertext Ctx n,t , as shown in formula (4): (3-3) Data transmission: In each cycle t, each user-side smart meter SM n The ciphertext Ctx n,t After being forwarded by other smart meters and data concentrators, it is sent to the power company; (4) Data reception and storage: The power company receives each smart meterSM n The user information m collected in each cycle t n,t The ciphertext Ctx n,t After that, Ctx n,t To store; (5) Private key request: Data user User l Submit a private key request to the power company when user information is needed for data analysis or decision making; (6) Send private key: (6-1) User l Generate private key SK l : The power company receives the User l After requesting the private key of Matches the access tree collection Subset of That is, as shown in formula (5): Then the power company accesses the tree set Follow the following specific steps ①-③ to set up User l Generate a unique private key SK l ; where the attribute set ω l Satisfy access tree Right now The definition is: Let x be the visit tree A node of Represents a tree with node x as the root node If x is a subtree of The root node of If the attribute set ω l Satisfy the access subtree Define it as When x is When the root node is The attribute set ω l Satisfy access tree Right now in The calculation is recursive as follows: When x is a non-leaf node, d x is its threshold, node z represents the child node of node x, if there are at least d x z satisfies but otherwise When x is a leaf node, if the attribute set ω l There is an attribute associated with node x in otherwise ① is a collection Each visited tree Each node x, including leaves, randomly selects a polynomial p x ; For the threshold value d x The node x of the polynomial p x The number of times is d x -1, in addition, for the root node r, set p r (0) = y, for each other node x, set p x (0) = p parent(x) (index(x)), this process continues until it reaches a leaf node; ②Assumption The in-degree of each starting node s is n s , whose threshold is d s , divide the child nodes of the starting node into two groups: one group is denoted as F s , indicating that the attributes corresponding to the child nodes are common attributes; the other group is denoted as D s , indicating that the attribute corresponding to the child node is an uncommon attribute, F s The number of nodes in is equal to d s -1, D s The number of nodes in is equal to n s -d s +1; Generate a key SK for each leaf node x of the child node of the starting node s j,x , as shown in formula (6): Where i represents the attribute number represented by the leaf node x; visit the tree The set of keys of all leaf nodes is the access tree The corresponding key SK j , as shown in formula (7): ③Collection All visited trees in The corresponding key SK j Composed of User l The exclusive private key SK l , as shown in formula (8): (6-2) User l Generate access tree key path set Path l : Power company for User l According to the attribute set ω l Generate Collection The key path set is as follows: ① Generate a unique path from the leaf node to the root node in the access tree Let node x be the visited tree A leaf node of Then iterate: For the collection Any element in If parent(z) exists and but Otherwise, the iteration terminates. That is, the leaf node x in the tree The only path to the root node; ②Generate attribute set ω l In the access tree The critical path in Let the set att = {x1, x2, ..., x n }express With attribute set ω l The set of associated leaf nodes that satisfies att|=|ω l | and the nodes in att and ω l The attributes in one-to-one correspondence, attribute set ω l In the access tree The set of critical path nodes in As shown in formula (9): Attribute Setω l In the access tree The critical path in As shown in formula (10): in Among them, x→parent represents the node exist The parent node on must belong to x→son means exist The collection of child nodes on x→son1,x→son2,......means x is in The child node on S x Each node in ③Generate attribute set ω l When accessing a tree collection The critical path set in Power company for User l According to the attribute set ω l Generate a collection of visit trees The key path collection Path l , as shown in formula (12): (6-3) Send private key: The power company will use the key SK l and the key path collection Path l Transmitted to User via secure channel l ; (7) Data decryption and use: (7-1) Execute the DecNode algorithm to decrypt user information: Data user User l Upon receiving the key SK l and the key path collection Path l After that, for each encrypted user information Ctx stored in the power company with the attribute set ω′ ω′ , through DecNode(Ctx ω′ ,SK l ,Path l ) algorithm to decrypt; DecNode(Ctx ω′ ,SKl,Pathl) algorithm input is the ciphertext Ctx ω′ =(ω′,E l ,{E i } i∈ω′ ), private key SK l and access tree key path collection Path l , the output is plain text m ω′ Or ⊥, the specific steps are as follows: ①For the key path set Path l Each critical path in Each node in x , do the following calculation: like Satisfying {x→son}=NULL, calculate: like Satisfy {x→son}≠NULL, calculate: Among them, z∈S x ; i is the number of the attribute represented by node x, represents the Lagrange interpolation coefficient when x=0. The calculation method of the Lagrange coefficient is shown in formula (15): Among them, S (x) Indicates S x The corresponding number set; ② Repeat the process of ① to determine whether there is a condition that satisfies {x→parent}=NULL and H x ≠⊥ If the node x does not exist, output ⊥; otherwise, calculate the plaintext m ω′ , as shown in formula (16): (7-2) Data usage: Data user User l According to the obtained user information plaintext m ω′ Perform data analysis or decision making.