Access control method for sharing data of internet of vehicles based on editable blockchain

CN117354036BActive Publication Date: 2026-10-13NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311477438.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2026-10-13
Estimated Expiration
2043-11-07

AI Technical Summary

Technical Problem

[0008]本发明的目的是提供一种基于可编辑区块链的车联网共享数据的访问控制方法解决现有技术中存在的对区块链上的数据无权限用户的不可篡改性与合法用户的可编辑性难以保证的问题

Benefits of technology

[0054]本发明的有益效果是:该种基于可编辑区块链的车联网共享数据的访问控制方法,与现有技术相比,通过使用属性加密实现对共享数据的访问控制,并使用可编辑区块链技术,能够实现对区块链交易编辑的细粒度访问控制,能够保证对满足策略的用户即合法表现出可编辑性,并保证对不满足策略的用户即无权限用户表现出不可篡改性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117354036B_ABST
    Figure CN117354036B_ABST
Patent Text Reader

Abstract

The application provides a kind of based on editable blockchain's vehicle networking shared data access control method, by carrying out global initialization;Vehicle registration is carried out;Shared data is encrypted into ciphertext CT AES Upload to cloud server, then use the revocable ciphertext policy attribute encryption algorithm RCP-ABE to encrypt AES key to generate ciphertext CT ABE , ciphertext CT ABE As transaction is uploaded to editable blockchain;Generation block;The transaction number of editable transaction and the block number where it is located are sent to the vehicle-mounted unit of corresponding vehicle;When vehicle needs to update ciphertext CT ABE , vehicle generates new ciphertext and initiates block editing request to roadside unit;Roadside unit searches transaction;Run hash verification algorithm to verify, if verification fails, abort block editing;If verification is passed, new transaction is uploaded;The method can guarantee that the user who meets the strategy, i.e. legal, shows editable, and guarantees that the user who does not meet the strategy, i.e. unauthorized user, shows tamper-proof.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an access control method for shared data in the Internet of Vehicles (IoV) based on an editable blockchain, belonging to the field of IoV technology. Background Technology

[0002] Vehicle-to-Everything (VANETs) is an important application in Intelligent Transportation Systems (ITS). It supports both vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) communication modes, enabling vehicles to effectively acquire information about their surrounding traffic environment and make proactive driving decisions, thereby alleviating traffic congestion and ensuring traffic safety. VANETs typically consist of Onboard Units (OBUs) installed in vehicles and Roadside Units (RSUs) deployed along the roadside. RSUs support data storage, computation, and sharing among nearby vehicles, and high-speed collaborative communication is possible between vehicles and RSUs.

[0003] Vehicle Ad Hoc Networks (VANETs) contain sensitive user data, such as driving preferences and driver identities. Malicious vehicles may illegally obtain and tamper with the data stored therein, making users unwilling to store and share their data in the system. Therefore, providing secure and reliable data storage and sharing services for these vehicles is becoming increasingly important.

[0004] In VANETs, ​​a consortium blockchain is used to organize RSUs and vehicles. RSUs are defined as pre-selected nodes located at the network edge. RSUs and vehicles form a distributed blockchain network, which can effectively solve the problems of single point of failure and data tampering. Even if a small number of RSUs have storage errors or are controlled by attackers, they cannot affect the consensus result of the entire network.

[0005] However, while blockchain provides strong tamper-proof capabilities, it also limits the ability of data providers to reasonably modify data on the blockchain. The "modification" behavior on traditional blockchains is manifested as appending. Even if new data is added to the blockchain, the old data still exists on the blockchain, and criminals may use this old data to infringe on user privacy.

[0006] For example, in VANETs (Vehicle Ad Hoc Networks), the RSU (Responsible Unit) typically has limited storage resources and cannot directly store the massive amounts of data generated by vehicles. Therefore, data is usually stored on cloud servers. The RSU only stores the keys used to decrypt the data, and these keys are encrypted using attribute encryption schemes, thereby indirectly achieving fine-grained access control over the data. Sometimes, it is necessary to modify the access policy to revoke the access rights of users with certain attributes. This requires re-encrypting the keys to change the access policy and uploading it to the blockchain. However, even if these keys on the blockchain are modified, the keys containing the old access policy are still stored on the blockchain. The revoked user can still obtain the keys in some way, resulting in data leakage.

[0007] The aforementioned issues are problems that should be considered and resolved in the process of access control for shared data in vehicle-to-everything (V2X) networks based on editable blockchains. Summary of the Invention

[0008] The purpose of this invention is to provide an access control method for shared data in the Internet of Vehicles based on an editable blockchain, which solves the problem in the prior art that it is difficult to guarantee the immutability of data on the blockchain for users without authorization and the editability for legitimate users.

[0009] The technical solution of this invention is:

[0010] An access control method for shared data in the Internet of Vehicles (IoV) based on an editable blockchain includes the following steps:

[0011] S1. Perform global initialization on the blockchain-based vehicle networking system. During global initialization, the central authorized agency (CA) generates a global parameter GP, a public key and a private key (pk) of a chameleon hash CHET with a ephemeral trapdoor. chet ,sk chet When an attribute authorization authority u ∈ attribute authorization authority index field AU joins the system, it initiates a registration request to the central authorization authority CA. The central authorization authority CA generates a public key and a master key for the attribute authorization authority u.

