Fine-grained access control method of smart lighting system in combination with CP-ABE and block chain
By combining CP-ABE and blockchain technology, using attribute authorization agency clusters and chameleon hash values, data security and privacy issues in smart lighting systems are solved, and fine-grained access control and efficient data management are achieved.
Patent Information
- Application Number
- CN202410064932.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-03-07
AI Technical Summary
There are data security and data privacy issues in smart lighting systems, and traditional public and private key pairs are difficult to achieve fine-grained access control.
Combining CP-ABE and blockchain technology, initialization and key generation are performed through the attribute authorization agency cluster, and data encryption and storage are used for data encryption and storage to ensure data immutability and traceability.
It realizes fine-grained access control with high security and high accuracy, ensures the anonymity, forward security and anti-platform conspiracy capabilities of user data, and reduces the storage overhead of blockchain.
Smart Images

Figure CN119583089A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a fine-grained access control method for a smart lighting system combining CP-ABE and blockchain. Background Art
[0002] With the continuous development of urban informatization and the further improvement of people's requirements for a better life, the development stage of cities has entered the stage of smart city development. Smart city refers to the use of various advanced technologies, such as information and communication technology, data analysis and management, to improve various aspects of the city to meet people's requirements for a better life. Smart lighting is a key link in realizing smart cities. Smart lighting refers to the use of advanced technologies such as sensors, network connections and automatic control to improve the efficiency and flexibility of lighting systems. Through the smart lighting system, users can realize remote control, dimming, timing and other functions of lighting equipment, thereby achieving energy-saving, comfortable and intelligent lighting management.
[0003] There are currently issues with data security and data privacy in the field of smart lighting. Smart lighting systems collect a large amount of data, including some extremely sensitive privacy data, such as user geographic information, usage habits, etc. These data must be guaranteed to be accessible and processed only by authorized users or devices, thereby improving data security and preventing unauthorized access and abuse. However, smart lighting is usually applied to different scenarios, and each person has different attributes and roles in each scenario. It is obviously not feasible to use traditional public-private key pairs for access control. Smart lighting requires more fine-grained access control. Summary of the invention
[0004] The technical problem to be solved by the present invention is how to provide a fine-grained access control method for a smart lighting system that combines CP-ABE and blockchain with high security and accuracy.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a fine-grained access control method for a smart lighting system combining CP-ABE and blockchain, comprising the following steps:
[0006] Initialization: The attribute authority initializes CP-ABE and generates the public key and master key of CP-ABE. The attribute authority is initialized, and users vote to select the attribute authority that can perform attribute audit to form an attribute authority cluster.
[0007] Key generation: First, attribute review is performed. When a certain attribute set of a user passes the attribute review, the user uses the attribute set of this identity that has passed the review, the public key, and the master key to generate a private key for the attributes of this identity. A single user can have multiple different private keys.
[0008] Data encryption: formulate access rules. After formulating the access rules, the data owner will encrypt the data to generate an encrypted file with the file suffix CP-ABE;
[0009] Data on-chain: After reading the encrypted file with the suffix CP-ABE as a binary stream, select a team you trust and perform hashing according to the following steps; the user stores the Chameleon hash value of the ciphertext file, the access control policy of the ciphertext file, and the IPFS path of the ciphertext file on the IPFS on which the ciphertext file is located on the blockchain data;
[0010] Data sharing: obtaining ciphertext files, uploading access records to the blockchain, verifying the authenticity of ciphertext, and decrypting ciphertext.
[0011] The beneficial effects of adopting the above technical solution are: the method first uses attribute sets to achieve user anonymity, introduces blockchain to ensure the immutability and traceability of data, and secondly uses timestamps as a required option for attribute sets and access control rules to ensure forward security. Finally, an attribute authorization agency cluster is introduced to ensure that the solution has the characteristics of anti-platform collusion, and chameleon hash values are used in on-chain and off-chain storage systems to reduce the storage overhead of blockchain, so that the smart lighting system can be safely and reliably controlled. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0013] Figure 1 is an overall flow chart of the method described in the embodiment of the present invention;
[0014] Figure 2 is an interactive flow chart of the method described in the embodiment of the present invention;
[0015] Figure 3 It is a control flow chart of the method described in the embodiment of the present invention. DETAILED DESCRIPTION
[0016] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0018] This application combines blockchain's CP-ABE with a fine-grained access control method in the field of smart lighting, in which blockchain storage uses an on-chain and off-chain storage method, and uses storage of chameleon hash values to alleviate the storage pressure of the blockchain. For the attribute review and key distribution of CP-ABE, an attribute authorization agency cluster is used for management to ensure the anti-institutional collusion attack characteristics of this model.
[0019] like Figure 1-Figure 2 As shown, the embodiment of the present invention discloses a fine-grained access control method for a smart lighting system combining CP-ABE and blockchain, comprising the following steps:
[0020] Initialization: The attribute authority initializes CP-ABE and generates the public key and master key of CP-ABE. The attribute authority is initialized, and users vote to select the attribute authority that can perform attribute audit to form an attribute authority cluster.
[0021] Key generation: First, attribute review is performed. When a certain attribute set of a user passes the attribute review, the user uses the attributes of the identity that has passed the review, the public key, and the master key to generate a private key for the attributes of this identity. A single user can have multiple different private keys.
[0022] Data encryption: formulate access rules. After formulating the access rules, the data owner will encrypt the data to generate an encrypted file with the file suffix CP-ABE;
[0023] Data on-chain: After reading the encrypted file with the suffix CP-ABE as a binary stream, select a team you trust and perform hashing according to the following steps; the user stores the Chameleon hash value of the ciphertext file, the access control policy of the ciphertext file, and the IPFS path of the ciphertext file on the IPFS on which the ciphertext file is located on the blockchain data;
[0024] Data sharing: obtaining ciphertext files, uploading access records to the blockchain, verifying the authenticity of ciphertext, and decrypting ciphertext.
[0025] The above steps are explained below in detail.
[0026] The symbols and their meanings involved in the method are shown in Table 1.
[0027] Table 1
[0028]
[0029] like Figure 3 As shown, the method of the present invention includes five stages: system initialization, key generation, data encryption, data uploading, and data sharing.
[0030] Phase 1: Initialization phase
[0031] (1) CP-ABE initialization CP-ABEsetup(λ) → {PK(p, g, f, h, gp, gha), MSK(beta, y)};
[0032] The initialization of CP-ABE is generated by the following steps:
[0033] 1) Select parameters for elliptic curve pairing;
[0034] 2) Select three parameters g, f and h on the elliptic curve G1 group;
[0035] 3) Select two parameters gp and y on the elliptic curve G2 group;
[0036] 4) Select a parameter gha on the elliptic curve GT group;
[0037] 5) Select a parameter beta of a group element in an integer group module;
[0038] 6) Generate public key PK (p, g, f, h, gp, gha) and master key MSK (beta, y);
[0039] In order to avoid the single point failure problem and the problem of too much power of third parties caused by attribute authorization agencies, this application uses multiple attribute authorization agencies, which can review the attributes submitted by users. Only after more than a certain number of authorization agencies pass, can the user generate a CP-ABE private key based on the attribute. At the same time, in order to ensure the authenticity of user attributes, when more than a certain number of authorization agencies do not pass the attributes of a user, the attributes of the user will not pass the review.
[0040] Phase 2: Key Generation Phase
[0041] (2) Attribute review
[0042] Users need to submit their attributes to attribute authorization agencies for review. These attribute authorization agencies can review the attributes submitted by users. Only after more than a certain number of authorization agencies have passed can the user generate a CP-ABE private key based on the attributes.
[0043] During the attribute audit, the user attributes that finally pass the audit will have a timestamp attribute added to prevent the user's attributes from being changed and then decrypted with invalid attributes that have already passed the audit.
[0044] (3) CP-ABE key generation phase CP-ABEkeygen(CP-ABEpub, MSK) → {PK(p, g, f, h, gp, gha), CP-ABEprv(d, comps(d, dp, z, zp))}
[0045] When a certain attribute set of a user passes the review (a user can have multiple identities), the user can use the attributes of this identity that has passed the review together with the public key and the master key to generate the private key of the attributes of this identity. A single user can have multiple different private keys. The CP-ABE key is generated by the following steps:
[0046] 1) Obtain the elliptic curve pairing parameters selected for the public key from the public key CP-ABEpub of CP-ABE;
[0047] 2) Select two parameters g and g_r from the elliptic curve G2 group;
[0048] 3) Select two parameters r and beta_inv from the integer group module;
[0049] 4) Calculate MSK.y*(pub.gp r );
[0050] 5) Get the length of the access control policy;
[0051] 6) For each policy in the access control policy, two parameters d and h_rp are randomly generated from the elliptic curve G2 group, a parameter dp is randomly generated from the elliptic curve G1 group, and a parameter rp is randomly generated from the integer group module;
[0052] 7) Calculate g_r*(h_r rp ) and pub.g rp The value of is assigned to d and dp in comps;
[0053] 8) Generate private key CP-ABEprv(d, comps(d, dp, z, zp)).
[0054] Phase 3: Data encryption phase
[0055] (4) Access rule formulation
[0056] In attribute-based encryption, the generation of public and private keys depends on the attributes of the role. A role can access data only when its attributes meet the access rules of a certain data. Therefore, the data owner needs to formulate the access rules of his own data to facilitate access by others.
[0057] In order to maximize the convenience of data access and the privacy of data owners' data, data owners need to classify their data and formulate different access rules for each type of data.
[0058] When formulating access rules, a timestamp requirement must be added to prevent the user's attributes from being changed and then decrypted with invalid attributes that have already been passed.
[0059] (5) CP-ABE encryption CP-ABEenc(inputfile, CP-ABEpub, AES) → {encfile}
[0060] After formulating the access rules, the data owner follows the steps below to encrypt the data and generate an encrypted file with the file suffix CP-ABE:
[0061] 1) Obtain the public key file of CP-ABE from the blockchain;
[0062] 2) Convert the CP-ABE public key file to the CP-ABE structure type;
[0063] 3) Read the original file inputfile to be encrypted and record the type type of the file;
[0064] 4) Calculate the product of the sth power of pub.gha and m and the sth power of pub.h and the values of c, cp and q of each access control policy to obtain the key cph generated based on the access policy;
[0065] 5) Encrypt the contents of the input file using AES with the key cph.m;
[0066] 6) Write the binary stream of cph and AES ciphertext into the ciphertext file encfile;
[0067] 7) The data block is encrypted using AES and the CP-ABE key to obtain a CP-ABE encrypted file named encfile inputfile.name.type.CP-ABE.
[0068] Phase 4: Data on-chain
[0069] (6) Encrypted file hash encfilehash(encfile, bslPK) → {chameleon_hash}
[0070] After reading the encrypted file with the suffix CP-ABE as a binary stream, select a team you trust and perform hashing according to the following steps;
[0071] 1) Input the encrypted file with the suffix CP-ABE as binary stream M and the current timestamp T;
[0072] 2) The timestamp is divided into two parts, T1 and T2 (T1 is year, month, and day, T2 is hours, minutes, and seconds). T1 and T2 are used as the commitment value C and random jitter factor R in the Chameleon hash calculation respectively;
[0073] 3) The chameleon hash value Hash is calculated according to the following formula. First, the plaintext element is concatenated with the random jitter factor and then hashed. Then, the hash value is XORed with the commitment value to finally obtain the hash value of the chameleon hash.
[0074]
[0075] (7) Data on-chain
[0076] This application adopts the storage method of on-chain and off-chain storage. The data on the chain includes the following parts:
[0077] 1) The hash value of the ciphertext, which will be used to verify the integrity and correctness of the data later;
[0078] 2) The storage path of the ciphertext on IPFS. Obviously, one hash value must correspond to one ciphertext data, so the IPFS path also needs to be on-chain;
[0079] 3) The number of the chameleon hash scheme used by the ciphertext, which is used to determine which chameleon hash is used to verify the authenticity of the ciphertext data.
[0080] The chaining process consists of the following steps:
[0081] 1) Check whether the IPFS ciphertext file data corresponding to a certain block on the blockchain has expired and the original access control policy of the block is consistent with the access control policy of the newly added data;
[0082] 2) If there is a block that meets the above conditions, no new block will be opened. Instead, the IPFS storage space will be found through the IPFS path of the invalid data, and the invalid data will be replaced with new valid data. A chameleon hash value that is exactly the same as the hash value of the invalid data will be generated through a trapdoor, so that the original access control policy of the invalid block and the access control policy of the newly added data are consistent, and a certain block that has expired will be re-pointed to the new valid ciphertext data to make it effective. This not only saves the cost of opening up new resource blocks, but also eliminates the additional storage cost of the original invalid data;
[0083] 3) If it does not exist, a new block is created, and a new IPFS storage space is found to obtain the IPFS storage path. The IPFS storage path, the chameleon hash value of the ciphertext, and the access control policy are uploaded to the chain, and a new block is created.
[0084] Phase 5: Data Sharing
[0085] (8) Obtaining the ciphertext file
[0086] When a data accessor F1 needs to obtain data D1 from a data owner Own1, the following steps are performed to obtain the data:
[0087] 1) First, you need to determine what type of blockchain the data to be obtained is stored in. The blockchain of this system is the fisco-bcos blockchain;
[0088] 2) Select the query tool corresponding to the blockchain to query the blockchain data. This system can use the visual webase to perform visual interactive query of the fisco-bcos blockchain data;
[0089] 3) The relevant data information of the data to be queried, such as the block number, the hash value generated by the transaction, the address of the contract, etc., constitutes a data query statement for querying the data;
[0090] 4) The corresponding data hash value and IPFS path and access rules are returned on the blockchain.
[0091] 5) Download the CP-ABE ciphertext file according to the file path of IPFS;
[0092] (9) Access records are uploaded to the chain
[0093] When the data accessor successfully obtains data from the blockchain and IPFS, the blockchain needs to upload the access record of the accessor to the chain so that it can be traced back in the subsequent process. The data that needs to be uploaded to the chain includes:
[0094] 1) The unique identifier of the visitor, which is used to determine which visitor performed the operation;
[0095] 2) The ciphertext files of CP-ABE accessed by the visitor;
[0096] 3) The time at which the visitor made the visit.
[0097] (10) Ciphertext authenticity verification
[0098] After downloading the CP-ABE ciphertext file according to the IPFS file path, follow the steps below to verify;
[0099] 1) Obtain the public key of a chameleon hash scheme used by the CP-ABE ciphertext file and calculate the hash value of the ciphertext file;
[0100] 2) Compare the hash value with the hash value of the block on the blockchain. If they are the same, the ciphertext file is true, otherwise the ciphertext file is false.
[0101] (11) Ciphertext decryption dec(encfile, SK) → {decfile}
[0102] The user can select a private key that satisfies the access rules of the block on the blockchain and use the private key to decrypt the CP-ABE ciphertext to obtain the plaintext data according to the following steps:
[0103] 1) Obtain the public key file of CP-ABE from the blockchain;
[0104] 2) Get two parameters m and t randomly generated from the elliptic curve GT group on pub.p;
[0105] 3) Convert the attribute set in the private key into the cph type and compare it with the cph in the ciphertext;
[0106] 4) Calculate whether the attribute set in the private key complies with several policies in the cph in the ciphertext and whether it meets the requirements of the access control policy;
[0107] 5) If the attribute set in the private key meets the access control policy, the ciphertext is decrypted by AES using m as the key and the decrypted plaintext is written to the decfile file.
[0108] Example Analysis
[0109] Data analysis is performed based on the data interaction between users and manufacturers in the smart lighting system. When the system needs to be researched, improved, maintained, supported, energy managed, or provide public services, it is necessary to obtain the user's system data. The system data generated by the user contains sensitive privacy data such as location information, usage habits, energy consumption, and user identity information. Once these data are leaked, they will cause serious consequences. In order to protect user privacy and user sensitive data, this application proposes a fine-grained access control method. Assume that there are three users in the smart lighting system, namely A, B, and C. The specific application based on the scenario is as follows:
[0110] The first stage is the initialization stage, during which the attribute authorization agency initializes CP-ABE and generates the public key and master key of CP-ABE. After the attribute authorization agency is initialized, users vote to select the attribute authorization agency that can perform attribute audit to form an attribute authorization agency cluster.
[0111] The second stage is the key generation stage. Users A, B, and C submit their own attributes to the attribute authorization agency cluster. Each user can have multiple identities, so they can submit multiple attributes to the attribute authorization agency cluster. When more than a certain number of attribute authorization agencies pass the review, the user can generate a private key based on the attributes that have passed the review. Let the attribute set of users A, B, and C that have passed the review be ele A ,ele B ,ele C , the generated private key is CP-ABEprv A , CP-ABEprv B , CP-ABEprv C .
[0112] The third stage is the data encryption stage. Suppose user A formulates an access rule acl that matches the attributes of user B but not user C. A , the encrypted file is inputfile A User A is formulating access control policy acl A Then inputfile A Encrypt to get the CP-ABE ciphertext file encfile A .
[0113] The fourth stage is the on-chain stage. This solution uses a dual storage method of on-chain and off-chain to alleviate the storage pressure of the blockchain. User A has a ciphertext file encfile A Perform chameleon hashing, the hash value is chameleon_hash A User A sends the ciphertext file encfile A The chameleon hash value is chameleon_hash A and the ciphertext file encfile A Access control policy acl A And the IPFS path IPFSurl on IPFS where the ciphertext file is located A Stored on blockchain data.
[0114] The fifth stage is the data sharing stage, where user B and user C play the roles of legal visitor and illegal visitor respectively to encfile A User A and User B obtain encfile from the blockchain respectively. A Chameleon hash value chameleon_hash A , ciphertext file encfile A Access control policy acl A And the IPFS path IPFSurl on IPFS where the ciphertext file is locatedA , and then get the ciphertext file encfile on IPFS A At the same time, the blockchain will upload the access records of user B and user C. A It is encrypted, so users B and C need to encfile the ciphertext file. A Decryption is done because encfile A Access control policy acl A It matches the attributes of user B but not user C, so user B uses his own private key CP-ABEprv B You can use encfile to ciphertext files A Decrypt to get the plaintext file decfile A , and user C cannot use his private key CP-ABEprv C Get the ciphertext file encfile A The plain text file decfiele A At the same time, user B can use the chameleon hash value chameleon_hash A Hash the ciphertext file to verify whether the ciphertext file is authentic.
[0115] In summary, the method can adapt to the scenarios of data sharing and interaction in smart lighting systems, ensure that the user's lighting-sensitive data is safe and controllable, and the visitor's access records are traceable.
[0116] Correctness Analysis
[0117] The correctness of the method requires that data accessors who comply with the ciphertext file access policy can successfully decrypt the ciphertext file using their own private keys, and that data accessors can generate chameleon hash values to verify the authenticity of the ciphertext file.
[0118] When the user's private key satisfies the access control policy set in the ciphertext, the ciphertext decryption process is as follows:
[0119] First, calculate the CP-ABE key generated by the user's private key for AES encryption:
[0120]
[0121] in:
[0122] r i+1 =y_t(r i ,acl i ,i)*zr(pub.p),i∈[2,len(acl)]
[0123] r1=zr(pub.p)
[0124] Then use the generated CP-ABE key to perform AES decryption on the ciphertext:
[0125] decfile = AESdec(cpabeenc prv ,encfile)
[0126] =AESdec(cpabeenc acl ,encfile)
[0127] =inputfile
[0128] After verification and analysis, it is found that only data accessors who comply with the ciphertext file access policy can successfully decrypt the ciphertext file using their own private key. At the same time, data accessors can generate chameleon hash values to verify the authenticity of the ciphertext file.
[0129] Safety Proof
[0130] Building a security model
[0131] The challenger must complete all inquiries for the simulated attack before conducting a simulated attack. At the same time, the challenger can also apply to become an attribute authorization agency. If the challenger becomes an attribute authorization agency, he can conduct attribute audits. At the same time, the challenger can also cooperate with the corrupted attribute authorization agency.
[0132] Initialization: According to the overall security requirements of the system, the challenger selects the parameter λ in the system initialization, and then the system calls CP-ABEsetup(λ) and elesetup(λ) to complete the system initialization of the entire system.
[0133] Query: The challenger can obtain the attribute set U and the globally unique identity eleid of each attribute authority. Symbol F eleid Indicates the corrupted attribute authority, W eleid Indicates that the attribute authority is not corrupted, S eleid Indicates the authority of all attributes. The challenger starts with the following query:
[0134] (1) The challenger submits to the uncorrupted attribute authority W eleid Ask for its public key PK eleid ;
[0135] (2) The challenger asks for the private key SK of some legitimate users in the system. uid ;
[0136] Challenge: The challenger selects two plaintext files decfile1 and decfile2 of equal length and the access control policy acl of the plaintext files and submits them to the system for encryption. The system randomly selects the parameter d (d∈G2(pub.b)) to generate the private key CP-ABESK of the CP-ABE algorithm and randomly selects x (x∈[1,q]) as the private key bslSK of the chameleon hash. Then the system calls CP-ABEenc(inputfile, CP-ABEpub, AES)→{encfile} to encrypt the plaintext file to generate the ciphertext file encfile and calls encfilehash(encfile, bslPK)→{chameleon_hash} to generate the chameleon hash value chameleon_hash for the ciphertext file.
[0137] Guess: The challenger guesses the parameter d selected by the system. If the challenger's guessed d' is equal to the d randomly selected by the system, the challenger can decrypt the ciphertext. Therefore, the challenger wins as long as d=d'.
[0138] Definition 1: If the challenger cannot win the game with an unignorable advantage within a specified polynomial time, then the scheme proposed in this application is statically secure under the Random Oracle Model (ROM).
[0139] Static safety proof
[0140] The security of the method depends on the mathematical difficulty of solving discrete logarithms, that is, if the challenger cannot win the game with a non-negligible advantage within a specified polynomial time, it is equivalent to if the challenger cannot solve the mathematical difficulty of solving discrete logarithms with a non-negligible advantage within a specified polynomial time, which can prove the security of the scheme.
[0141] Definition 2: q-DBPBDHE2 hypothesis problem.
[0142] First, according to the input security parameter, two multiplication cycle order groups G1 and G2 with order s (s is a large prime number) are selected, and G1 and G2 satisfy the mapping relationship G1*G1→G2. Then the system randomly selects n+2 positive integers, which are R, Y, Z1, Z2, ..., Z n (where R, Y, Z i ∈Z * p ) and a random number A of a multiplicative cyclic order group G2. Suppose a vector X is known:
[0143]
[0144] i,j,k,m∈[2N,N,N,N+1],i≠N+1,m≠k
[0145] If there exists an algorithm named Q that can transform e(G1, G1) to R N+1 The Y power is distinguished from a random number D randomly selected from G2, and when its probability satisfies the following conditions:
[0146]
[0147] This means that algorithm Q can solve the q-DBPBDHE2 hypothesis problem with the advantage of P.
[0148] If the challenger is unable to distinguish the R of e(G1, G1) within a specified polynomial probability time N+1 The Y power and a random number D randomly selected from G2 have an advantage of P that cannot be ignored, which proves that the assumption of q-DBPBDHE2 is valid.
[0149] Theorem 1: If the q-DBPBDHE2 hypothesis problem proposed above is valid, then the scheme proposed in this application is statically secure under the condition of the random oracle model.
[0150] Lemma 1: If the q-DBPBDHE2 hypothesis problem proposed above is valid, then the scheme proposed in document 7 [Bethencourt J, Sahai A, Waters B. Ciphertext-policy attribute-based encryption [C] / / 2007 IEEE symposium on security and privacy (SP'07). IEEE, 2007: 321-334] is statically secure under the condition of the random oracle model.
[0151] Lemma 2: If the scheme proposed in [7] is statically secure under the random oracle model, then the scheme proposed in this application is statically secure under the random oracle model.
[0152] If Lemma 1 and Lemma 2 can be proved to be valid, then obviously Theorem 1 can be proved to be valid. Since Lemma 2 has been proved in the literature [7], this application will prove Lemma 1 later.
[0153] Proof: If the challenger can break this scheme with an advantage that cannot be ignored within a specified polynomial time, then there must be a simulator that can break the scheme proposed in the document [7] with an advantage that cannot be ignored within a specified polynomial time, and use the same method to break this scheme using the scheme in the document [7]. The detailed game process generated by the constructed security model is as follows:
[0154] System initialization: The simulator uses the setup algorithm of the scheme in [7] to call the CP-ABEsetup algorithm of this scheme and returns the public parameters to the challenger.
[0155] Query: The challenger can obtain the attribute set U and the globally unique identity eleid of each attribute authority. Symbol F eleid Indicates the corrupted attribute authority, W eleid Indicates that the attribute authority is not corrupted, S eleid Indicates the authority of all attributes. The challenger starts with the following query:
[0156] (1) The challenger sends a request to the uncorrupted attribute authority W through the simulator. eleid Ask for its public key PK eleid The simulator calls the result of the setup→(PK, MK) algorithm in [7] to call CP-ABEkeygen(CP-ABEpub, CP-ABEMSK)→{CP-ABEPK(p, g, f, h, gp, gha), CP-ABEprv(d, comps(d, dp, z, zp))} in this scheme to generate the PK of the uncorrupted attribute authority. eleid and SK eleid And PK eleid Return to the challenger.
[0157] (2) The challenger asks some legitimate users in the system for their private keys SK through the simulator. The simulator calls the result of the setup→(PK, MK) algorithm in the literature [7] to call CP-ABEkeygen(CP-ABEpub, CP-ABEMSK)→{CP-ABEPK(p, g, f, h, gp, gha), CP-ABEprv(d, comps(d, dp, z, zp))} in this scheme to generate the private keys SK of some legitimate users. uid And SK uid Return to the challenger.
[0158] Challenge: The challenger selects two plaintext files decfile1 and decfile2 of equal length and the access control policy acl of the plaintext files and submits them to the system for encryption. The system randomly selects the parameter d (d∈G2(pub.b)) to generate the private key CP-ABESK of the CP-ABE algorithm, and then calls CP-ABEenc(inputfile, CP-ABEpub, AES)→{encfile} to encrypt the plaintext file to generate the ciphertext file encfile and calls encfilehash(encfile, bslPK)→{chameleon_hash} to generate the chameleon hash value chameleon_hash for the ciphertext file.
[0159] Guess: The challenger makes a guess d' about the parameter d selected by the system.
[0160] In the entire game process described above, the simulator is equivalent to the challenger. The CP-ABEPK and CP-ABESK returned by the simulator are equivalent to the public and private keys output by the ecrypt(PK, CT, SK) algorithm of the scheme proposed in the document [7]. The challenger's guess about the d value is to determine the key of the AES symmetric encryption in the CP-ABEenc(inputfile, CP-ABEpub, AES)→{encfile} algorithm in this scheme. Because the scheme proposed in the document [7] has been proved in its present application to be statically secure under the random oracle model, it can be inferred that the scheme proposed in this application is also statically secure under the random oracle model.
[0161] In summary, the solution proposed in this application is also statically secure under the random oracle model.
[0162] Performance Analysis
[0163] 1) Functional analysis
[0164] The functional comparison of this scheme with reference 8 [Zhang Xuewang, Yao Yaning, Fu Jiali, etc. Policy-hidden efficient multi-authorization agency CP-ABE IoT data sharing scheme [J]. Computer Research and Development, 2023, 60(10): 2193-2202], reference 9 [Kang Ping, Zhao Kaiqiang, Liu Bin, etc. KP-ABE supporting large attribute space and security classification [J]. Journal of Electronics, 2023, 51(09): 2549-2557.], and reference 10 [Wang Pengbo, Shi Runhua. Lightweight access control scheme supporting user tracking and revocation in smart grid [J / OL]. Small Microcomputer Systems: 1-12 [2023-12-09]. http: / / kns.cnki.net / kcms / detail / 21.1106.tp.20230918.1716.024.html.] is as follows:
[0165] Table 2 Functional analysis comparison
[0166]
[0167] Like this application, references [8], [9], and
[10] all use prime number order groups to ensure the security of the key. References [9] and
[10] use a single attribute authorization agency to continue authorization, which has the problem of excessive power of the single attribute authorization agency. Reference [9] uses centralization, which has security risks. Reference [9] cannot be traced because it uses blockchain. References [8] and [9] do not support attribute revocation, which has security risks. References [8] and
[10] do not use large attribute domains, which will have certain limitations.
[0168] 2) Safety Analysis
[0169] The security comparison between this solution and references [8], [9], and
[10] is as follows:
[0170] Table 3: Safety analysis comparison
[0171]
[0172]
[0173] Like the present application, references [8], [9], and
[10] all use attributes to replace user identities to ensure user anonymity and resist user collusion attacks. References [8] and [9] do not support attribute revocation and therefore do not have forward security, which poses certain potential security risks. References [9] and
[10] both use a single attribute authorization agency that cannot perform a platform collusion attack when attribute authorization agencies are united, which poses a potential security risk. Reference [8] introduces blockchain, which is not decentralized and does not have non-repudiation, and poses a risk of being unable to prove some user behaviors. In summary, the method described in the present application is optimal in terms of functionality and security.
Claims
1. A fine-grained access control method for a smart lighting system combining CP-ABE and blockchain, characterized in that The steps include: Initialization: The attribute authority initializes CP-ABE and generates the public key and master key of CP-ABE. The attribute authority is initialized, and users vote to select the attribute authority that can perform attribute audit to form an attribute authority cluster. Key generation: First, attribute review is performed. When a certain attribute set of a user passes the attribute review, the user uses the attribute set of this identity that has passed the review, the public key, and the master key to generate the private key of the attribute set of this identity. A single user can have multiple different private keys. Data encryption: formulate access rules. After formulating the access rules, the data owner will encrypt the data to generate an encrypted file with the file suffix CP-ABE; Data on-chain: After reading the encrypted file with the suffix CP-ABE as a binary stream, select a team you trust and perform hashing according to the following steps; the user stores the Chameleon hash value of the ciphertext file, the access control policy of the ciphertext file, and the IPFS path of the ciphertext file on the blockchain; Data sharing: obtaining ciphertext files, uploading access records to the blockchain, verifying the authenticity of ciphertext, and decrypting ciphertext.
2. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 1 is characterized in that: The initialization of CP-ABE is generated by the following steps: 1) Select parameters for elliptic curve pairing; 2) Select three parameters g, f and h on the elliptic curve G1 group; 3) Select two parameters gp and y on the elliptic curve G2 group; 4) Select a parameter gha on the elliptic curve GT group; 5) Select a parameter beta of a group element in an integer group module; 6) Generate the public key PK(p, g, f, h, gp, gha) and the master key MSK(beta, y).
3. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 2 is characterized in that: The key generation comprises the following steps: When a certain attribute set of a user passes the review, the user can use the attributes of this identity that has passed the review set together with the public key and the master key to generate the private key of the attributes of this identity. A single user can have multiple different private keys; the CP-ABE key is generated by the following steps: 1) Obtain the elliptic curve pairing parameters selected for the public key from the public key CP-ABEpub of CP-ABE; 2) Select two parameters g and g_r from the elliptic curve G2 group; 3) Select two parameters r and beta_inv from the integer group module; 4) Calculate MSK.y*(pub.gp r ); 5) Get the length of the access control policy; 6) For each policy in the access control policy, two parameters d and h_rp are randomly generated from the elliptic curve G2 group, a parameter dp is randomly generated from the elliptic curve G1 group, and a parameter rp is randomly generated from the integer group module; 7) Calculate g_r*(h_r rp ) and pub.g rp The value of is assigned to d and dp in comps; 8) Generate private key CP-ABEprv(d, comps(d, dp, z, zp)).
4. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 3 is characterized in that: Before the key is generated, the property needs to be reviewed: The user submits his attribute set to the attribute authorization agency for review. These attribute authorization agencies will review the attribute set submitted by the user. Only after more than a certain number of authorization agencies have passed, the user can generate a CP-ABE private key based on the attribute set; when more than a certain number of authorization agencies do not pass a user's attribute set, the user's attribute set will not pass the review; During the attribute audit, a timestamp attribute is added to the user attributes that finally pass the audit to prevent the user's attributes from being changed and then decrypted with invalid attributes that have already passed the audit.
5. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 3, characterized in that: After formulating the access rules, the data owner follows the steps below to encrypt the data and generate an encrypted file with the file suffix CP-ABE: 1) Obtain the public key file of CP-ABE from the blockchain; 2) Convert the CP-ABE public key file to the CP-ABE structure type; 3) Read the original file inputfile to be encrypted and record the type type of the file; 4) Calculate the product of the sth power of pub.gha and m and the sth power of pub.h and the values of c, cp and q of each access control policy to obtain the key cph generated based on the access policy; 5) Encrypt the contents of the input file using AES with the key cph.m; 6) Write the binary stream of cph and AES ciphertext into the ciphertext file encfile; 7) The data block is encrypted using AES and the CP-ABE key to obtain a CP-ABE encrypted file named encfile inputfile.name.type.CP-ABE.
6. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 5 is characterized in that: Access rules specify: The generation of public and private keys in attribute-based encryption depends on the attributes of the role, and a role can access data only when its attributes meet the access rules of a certain data. Therefore, the data owner needs to formulate the access rules of his own data to facilitate access by others. In order to maximize the convenience of data access and the privacy of data owners, data owners need to classify their data and formulate different access rules for each type of data; The requirement for timestamp must be added in the formulation of access rules to prevent the user's attributes from being changed and then decrypted with invalid attributes that have already been passed.
7. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 5 is characterized in that: Data on-chain includes the following steps: 1) Check whether the IPFS ciphertext file data corresponding to a certain block on the blockchain has expired and the original access control policy of the block is consistent with the access control policy of the newly added data; 2) If there is a block that meets the above conditions, no new block will be created. Instead, the IPFS storage space will be found through the IPFS path of the invalid data, and the invalid data will be replaced with new valid data. A chameleon hash value that is exactly the same as the hash value of the invalid data will be generated through a trapdoor, so that the original access control policy of the invalid block is consistent with the access control policy of the newly added data, and a certain block will be re-pointed to the new valid ciphertext data to make it effective; 3) If it does not exist, a new block is created, and a new IPFS storage space is found to obtain the IPFS storage path. The IPFS storage path, the chameleon hash value of the ciphertext, and the access control policy are uploaded to the chain, and a new block is created.
8. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 7, characterized in that: After reading the encrypted file with the suffix CP-ABE as a binary stream, select a team you trust and perform hashing according to the following steps; 1-1) Input the encrypted file with the suffix CP-ABE as binary stream M and the current timestamp T; 1-2) The timestamp is divided into two parts T1 and T2, where T1 is year, month, and day, and T2 is hour, minute, and second. T1 and T2 are used as the commitment value C and random jitter factor R in the Chameleon hash calculation respectively; 1-3) The chameleon hash value Hash is calculated according to the following formula. First, the plaintext element is concatenated with the random jitter factor and then hashed. Then, the hash value is XORed with the commitment value to finally obtain the hash value of the chameleon hash. The data on the chain includes the following parts: 2-1) The hash value of the ciphertext, which will be used to verify the integrity and correctness of the data later; 2-2) The storage path of the ciphertext on IPFS. Obviously, one hash value must correspond to one ciphertext data, so the IPFS path also needs to be on-chain; 2-3) The number of the chameleon hash scheme used by the ciphertext, which is used to determine which chameleon hash is used to verify the authenticity of the ciphertext data.
9. The fine-grained access control method for a smart lighting system combining CP-ABE and blockchain as claimed in claim 7, characterized in that: The data sharing includes the following steps: 1) Get the ciphertext file When a data accessor F1 needs to obtain data D1 from a data owner Own1, the following steps are performed to obtain the data: 1-1) First determine the type of blockchain where the data to be obtained is stored; 1-2) Select the query tool corresponding to the blockchain to query the blockchain data; 1-3) Constructing a data query statement for querying data with relevant data information of the data to be queried; 1-4) The corresponding data hash value and IPFS path and access rules are returned on the blockchain; 1-5) Download the CP-ABE ciphertext file according to the file path of IPFS; 2) Access records are uploaded to the chain When the data accessor successfully obtains data from the blockchain and IPFS, the blockchain needs to upload the access record of the accessor to the chain so that it can be traced back in the subsequent process. The data that needs to be uploaded to the chain includes: 2-1) The unique identifier of the visitor, which is used to determine which visitor performed the operation; 2-2) The ciphertext file of CP-ABE accessed by the visitor; 2-3) The time when the visitor made the visit; 3) Ciphertext authenticity verification After downloading the CP-ABE ciphertext file according to the IPFS file path, follow the steps below to verify; 3-1) Obtain the public key of a chameleon hash scheme used by the CP-ABE ciphertext file and calculate the hash value of the ciphertext file; 3-2) Compare the hash value with the hash value of the block on the blockchain. If they are the same, the ciphertext file is true, otherwise the ciphertext file is false; 4) Ciphertext decryption dec(encfile, SK) → {decfile} The user can select a private key that satisfies the access rules of the block on the blockchain and use the private key to decrypt the CP-ABE ciphertext to obtain the plaintext data according to the following steps: 4-1) Obtain the public key file of CP-ABE from the blockchain; 4-2) Obtain two parameters m and t randomly generated from the elliptic curve GT group on pub.p; 4-3) Convert the attribute set in the private key into the cph type and compare it with the cph in the ciphertext; 4-4) Calculate whether the attribute set in the private key complies with several policies in the cph in the ciphertext and whether it meets the requirements of the access control policy; 4-5) If the attribute set in the private key meets the access control policy, the ciphertext is decrypted by AES using m as the key and the decrypted plaintext is written to the decfile file.
Citation Information
Cited By
Tamper-proof automatic driving data recording method, system, medium and product
CN120185794A