[0012] S2. Vehicle registration: When a vehicle joins the system, the Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and retrieve the corresponding attribute authorization authority based on the vehicle's attributes. This attribute authorization authority generates a key sk for the vehicle based on the vehicle's global identifier (GID) ∈ Vehicle Global Identifier (GID) field. GID And send it to the vehicle's onboard unit (OBU);

[0013] S3. Shared data upload: The vehicle uses the Advanced Encryption Standard (AES) algorithm to encrypt the shared data into ciphertext CT. AESUploaded to a cloud server, the AES key is then encrypted using the Revocable Cipher Policy Attribute Encryption Algorithm RCP-ABE to generate ciphertext CT. ABE , ciphertext CT ABE The transaction is uploaded to the editable blockchain;

[0014] S4. Generate a block. After a specified time or after the number of uploaded messages reaches a set number, the Roadside Unit (RSU) generates a chameleon hash value h and a random number r for editable transactions. After packaging all transactions, including editable and non-editable transactions, and generating a block, it sends the transaction number Trans_nums and the block number Block_num of the editable transactions to the corresponding vehicle's Onboard Unit (OBU).

[0015] S5. Perform transaction retrieval. The attribute in the access strategy is revoked. The vehicle needs to access the encrypted CT. ABE During the update process, after the vehicle generates new ciphertext, it sends a block edit request to the Roadside Unit (RSU). The vehicle provides the transaction number Trans_nums and the block number Block_num to the RSU. The RSU retrieves the transaction based on the transaction number Trans_nums and the block number Block_num, and generates a new random number r' using the Chameleon Hash Adapt algorithm before proceeding to the next step S6.

[0016] S6. Perform block editing. The Roadside Unit (RSU) runs the Verify hash verification algorithm to verify the chameleon hash value h and the new random number r'. If the verification fails, the block editing is aborted; if the verification passes, the new transaction is uploaded to the block with the block number Block_num.

[0017] Further, in step S1, the central authorized agency (CA) generates a global parameter GP, a public key and a private key (pk) of a chameleon hash CHET with a ephemeral trapdoor during global initialization. chet ,sk chet ); Attribute granting authority u∈Attribute granting authority index domain Upon joining the system, a registration request is sent to the Central Authorization Authority (CA). The CA generates a public key and a master key for the attribute authorization authority u. Specifically,

[0018] S11, The Central Authorized Agency (CA) runs the global initialization algorithm GlobalSetup(1 λ ,s max The algorithm generates global parameters, receiving a security parameter λ and the maximum width s of the linear secret sharing scheme matrix M supported by the scheme, i.e., the LSSS matrix. max =s max (λ), run the common parameter generation algorithm PPGenCHET (1 λ The common parameter PP for generating the chameleon hash CHET with a brief trapdoor. chet Then run the key generation algorithm KGen. chet (PP chet ) Obtain the CHET public / private key pair (pk chet ,sk chet ); Run the bilinear group generator BilGen(1 λ Generates a bilinear group of prime order q Where p is a large prime number. and Let g be a p-order multiplicative cyclic group, and g be a group. In the elements, e represents a bilinear pair, and the hash function is chosen. string Mapped to The elements in the matrix, where j is the row index of the LSSS matrix, are hashed using hash function H2. message space Mapping to the key space k of the AES encryption algorithm, and choosing hash function H3: and H4: The message space of the solution The ciphertext space C of the AES encryption algorithm AES Mapped to the scheme's s respectively max and s max -1 dimensional random seed space Choose AES encryption and decryption algorithms (Enc... AES Dec AES Generate global parameters GP = (G, H1, H2, H3, H4, (Enc) SE Dec SE )), returns {GP, pk chet ,sk chet};

[0019] S12, The Central Authorization Authority (CA) runs the authorization authority initialization algorithm AuthSetup(GP, pk chet ,sk chet The algorithm (,u) generates keys for attribute authorization authorities. This algorithm receives global parameters GP and the CHET public key pk. chet ,CHET trap sk chet And attribute licensing agency u, select in, For a p-order field, Generate a public key for a random element in the domain. and master key Return to PK pch,u =(pkchet ,pk u ), sk pch,u =(sk chet msk u ).

[0020] Further, in step S2, the Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and retrieve the corresponding attribute authorization authority based on the vehicle's attributes. This attribute authorization authority is determined by the vehicle's global identifier (GID) ∈ Vehicle Global Identifier (GID) domain. Generate key sk GID And send it to the vehicle's onboard unit (OBU), specifically,

[0021] S21. The Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and generate a Global Identifier (GID) for the vehicle.

[0022] S22. The roadside unit (RSU) acquires vehicle attribute information, including the vehicle's location, direction, speed, and registration time. Based on the vehicle's attribute information, it retrieves the corresponding attribute authorization agency and initiates a key generation request to that attribute authorization agency.

[0023] S23, The attribute authorization agency runs the key generation algorithm KeyGen(GP,S,{sk pch,u},GID) generates a key sk for the vehicle GID Where GP is a global parameter, S is a set of vehicle attributes, and {sk pch,u =(sk chet msk u )} is the set of master keys associated with the attribute set S, GID is the user's global identifier, and the key sk GID The data is transmitted to the vehicle's onboard unit (OBU) via a secure channel.

[0024] Furthermore, in step S23, a key sk is generated for the vehicle. GID Specifically,

[0025] S231. For each attribute of the vehicle, attr∈S, select the corresponding attribute authorization agency. Generate the private key for the corresponding attribute attr in, For operations in the multiplication group, y u,j For domain The random elements in the array, where H1 is the hash function, s max M is the maximum width of the LSSS matrix, and GID is the global identifier of the vehicle.

[0026] S232, Obtain the key Among them, ssk GID,attrThe private key sk corresponds to the attribute attr for the vehicle GID. chet Let S be the private key and S be the set of vehicle attributes.

[0027] Further, in step S4, a chameleon hash value h and a random number r are generated for the editable transaction, and the transaction is packaged and a block is generated. Specifically,

[0028] S41. When generating blocks, the Roadside Unit (RSU) first runs the Chameleon Hash Algorithm to preprocess editable transactions, obtaining the Chameleon Hash value h and a random number r.

[0029] S42. The Roadside Unit (RSU) uses the Verify hash verification algorithm to verify whether the chameleon hash value h and the random number r are valid. If they are invalid, the transaction is abandoned and packaged into the block. If the verification is successful, the chameleon hash value h is used as the transaction without the random number r, and a Merkle root hash is generated together with the non-editable transaction. The Merkle root hash will be included in the block header.

[0030] S43. A block is generated from the block header and the block body. The block body stores the transactions in the blockchain, and the block header contains the basic information of the block, including the hash value of the previous block, the timestamp, and the Merkle root hash.

[0031] Further, in step S41, during the block generation process, the Roadside Unit (RSU) first preprocesses the editable transactions using the Chameleon Hash Algorithm to obtain the Chameleon hash value h and a random number r, specifically,

[0032] S411, Roadside Unit (RSU) runs the Chameleon Hash Algorithm Hash(GP,{pk pch The algorithm preprocesses editable transactions by accepting a global parameter GP and a public key set {pk} of the relevant authorizing authority. pch,u =(pk chet ,pk u The message msg and LSSS access structure (M, p) are used, where M is l×s max The function ρ maps the row index l of the matrix to the attribute attr.

[0033] S412. Run CHET's hash algorithm: (h chet ,r chet ,etd)=Hash chet (pk chet ,msg), to get the hash value h chet Random number r chet and a temporary trapdoor etd; then the algorithm selects a random number σ∈ from the message space. R Z pCalculate the AES key k = H2(σ), and use the key k to encrypt the temporary trapdoor etd: C m =Enc AES (k, etd) yields the ciphertext C. m ;

[0034] S413. Use hash functions H3, H4, and H5 respectively to hash σ and C. m As a random seed, a random vector is obtained. (r1,...,r l )=H5(σ,C m ), where v, x, (r1,…,r l All are random vectors, where each element is a random number. Calculate:

[0035] C0 = e(g,g) z ·σ

[0036]

[0037]

[0038] Among them, M i For the i-th row of M, M i,j Let C0 and Cj be the values ​​in the i-th row and j-th column of M. 1,i C 2,j C 3,i,j The calculation results are used as a component of the encrypted CT.

[0039] Set the ciphertext to Return (h,r) = ((h chet ,CT),r chet ).

[0040] Further, in step S42, the roadside unit (RSU) uses the hash verification algorithm Verify to verify whether the chameleon hash value h and the random number r are valid. Specifically,

[0041] Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the generated chameleon hash h and random number r using the formula pk. pch =(pk chet ,pk u ), message msg, hash value h = (h chet ,CT) and random number r = r chet , where h chet Given the hash value and CT as the ciphertext, run CHET's hash verification algorithm and return b: b = Verify chet (pk chet,msg,h chet ,r chet ).

[0042] Further, in step S5, a new random number r' is generated by the Chameleon Hash Adapt algorithm, specifically as follows:

[0043] S51, Vehicle Operation Hash Adaptation Algorithm Adapt(GP,GID,sk) GID The algorithm generates random numbers for new messages using the formula (msg, msg′, h, r). It accepts the global parameter GP, the user's global identifier GID, and the private key. Message msg and msg', hash value h = (h chet ,CT) and random number r = r chet Among them, ciphertext Select the subset corresponding to the row in M. private key {ssk GID,ρ(i)} i∈I The decryptor finds (1,0,...,0) = ∑ i∈I w i M i The set {w i} i∈I If such a set does not exist, decryption fails; otherwise, decryption succeeds, and proceed to the next step S52.

[0044] S52. Calculate σ′:

[0045]

[0046] S53. Calculate the AES key k′=H2(σ′), and use hash functions H3, H4 and H5 respectively to hash σ′ and C′. m As a random seed, calculate the random vector.

[0047] S54, Calculation in

[0048] C′0=e(g,g) z ·σ′

[0049]

[0050]

[0051] S55. If CT′ = CT is not true, then stop the calculation and return an error; otherwise, calculate the temporary trapdoor etd′ = Dec. AES (k′,C m Finally, it returns r′ = Adapt chet (skchet ,etd′,msg,msg′,h,r chet ).

[0052] Further, in step S6, the roadside unit (RSU) runs the hash verification algorithm Verify to verify the chameleon hash value h and the new random number r'. If the verification fails, block editing is aborted; if the verification passes, the new transaction is uploaded to the block with block number Block_num. Specifically,

[0053] Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the new random number r' generated in step S5 using the formula msg′,h,r′. The algorithm accepts any public key pk. pch =(pk chet ,pk u ), message msg', hash value h = (h chet ,CT) and a new random number r', where h chet Here, CT is the hash value and ciphertext is the ciphertext. The CHET hash verification algorithm is run: b = Verify. chet (pk chet ,msg′,h chet If b is 0, the verification fails and the blockchain transaction editing is stopped; otherwise, the verification passes and the new transaction is uploaded to the block with block number Block_num.

[0054] The beneficial effects of this invention are: Compared with the prior art, this access control method for shared vehicle network data based on editable blockchain achieves access control of shared data by using attribute encryption and editable blockchain technology, which enables fine-grained access control for editing blockchain transactions. It can ensure that editability is presented to users who meet the policy (i.e., legitimate users) and that immutability is presented to users who do not meet the policy (i.e., unauthorized users). Attached Figure Description

[0055] Figure 1 This is a flowchart illustrating an embodiment of the present invention regarding an access control method for shared vehicle network data based on an editable blockchain.

[0056] Figure 2 This is an illustrative diagram illustrating the policy-based chameleon hash MA-PCH of the multi-attribute authorization authority in the embodiment;

[0057] Figure 3 This is an illustrative diagram illustrating the editable blockchain structure based on MA-PCH in the embodiment. Detailed Implementation

[0058] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0059] Example

[0060] An access control method for vehicle-to-everything (V2X) shared data based on an editable blockchain, such as... Figure 1 and Figure 2 This includes the following steps:

[0061] S1. Perform global initialization on the blockchain-based vehicle networking system. During global initialization, the central authorized agency (CA) generates a global parameter GP, a public key and a private key (pk) of a chameleon hash CHET with a ephemeral trapdoor. chet ,sk chet ); Attribute granting authority u∈Attribute granting authority index domain When joining the system, a registration request is sent to the central authority (CA), which generates a public key and a master key for the attribute authority u.

[0062] S11, The Central Authorized Agency (CA) runs the global initialization algorithm GlobalSetup(1 λ ,s max The algorithm generates global parameters, receiving a security parameter λ and the maximum width s of the linear secret sharing scheme matrix M supported by the scheme, i.e., the LSSS matrix. max =s max (λ), run the common parameter generation algorithm PPGen CHET (1 λ The common parameter PP for generating the chameleon hash CHET with a brief trapdoor. chet Then run the key generation algorithm KGen. chet (PP chet ) Obtain the CHET public / private key pair (pk chet ,sk chet ); Run the bilinear group generator BilGen(1 λ Generates a bilinear group of prime order q Where p is a large prime number. and Let g be a p-order multiplicative cyclic group, and g be a group. In the array, e represents a bilinear pair, and the hash function H1 is chosen: string Mapped to The elements in the matrix, where j is the row index of the LSSS matrix, are hashed using hash function H2. message space Mapping to the key space k of the AES encryption algorithm, and choosing hash function H3: and H4: The message space of the solution The ciphertext space C of the AES encryption algorithmAES Mapped to the scheme's s respectively max and s max -1 dimensional random seed space Choose AES encryption and decryption algorithms (Enc... AES Dec AES Generate global parameters GP = (G, H1, H2, H3, H4, (Enc) SE Dec SE )), returns {GP, pk chet ,sk chet};

[0063] In step S11, the global initialization algorithm GlobalSetup(1) is used. λ ,s max → (GP, pk) chet ,sk chet Input the unary security parameter λ and the maximum width s of the LSSS matrix supported by the scheme. max =s max (λ), outputs the system's global parameters GP and global CHET public key pk. chet Global CHET trap sk chet This assumes that the GP implicitly includes the authorizing authority domain. And the user global identifier field GID.

[0064] S12, The Central Authorization Authority (CA) runs the authorization authority initialization algorithm AuthSetup(GP, pk chet ,sk chet The algorithm (,u) generates keys for attribute authorization authorities. This algorithm receives global parameters GP and the CHET public key pk. chet ,CHET trap sk chet And attribute licensing agency u, select in, For a p-order field, Generate a public key for a random element in the domain. and master key Return to PK pch,u =(pk chet ,pk u ), sk pch,u =(sk chet msk u ).

[0065] In step S1, system initialization and vehicle registration are performed. The scheme includes a central authorizing authority and multiple attribute authorizing authorities. Vehicles or Roadside Units (RSUs) in the system can become attribute authorizing authorities at any time by running the AuthSetup algorithm.

[0066] S2. Vehicle registration: When a vehicle joins the system, the Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and retrieve the corresponding attribute authorization authority based on the vehicle's attributes. This attribute authorization authority is determined by the vehicle's Global Identifier (GID) ∈ Vehicle Global Identifier field. Generate key sk GID And send it to the vehicle's onboard unit (OBU);

[0067] S21. The Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and generate a Global Identifier (GID) for the vehicle.

[0068] S22. The roadside unit (RSU) acquires vehicle attribute information, including the vehicle's location, direction, speed, and registration time. Based on the vehicle's attribute information, it retrieves the corresponding attribute authorization agency and initiates a key generation request to that attribute authorization agency.

[0069] S23, The attribute authorization agency runs the key generation algorithm KeyGen(GP,S,{sk pch,u},GID) generates a key sk for the vehicle GID Where GP is a global parameter, S is a set of vehicle attributes, and {sk pch,u =(sk chet msk u )} is the set of master keys associated with the attribute set S, GID is the user's global identifier, and the key sk GID The data is transmitted to the vehicle's onboard unit (OBU) via a secure channel.

[0070] In step S23, a key sk is generated for the vehicle. GID Specifically,

[0071] S231. For each attribute of the vehicle, attr∈S, select the corresponding attribute authorization agency. Generate the private key for the corresponding attribute attr in, For operations in the multiplication group, y u,j For domain The random elements in the array, where H1 is the hash function, s max M is the maximum width of the LSSS matrix, and GID is the global identifier of the vehicle.

[0072] S232, Obtain the key Among them, ssk GID,attr The private key sk corresponds to the attribute attr for the vehicle GID. chet Let S be the private key and S be the set of vehicle attributes.

[0073] S3. Shared data upload: The vehicle uses the Advanced Encryption Standard (AES) algorithm to encrypt the shared data into ciphertext CT. AES Uploaded to a cloud server, the AES key is then encrypted using the Revocable Cipher Policy Attribute Encryption Algorithm RCP-ABE to generate ciphertext CT. ABE , ciphertext CT ABE The transaction is uploaded to the editable blockchain.

[0074] S4. Block Generation: After a specified time or after the number of uploaded messages reaches a set number, the Roadside Unit (RSU) generates a chameleon hash value h and a random number r for editable transactions. After packaging all transactions, including editable and non-editable transactions, and generating blocks, it sends the transaction number Trans_nums and the block number Block_num of the editable transactions to the corresponding vehicle's Onboard Unit (OBU) so that the vehicle can subsequently retrieve and edit the transactions.

[0075] In step S4, a chameleon hash value h and a random number r are generated for the editable transaction. The transaction is then packaged and a block is generated. Specifically,

[0076] S41. When generating blocks, the Roadside Unit (RSU) first runs the Chameleon Hash Algorithm to preprocess editable transactions, obtaining the Chameleon Hash value h and a random number r.

[0077] S411, Roadside Unit (RSU) runs the Chameleon Hash Algorithm Hash(GP,{pk pch The algorithm preprocesses editable transactions by accepting a global parameter GP and a public key set {pk} of the relevant authorizing authority. pch,u =(pk chet ,pk u The message msg and LSSS access structure (M, p) are used, where M is l×s max The function ρ maps the row index l of the matrix to the attribute attr.

[0078] S412. Run CHET's hash algorithm: (h chet ,r chet ,etd)=Hash chet (pk chet ,msg), to get the hash value h chet Random number r chet And a temporary trapdoor etd; then the algorithm selects a random number from the message space. Calculate the AES key k = H2(σ), and use the key k to encrypt the temporary trapdoor etd: C m =Enc AES (k, etd) yields the ciphertext C. m ;

[0079] S413. Use hash functions H3, H4, and H5 respectively to hash σ and C. m As a random seed, a random vector is obtained. Where v, x, (r1,…,r) l All are random vectors, where each element is a random number. Calculate:

[0080] C0 = e(g,g) z ·σ

[0081]

[0082]

[0083] Among them, M i For the i-th row of M, M i,j Let C0 and Cj be the values ​​in the i-th row and j-th column of M. 1,i C 2,j C 3,i,j The calculation results are used as a component of the encrypted CT.

[0084] Set the ciphertext to Return (h,r) = ((h chet ,CT),r chet ).

[0085] S42. The Roadside Unit (RSU) uses the Verify hash verification algorithm to verify whether the chameleon hash value h and the random number r are valid. If they are invalid, the transaction is abandoned and packaged into the block. If the verification is successful, the chameleon hash value h is used as the transaction without the random number r, and a Merkle root hash is generated together with the non-editable transaction. The Merkle root hash will be included in the block header.

[0086] In step S42, the roadside unit (RSU) uses the hash verification algorithm Verify to verify whether the chameleon hash value h and the random number r are valid. Specifically,

[0087] Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the generated chameleon hash h and random number r using the formula pk. pch =(pk chet ,pk u ), message msg, hash value h = (h chet ,CT) and random number r = r chet , where h chet Given the hash value and CT as the ciphertext, run CHET's hash verification algorithm and return b: b = Verify chet(pk chet ,msg,h chet ,r chet ).

[0088] S43. A block is generated from the block header and the block body. The block body stores the transactions in the blockchain, and the block header contains the basic information of the block, including the hash value of the previous block, the timestamp, and the Merkle root hash.

[0089] In step S43, such as Figure 3 Each block in a blockchain consists of a block header and a block body. The block body stores detailed information about the transactions in the blockchain, while the block header contains basic information about the block, such as the hash value of the previous block, a timestamp, and the root hash value of the Merkle tree. Traditional blockchain structures use collision-resistant hash functions. To achieve blockchain editability, a chameleon hash function is used when generating the Merkle tree. Users with a chameleon hash function trapdoor can edit transactions without compromising the blockchain's hash consistency.

[0090] S5. Perform transaction retrieval. The attribute in the access strategy is revoked. The vehicle needs to access the encrypted CT. ABE During the update process, after the vehicle generates new ciphertext, it sends a block edit request to the Roadside Unit (RSU). The vehicle provides the transaction number Trans_nums and the block number Block_num to the RSU. The RSU retrieves the transaction based on the transaction number Trans_nums and the block number Block_num, and generates a new random number r' using the Chameleon Hash Adapt algorithm before proceeding to the next step S6.

[0091] In step S5, a new random number r' is generated by the Chameleon Hash Adapt algorithm, specifically as follows:

[0092] S51, Vehicle Operation Hash Adaptation Algorithm Adapt(GP,GID,sk) GID The algorithm generates random numbers for new messages using the formula (msg, msg′, h, r). It accepts the global parameter GP, the user's global identifier GID, and the private key. Message msg and msg', hash value h = (h chet ,CT) and random number r = r chet Among them, ciphertext Select the subset corresponding to the row in M. private key {ssk GID,ρ(i)} i∈I The decryptor finds (1,0,...,0) = ∑ i∈I w i M i The set {wi} i∈I If such a set does not exist, decryption fails; otherwise, decryption succeeds, and proceed to the next step S52.

[0093] S52. Calculate σ′:

[0094]

[0095] S53. Calculate the AES key k′=H2(σ′), and use hash functions H3, H4 and H5 respectively to hash σ′ and C′. m As a random seed, calculate the random vector.

[0096] S54, Calculation in

[0097] C′0=e(g,g) z ·σ′

[0098]

[0099]

[0100] S55. If CT′ = CT is not true, then stop the calculation and return an error; otherwise, calculate the temporary trapdoor etd′ = Dec. AES (k′,C m Finally, it returns r′ = Adapt chet (sk chet ,etd′,msg,msg′,h,r chet ).

[0101] S6. Perform block editing. The Roadside Unit (RSU) runs the Verify hash verification algorithm to verify the chameleon hash value h and the new random number r'. If the verification fails, block editing is aborted; if the verification passes, the new transaction is uploaded to the block with block number Block_num. Specifically,

[0102] Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the new random number r' generated in step S5 using the formula msg′,h,r′. The algorithm accepts any public key pk. pch =(pk chet ,pk u ), message msg', hash value h = (h chet ,CT) and a new random number r', where h chet Here, CT is the hash value and ciphertext is the ciphertext. The CHET hash verification algorithm is run: b = Verify. chet (pk chet,msg′,h chet If b is 0, the verification fails and the blockchain transaction editing is stopped; otherwise, the verification passes and the new transaction is uploaded to the block with block number Block_num.

[0103] Compared with existing technologies, this access control method for vehicle network shared data based on editable blockchain achieves access control of shared data by using attribute encryption and editable blockchain technology, which enables fine-grained access control for editing blockchain transactions. It ensures editability for users who meet the policy (i.e., legitimate users) and immutability for users who do not meet the policy (i.e., unauthorized users).

[0104] This access control method for shared data in the Internet of Vehicles (IoV) based on an editable blockchain modifies traditional consortium blockchains using policy-based chameleon hashing (MA-PCH). This allows the data keys stored within to be edited by parties meeting specific policies, while maintaining immutability for parties not meeting the policies. This decouples shared data and its access policies within the IoV. The actual shared data is stored on a cloud server, while the keys for decrypting the data are encrypted using attribute encryption to set access policies and then stored on the editable blockchain. Setting access policies for the keys enables fine-grained access control for data sharing, and storing the keys on the editable blockchain ensures that these access policies can be edited in a fine-grained manner.

[0105] This invention improves upon existing policy-based Chameleon Hash (PCH) by introducing a policy-based Chameleon Hash (MA-PCH) with multiple attribute-authorizing authorities and a central authorizing authority. Traditional PCH schemes for editing blockchains suffer from single-point-of-failure issues due to reliance on a central authorizing authority for key generation, causing the blockchain to lose its decentralized nature. The MA-PCH scheme, however, uses multiple attribute-authorizing authorities to handle key generation, avoiding single-point-of-failure problems and preserving the decentralized nature of the editable blockchain to some extent.

[0106] This access control method for vehicle-to-everything (V2X) data sharing based on editable blockchain improves the blockchain structure by using the MA-PCH scheme when generating the root hash. This ensures that the Merkle value is not changed while modifying transactions on the blockchain, thus keeping the block header hash value unchanged and enabling the blockchain to support transaction editing.

[0107] This method for access control of shared data in vehicle-to-everything (V2X) networks, based on an editable blockchain, addresses the issue of insufficient privacy protection for shared data in V2X systems by enabling access control and access policy updates. The method proposes a V2X model based on an editable blockchain, defining RSUs as pre-selected nodes responsible for executing the consensus process and packaging blocks. It modifies the traditional consortium blockchain using a policy-based chameleon hashing mechanism (MA-PCH) with multiple attribute-based authorization authorities. This allows data stored within the blockchain to be edited by parties meeting specific policies, while maintaining immutability for parties not meeting the policies. This decouples shared data from its access policies. The key for decrypting the actual data is encrypted using attributes and stored on the blockchain. The encrypted key contains the access policy for the shared data. Vehicles meeting the MA-PCH access policy can modify the key on the blockchain to update the access policy. The MA-PCH scheme uses multiple attribute-based authorization authorities to execute key generation algorithms, maintaining the decentralized nature of the editable blockchain.

[0108] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. An access control method for vehicle-to-everything (V2X) shared data based on an editable blockchain, characterized in that: Includes the following steps, S1. Perform global initialization on the blockchain-based vehicle networking system. During global initialization, the central authorized agency (CA) generates a global parameter GP, a public key and a private key (pk) of a chameleon hash CHET with a ephemeral trapdoor. chet ,sk chet ); Attribute granting authority u∈Attribute granting authority index domain When joining the system, a registration request is sent to the central authority (CA), which generates a public key and a master key for the attribute authority u. S2. Vehicle registration: When a vehicle joins the system, the Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and retrieve the corresponding attribute authorization authority based on the vehicle's attributes. This attribute authorization authority is determined by the vehicle's Global Identifier (GID) ∈ Vehicle Global Identifier field. Generate key sk GID And send it to the vehicle's onboard unit (OBU); S3. Shared data upload: The vehicle uses the Advanced Encryption Standard (AES) algorithm to encrypt the shared data into ciphertext CT. AES Uploaded to a cloud server, the AES key is then encrypted using the Revocable Cipher Policy Attribute Encryption Algorithm RCP-ABE to generate ciphertext CT. ABE , ciphertext CT ABE The transaction is uploaded to the editable blockchain; S4. Generate a block. After a specified time or after the number of uploaded messages reaches a set number, the Roadside Unit (RSU) generates a chameleon hash value h and a random number r for editable transactions. After packaging all transactions, including editable and non-editable transactions, and generating a block, it sends the transaction number Trans_nums and the block number Block_num of the editable transactions to the corresponding vehicle's Onboard Unit (OBU). S5. Perform transaction retrieval. The attribute in the access strategy is revoked. The vehicle needs to access the encrypted CT. ABE During the update process, after the vehicle generates new ciphertext, it sends a block edit request to the Roadside Unit (RSU). The vehicle provides the transaction number Trans_nums and the block number Block_num to the RSU. The RSU retrieves the transaction based on the transaction number Trans_nums and the block number Block_num, and generates a new random number r' using the Chameleon Hash Adapt algorithm before proceeding to the next step S6. S6. Perform block editing. The Roadside Unit (RSU) runs the Verify hash verification algorithm to verify the chameleon hash value h and the new random number r'. If the verification fails, the block editing is aborted; if the verification passes, the new transaction is uploaded to the block with the block number Block_num.

2. The access control method for vehicle network shared data based on editable blockchain as described in claim 1, characterized in that: In step S1, the Central Authorized Authority (CA) generates a global parameter GP, a public key and a private key (pk) of a chameleon hash CHET with a ephemeral trapdoor during global initialization. chet ,sk chet ); Attribute granting authority u∈Attribute granting authority index domain Upon joining the system, a registration request is sent to the Central Authorization Authority (CA). The CA generates a public key and a master key for the attribute authorization authority u. Specifically, S11, The Central Authorized Agency (CA) runs the global initialization algorithm GlobalSetup(1 λ ,s max The algorithm generates global parameters, receiving a security parameter λ and the maximum width s of the linear secret sharing scheme matrix M supported by the scheme, i.e., the LSSS matrix. max =s max (λ), run the common parameter generation algorithm PPGen CHET (1 λ The common parameter PP for generating the chameleon hash CHET with a brief trapdoor. chet Then run the key generation algorithm KGen. chet (PP chet ) Obtain the CHET public / private key pair (pk chet ,sk chet ); Run the bilinear group generator BilGen(1 λ Generate a bilinear group of prime order p Where p is a large prime number. and Let g be a p-order multiplicative cyclic group, and g be a group. In the array, e represents a bilinear pair, and the hash function H1 is chosen: string Mapped to The elements in the matrix, where j is the row index of the LSSS matrix, are hashed using hash function H2. message space Mapping to the key space k of the AES encryption algorithm, and choosing hash function H3: and H4: The message space of the solution The ciphertext space C of the AES encryption algorithm AES Mapped to the scheme's s respectively max and s max -1 dimensional random seed space Choose AES encryption and decryption algorithms (Enc... AES Dec AES Generate global parameters GP = (G, H1, H2, H3, H4, (Enc) SE Dec SE )), returns {GP, pk chet ,sk chet }; S12, The Central Authorization Authority (CA) runs the authorization authority initialization algorithm AuthSetup(GP, pk chet ,sk chet The algorithm (,u) generates keys for attribute authorization authorities. This algorithm receives global parameters GP and the CHET public key pk. chet ,CHET trap sk chet And attribute licensing agency u, select in, For a p-order field, Generate a public key for a random element in the domain. and master key Return to PK pch,u =(pk chet ,pk u ), sk pch,u =(sk chet msk u ).

3. The access control method for vehicle network shared data based on editable blockchain as described in claim 1, characterized in that: In step S2, the Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and retrieve the corresponding attribute authorization authority based on the vehicle's attributes. This attribute authorization authority is determined by the vehicle's Global Identifier (GID) ∈ Vehicle Global Identifier field. Generate key sk GID And send it to the vehicle's onboard unit (OBU), specifically, S21. The Roadside Unit (RSU) will authenticate the vehicle's Onboard Unit (OBU) and generate a Global Identifier (GID) for the vehicle. S22. The roadside unit (RSU) acquires vehicle attribute information, including the vehicle's location, direction, speed, and registration time. Based on the vehicle's attribute information, it retrieves the corresponding attribute authorization agency and sends a key generation request to that agency. S23, The attribute authorization agency runs the key generation algorithm KeyGen(GP,S,{sk pch,u },GID) generates a key sk for the vehicle GID Where GP is a global parameter, S is a set of vehicle attributes, and {sk pch,u =(sk chet msk u )} is the set of master keys associated with the attribute set S, GID is the user's global identifier, and the key sk GID The data is transmitted to the vehicle's onboard unit (OBU) via a secure channel.

4. The access control method for vehicle network shared data based on editable blockchain as described in claim 3, characterized in that: In step S23, a key sk is generated for the vehicle. GID Specifically, S231. For each attribute of the vehicle, attr∈S, select the corresponding attribute authorization agency. Generate the private key for the corresponding attribute attr in, For operations in the multiplication group, y u,j For domain The random elements in the array, where H1 is the hash function, s max M is the maximum width of the LSSS matrix, and GID is the global identifier of the vehicle. S232, Obtain the key Among them, ssk GID,attr The private key sk corresponds to the attribute attr for the vehicle GID. chet Let S be the private key and S be the set of vehicle attributes.

5. The access control method for vehicle network shared data based on editable blockchain as described in any one of claims 2-4, characterized in that: In step S4, a chameleon hash value h and a random number r are generated for the editable transaction. The transaction is then packaged and a block is generated. Specifically, S41. When generating blocks, the Roadside Unit (RSU) first runs the Chameleon Hash Algorithm to preprocess editable transactions, obtaining the Chameleon Hash value h and a random number r. S42. The Roadside Unit (RSU) uses the Verify hash verification algorithm to verify whether the chameleon hash value h and the random number r are valid. If they are invalid, the transaction is abandoned and packaged into the block. If the verification is successful, the chameleon hash value h is used as the transaction without the random number r, and a Merkle root hash is generated together with the non-editable transaction. The Merkle root hash will be included in the block header. S43. A block is generated from the block header and the block body. The block body stores the transactions in the blockchain, and the block header contains the basic information of the block, including the hash value of the previous block, the timestamp, and the Merkle root hash.

6. The access control method for vehicle network shared data based on editable blockchain as described in claim 5, characterized in that: In step S41, during the block generation process, the Roadside Unit (RSU) first preprocesses the editable transactions using the Chameleon Hash Algorithm to obtain the Chameleon hash value h and a random number r. Specifically, S411, Roadside Unit (RSU) runs the Chameleon Hash Algorithm Hash(GP,{pk pch The algorithm preprocesses editable transactions using the parameters GP and the public key set {pk} of the relevant authorizing authority. pch,u =(pk chet ,pk u The structure (M, p) is used to access the message msg and LSSS, where M is l×s. max The function ρ maps the row index l of the matrix to the attribute attr. S412. Run CHET's hash algorithm: (h chet ,r chet ,etd)=Hash chet (pk chet ,msg), to get the hash value h chet Random number r chet and a temporary trapdoor etd; then the algorithm selects a random number σ∈ from the message space. R Z p Calculate the AES key k = H2(σ), and use the key k to encrypt the temporary trapdoor etd: C m =Enc AES (k, etd) yields the ciphertext C. m ; S413. Use hash functions H3, H4, and H5 respectively to hash σ and C. m As a random seed, a random vector is obtained. (r1,...,r l )=H5(σ,C m ), Where v, x, (r1,…,r) l All are random vectors, where each element is a random number. Calculate: C0=e(g,g) z ·σ Among them, M i For the i-th row of M, M i,j Let C0 and Cj be the values ​​in the i-th row and j-th column of M. 1,i C 2,j C 3,i,j The calculation results are used as a component of the encrypted CT. Set the ciphertext to Return (h,r) = ((h chet ,CT),r chet ).

7. The access control method for vehicle network shared data based on editable blockchain as described in claim 6, characterized in that: In step S42, the roadside unit (RSU) uses the hash verification algorithm Verify to verify whether the chameleon hash value h and the random number r are valid. Specifically, Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the generated chameleon hash h and random number r using the formula pk. pch =(pk chet ,pk u ), message msg, hash value h = (h chet ,CT) and random number r=r chet , where h chet Given the hash value and CT as the ciphertext, run CHET's hash verification algorithm and return b: b = Verify chet (pk chet ,msg,h chet ,r chet ).

8. The access control method for vehicle network shared data based on editable blockchain as described in any one of claims 2-4, characterized in that: In step S5, a new random number r' is generated by the Chameleon Hash Adapt algorithm, specifically as follows: S51, Vehicle Operation Hash Adaptation Algorithm Adapt(GP,GID,sk) GID The algorithm generates random numbers for new messages using the formula (msg, msg′, h, r). It accepts the global parameter GP, the user's global identifier GID, and the private key. Message msg and msg', hash value h = (h chet ,CT) and random number r=r chet Among them, ciphertext Select the subset corresponding to the row in M. private key {ssk GID,ρ(i) } i∈I The decryptor finds (1,0,...,0) = ∑ i∈I w i M i The set {w i } i∈I If such a set does not exist, decryption fails; otherwise, decryption succeeds, and proceed to the next step S52. S52. Calculate σ′: S53. Calculate the AES key k′=H2(σ′), and use hash functions H3, H4 and H5 respectively to hash σ′ and C′. m As a random seed, calculate the random vector. (r′1,...,r′ l )=H5(σ′,C m ); S54, Calculation in S55. If CT′ = CT is not true, then stop the calculation and return an error; otherwise, calculate the temporary trapdoor etd′ = Dec. AES (k′,C m Finally, it returns r′ = Adapt chet (sk chet ,etd′,msg,msg′,h,r chet ).

9. The access control method for vehicle network shared data based on editable blockchain as described in claim 8, characterized in that: In step S6, the roadside unit (RSU) runs the Verify hash verification algorithm to verify the chameleon hash value h and the new random number r'. If the verification fails, block editing is aborted; if the verification passes, the new transaction is uploaded to the block with block number Block_num. Specifically, Roadside Units (RSUs) run the hash verification algorithm Verify(pk) pch The algorithm verifies the new random number r' generated in step S5 using the formula msg′,h,r′. The algorithm accepts any public key pk. pch =(pk chet ,pk u ), message msg', hash value h = (h chet ,CT) and a new random number r', where h chet Here, CT is the hash value and ciphertext is the ciphertext. The CHET hash verification algorithm is run: b = Verify. chet (pk chet ,msg′,h chet If b is 0, the verification fails and the blockchain transaction editing is stopped; otherwise, the verification passes and the new transaction is uploaded to the block with block number Block_num.