Cross-chain method and system for urban vehicle networking based on ciphertext revocable attribute encryption
By using ciphertext revocable attribute encryption technology in the Internet of Vehicles, and using hash time lock contracts and access tree structures to encrypt and decrypt urban road data, the data privacy and security issues caused by blockchain disclosure are solved. It realizes efficient data transmission and fine-grained access control, ensuring data confidentiality and security.
Patent Information
- Application Number
- CN202410462943.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-04-17
AI Technical Summary
In the existing Internet of Vehicles technology, the openness of blockchain results in the inability to ensure privacy and security of data during transmission, and the inability to effectively protect the confidentiality of vehicle data.
The cross-chain method of urban vehicle networking based on ciphertext revocable attribute encryption is adopted. The public parameters and master key of the encryption system are generated through the trusted hub center. The vehicle registers and generates the attribute private key when driving in the urban area, and uses a hash time lock contract The and access tree structure encrypts and decrypts the data, ensuring that the data can only be decrypted and accessed within a specific time period and meets access control conditions.
It realizes the effect of ensuring the confidentiality of business data while ensuring safe and efficient data transmission efficiency, solves the problem of data security and operation mode discrete in urban vehicle networking, and realizes fine-grained access control.
Smart Images

Figure CN118233861B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle networking technology, and in particular to a cross-chain method and system for urban vehicle networking based on ciphertext revocable attribute encryption. Background Art
[0002] At present, blockchain technology is widely used in the field of Internet of Vehicles for vehicle data transmission, which can improve the efficiency of data transmission to a certain extent. However, the public nature of blockchain means that data can be obtained by all parties participating in the consensus during the transmission process, which to a certain extent damages the privacy and confidentiality of the data. In addition, blockchain technology alone cannot guarantee that vehicle data can be safely transmitted on the chain.
[0003] Therefore, the Chinese patent with publication number CN114980023A discloses a method for sharing Internet of Vehicles data based on cross-chain technology. Although it can realize the information storage and cross-chain synchronization of newly connected vehicles by arranging smart contracts on the chain, it ignores the confidentiality of data during transmission and cannot effectively guarantee the security of Internet of Vehicles data during transmission. Summary of the invention
[0004] In view of the defects in the prior art, the present invention provides a cross-chain method and system for urban Internet of Vehicles based on ciphertext revocable attribute encryption.
[0005] According to a method and system for cross-chaining of urban vehicle networks based on ciphertext revocable attribute encryption provided by the present invention, the scheme is as follows:
[0006] In a first aspect, a cross-chain method for urban vehicle networking based on ciphertext revocable attribute encryption is provided, the method comprising:
[0007] Step S1: Execute the Setup function through the trusted hub center and use the security parameter λ as input to generate the public parameter PK and master key MK required by the encryption system;
[0008] Step S2: When vehicles of different models travel in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data;
[0009] Step S3: After the vehicle is successfully registered, vehicle users of different models execute the Keygen function to generate corresponding attribute private keys based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center;
[0010] Step S4: Assume that the two parties of the same vehicle have agreed to start transaction management when exchanging urban road data across regions, and send the SM2 public key to each other for cross-chain communication;
[0011] Step S5: Set the vehicle in urban area A to randomly select a secret string S and perform a hash operation on S. According to the negotiated content, the hash time lock contract C0 is called to interact with urban road data. At the same time, the corresponding access tree structure and the effective access time of the file are set to encrypt the transmitted urban road data information and upload it to the IPFS interplanetary file system. After the hash time lock contract C0 is successfully deployed, it will be broadcast to the entire network;
[0012] Step S6: Set that after vehicles in urban area B monitor the hash time lock contract C0 for road data interaction deployed by vehicles in urban area A, they need to respond within timestamp0, otherwise, C0 will be automatically invalidated due to timeout;
[0013] Step S7: After monitoring the contract C1 deployed on the chain by the vehicle in city B, the vehicle in city A also uses the attribute private key Decrypt the encrypted data stored in the IPFS interplanetary file system and confirm the validity of urban road data information;
[0014] Step S8: After the entire process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit the transaction and complete the data exchange, thus completing the transaction of the first phase;
[0015] Step S9: The second phase of the transaction begins. Vehicles in different urban areas submit the packaged transaction package and the hash value of the transaction package to the traffic management department of their respective urban areas through the trusted relay chain of the urban area to which they belong;
[0016] Step S10: After receiving the ciphertext sent by the vehicles from City A and City B respectively, the traffic management departments of City A and City B use their own attribute private keys to decrypt the ciphertext to obtain the plaintext and the signature of the vehicle, and verify the validity of the signature;
[0017] Step S11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information, thereby completing the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
[0018] Preferably, the step S1 comprises:
[0019] Choose a bilinear group G0 of prime order p, whose generator is g, and choose two random exponents The public parameters and master key are expressed as:
[0020] PK=(G0,g,h=g ν ,e(g,g) μ )
[0021] MK=(ν,g μ )
[0022] Where h represents the result of the operation of the generator g in the G0 group to the power of ν; g ν represents the result of the operation of the generator g in the G0 group to the power of ν; g μ represents the result of the operation of the μ-th power of the generator g in the G0 group; e(g,g) μ represents a binary operation between the generator g in the group and g itself (such as the multiplication operation in the group), and μ is an integer exponent.
[0023] Preferably, step S2 comprises:
[0024] During the registration process, vehicles of different models will provide their own attribute information and associate it with the identity of the vehicle owner. The trusted authority center confirms the attributes provided by the vehicle to determine whether the attributes are legal. If they are legal, it returns the authority flag flag = true, otherwise it returns flag = false.
[0025] Preferably, in step S3, the input parameters of the Keygen function include the master key MK and a set S about time, S includes the authorization attributes of the currently registered vehicle and all corresponding time interval numbers T within its validity period; the set N is expressed as follows:
[0026]
[0027] The key generation algorithm randomly selects Then, for each attribute j∈N of the vehicle and traffic management department, a random Among them, r represents Random numbers on ; represents a set of p elements; j represents the attributes of each entity in the urban vehicle network; then calculate the key Veh SK for:
[0028]
[0029] Where D represents the operation result of the generator g in the G0 group, which is also the public partial key; η represents the time interval; Indicates the starting time of attribute j within the validity period; Indicates the expiration time of attribute j within the validity period; D j,η represents the partial key associated with attribute j of time interval η; It means taking attribute j and time interval η as input to calculate the corresponding hash value and multiplying it by r j times; D' j represents the partial key associated with attribute j; represents the r of the generator g in the G0 group j The result of raising the power.
[0030] Preferably, step S6 includes: the vehicle in urban area B first uses the attribute private key in the response process The encrypted content is decrypted to confirm the validity of the information. After confirmation, the hash time lock contract C1 is written according to the negotiated content, and the acquisition condition of the file hash identifier Info1 corresponding to the urban road data on IPFS is set to that the vehicles in urban area A provide the secret string S of Z; then the vehicles in urban area B also set the access tree structure and the effective access time of the file to encrypt the urban road data and upload it to the IPFS interstellar file system, and then deploy the cross-chain smart contract.
[0031] Preferably, confirming the validity of the urban road data information in step S7 includes:
[0032] If there is a problem, the transaction will be rolled back to invalidate the contract; if it meets the requirements, the vehicle in urban area A will send the secret string S to the contract C1 deployed on the chain by the vehicle in urban area B within the specified time to unlock the file hash identifier Info1 in C1; the vehicle in urban area B obtains the secret string S provided by the vehicle in urban area A through observation, and then sends S to C0 to unlock the file hash identifier Info0; the vehicle in urban area A needs to unlock the data within the timestamp1 timestamp, otherwise the entire data interaction process will be rolled back due to timeout.
[0033] Preferably, the step S8 comprises:
[0034] After the first phase of the transaction is completed, the proxy nodes selected by the vehicle chains in each urban area according to the RAFT consensus algorithm will trade all urban road data in this period Tx1, Tx2...Tx n Packing and generating a hash value for the transaction package, and finally signing the transaction package using the SM2 signature algorithm;
[0035] Specifically, the multiple data interactions are arranged in chronological order, and the hash values of each group of transactions are calculated in pairs, and then their hash values are recursively calculated in the same way to finally generate a Merkle Root hash value, that is, SHA-256 (Tx 1n )=(((SHA-256(Tx1)||SHA-256(Tx2))
[0036] ||(SHA-256(Tx3)||SHA-256(Tx4)))...||SHA-256(Tx n )), and then enter the second stage of affairs;
[0037] Among them, Tx 1n Indicates transaction Tx1 to transaction Tx n SHA stands for Secure Hash Algorithm.
[0038] Preferably, the step S9 comprises:
[0039] The vehicles in urban areas A and B use the proposed HR-CP-ABE algorithm to set the access strategy and effective access time of the transaction package. And the hash value of the transaction package and their respective signatures to obtain the ciphertext E a , E b , and then transmitted to the traffic management departments of A and B;
[0040] The specific encryption process is as follows:
[0041] Set the access control tree structure of urban road data and the validity period of data file access;
[0042] When encrypting, the access strategy is applied and the Encrypt function is executed. The algorithm requires the vehicle to input the public key PK, the urban road data M to be encrypted, the access control tree structure Γ, and the time interval T. The urban road data M is encrypted by constructing the access tree structure Γ and the time interval T. When encrypting, the commercial business data M needs to be distinguished. business And general urban road data M general ;
[0043] First, a polynomial q is selected for each node x in the access tree structure Γ. X ; These polynomials are selected in a top-down manner, starting from the root node R, and for each node x in the visited tree structure, the polynomial q X The number of times d X Set to be greater than the threshold k of the node X Small 1, i.e. d X =k X -1; where d X Represents the polynomial q X The number of times;
[0044] Starting from the root node R, the algorithm randomly selects a And set q R (0) = s business , then randomly select q R Other d R nodes to fully define it; among them, s business express The random number related to the business data; q R represents the polynomial of the node R; d RIndicates the number of nodes;
[0045] It is also the left child node L of the root node general Generator polynomial q general , and set q general (0) = s general =q R (index(L general )); For any other node x, set q x (0) = q parent(x) (index(x)) and randomly select d X other nodes to fully define q X , where q parent(x) The polynomial representing the parent node of x;
[0046] Next, randomly select l business ,l general ∈G1, where l business Indicates the point on the elliptic curve G1 that is related to the business data, denoted as l business =(x business ,y business );l general Represents the point on the elliptic curve G1 related to the general data, denoted as l general =(x general ,y general ); G1 represents the set of points on the elliptic curve; as the symmetric key pair of AES, the urban road data M business ,M general Encrypted ciphertext:
[0047] C=(C1 business =AES.encrypt(l business ,M business ),
[0048] C1 general =AES.encrypt(l general ,M general ))
[0049] Let Y be the set of leaf nodes in the access tree structure Γ, and then construct the ciphertext CT together through the given access tree structure Γ and the decryption time interval number T. The ciphertext CT is expressed as follows:
[0050]
[0051] in, Indicates the part of the ciphertext related to business data; represents a binary operation between a generator g in a group and g itself (such as a multiplication operation in a group), μ is an integer exponent, sbusiness express Random numbers related to business data; C business Indicates that the business data of the ciphertext encrypted by the symmetric key needs to be subjected to power operation to achieve encryption of the attribute; The result of the operation of the generator g in the G0 group to the power of ν is then S business The result of the power operation; Indicates the part of the ciphertext related to the common data; C general The general data representing the ciphertext encrypted with the symmetric key needs to be exponentially operated to achieve the encryption of the attribute; The result of the operation of the generator g in the G0 group to the power of ν is then S general The result of the power operation; Y represents the set of leaf nodes in the access control tree; C y represents the ciphertext obtained after encrypting the leaf node y; C' y Represents the ciphertext obtained by encrypting the attributes of the leaf node y; It represents the result of hashing the attributes of the leaf node and the time interval T and then performing a power operation;
[0052] Vehicles that meet the access policy during a specific time period can decrypt and access corresponding different types of urban road data.
[0053] Preferably, the step S10 further includes:
[0054] The SM2 signature verification algorithm and the SM2 public key of the vehicle sending the data are used to verify the validity of the signature. At the same time, the Merkle Root hash value is verified to ensure that each data interaction in the transaction package is valid and has not been tampered with;
[0055] The specific decryption process is as follows:
[0056] When vehicle users of different models or traffic management departments receive the encrypted urban road data file, they can use their private key to try to decrypt the urban road data file by executing the Decrypt function; only when the vehicle attributes meet the corresponding access control tree structure within the time range T can the corresponding plaintext data be restored. The decryption algorithm includes two parameters, namely the ciphertext CT containing the access structure tree Γ and the private key SK of the vehicle user within the time interval T. T ;
[0057] If the attribute set of the vehicle user in the time interval T can satisfy the access tree structure Γ, then the algorithm will decrypt the ciphertext and return the urban road data M;
[0058] The decryption algorithm first defines a recursive function DecryptNode(CT,SKT ,x), one of the input parameters is the ciphertext Another parameter is the private key of the vehicle user It is in the time interval T and the valid attribute set S T Associated, the last parameter is the node x to access the tree structure;
[0059] If this node is a leaf node, then i=att(x) will be defined and the recursive function DecryptNode will be defined as follows: T , i represents a set of attributes; att(x) means that att(x) is defined only when x is a leaf node and represents an attribute associated with a leaf node x of the access control tree; S T represents a set of valid attributes on the time interval T; then
[0060]
[0061] Among them, CT represents the urban road data in ciphertext form; SK T Represents the private key of the vehicle user; D i,T Represents the key part related to the attribute and time interval; C X Represents the ciphertext part corresponding to the leaf node x; represents the result of hashing the attribute set and the corresponding time interval as input and then performing a power operation; if Then DecryptNode(CT,SK T ,x)=⊥;
[0062] Now consider the recursive case when x is a non-leaf node. The algorithm DecryptNode(CT,SK T ,x) is executed as follows: for all child nodes z of x, call DecryptNode(CT,SK T ,z) and store the output as F z ; Let S x is any k x The set of child nodes z of size, k x represents the threshold of the access control tree, so that F z ≠⊥; if no such set exists, the node is not satisfied and the function returns ⊥;
[0063] Otherwise, calculate and return the result;
[0064]
[0065] Among them, q Z (0) represents the multinomial expression of node z; q x(0) represents a multinomial expression for node x;
[0066] If the access tree structure satisfies S T ,set up
[0067] The algorithm now decrypts by computing:
[0068] Calculate common data:
[0069]
[0070] Among them, C1 general Represents general urban road data in ciphertext form after being encrypted with a symmetric key;
[0071] l general Represents a point on the elliptic curve G1, denoted by l general =(x general ,y general );
[0072] Calculate business data:
[0073]
[0074] Among them, C1 business Indicates the business urban road data in ciphertext form after being encrypted with a symmetric key; business Represents a point on the elliptic curve G1, denoted by l business =(x business ,y business ).
[0075] In a second aspect, a cross-chain system for urban Internet of Vehicles based on ciphertext revocable attribute encryption is provided, the system comprising:
[0076] Module M1: Executes the Setup function through the trusted hub center and uses the security parameter λ as input to generate the public parameter PK and master key MK required by the encryption system;
[0077] Module M2: When vehicles of different models travel in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data;
[0078] Module M3: After the vehicle is successfully registered, vehicle users of different models execute the Keygen function to generate the corresponding attribute private key based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center;
[0079] Module M4: Assume that when exchanging urban road data across regions, both parties of the same vehicle have agreed to start transaction management and send the SM2 public key to each other for cross-chain communication;
[0080] Module M5: Set the vehicles in urban area A to randomly select a secret string S and perform a hash operation on S. According to the negotiated content, the hash time lock contract C0 is called to interact with urban road data. At the same time, the corresponding access tree structure and the effective access time of the file are set to encrypt the transmitted urban road data information and upload it to the IPFS interstellar file system. After the hash time lock contract C0 is successfully deployed, it will be broadcast to the entire network;
[0081] Module M6: Set that vehicles in urban area B need to respond within timestamp0 after listening to the hash time lock contract C0 deployed by vehicles in urban area A regarding road data interaction. Otherwise, C0 will be automatically invalidated due to timeout.
[0082] Module M7: After monitoring the contract C1 deployed on the chain by the vehicle in city B, the vehicle in city A also uses the attribute private key Decrypt the encrypted data stored in the IPFS interplanetary file system and confirm the validity of urban road data information;
[0083] Module M8: After the entire process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit the transaction and complete the data exchange, thus completing the transaction of the first phase;
[0084] Module M9: The second phase of the transaction begins. Vehicles in different urban areas submit the packaged transaction package and the hash value of the transaction package to the traffic management department of their respective urban areas through the trusted relay chain of the urban area.
[0085] Module M10: After receiving the ciphertext sent by vehicles from City A and City B respectively, the traffic management departments of City A and City B use their own attribute private keys to decrypt the ciphertext to obtain the plaintext and the vehicle's signature, and verify the validity of the signature;
[0086] Module M11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information to complete the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
[0087] Compared with the prior art, the present invention has the following beneficial effects:
[0088] 1. The present invention solves the problem of multiple encryption of a file in traditional urban vehicle networks by adopting a ciphertext strategy attribute encryption algorithm. At the same time, it adapts to fine-grained access control by setting different access control tree structures for data and assigning validity periods to authorized vehicle attributes. In this way, only when the vehicle attributes meet the corresponding access tree structure in a specific time period can the corresponding data be decrypted. Under the premise of ensuring safe and efficient data transmission efficiency, the confidentiality of business data is guaranteed;
[0089] 2. The present invention combines the relay chain and hash locking technology to propose a data security cross-chain model for urban vehicle networks, which solves the problems of urban road data security and discretization of operation modes faced by urban vehicle networks, and solves the problem of difficulty in intercommunication of business data of different systems faced by urban vehicle networks.
[0090] Other beneficial effects of the present invention will be explained in the specific implementation manner through the introduction of specific technical features and technical solutions. Through the introduction of these technical features and technical solutions, those skilled in the art should be able to understand the beneficial technical effects brought about by the technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0092] Figure 1 This is the overall workflow of the present invention;
[0093] Figure 2 It is a schematic diagram of the overall structure of the present invention;
[0094] Figure 3 Encryption flow chart for the present invention;
[0095] Figure 4 Decryption flow chart for the present invention;
[0096] Figure 5 For attribute private key workflow. DETAILED DESCRIPTION
[0097] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0098] The embodiment of the present invention provides a cross-chain method for urban vehicle networking based on ciphertext revocable attribute encryption, referring to Figure 1 and Figure 2The specific contents are as follows:
[0099] Step S1: The trusted hub generates the public parameters PK and master key MK required by the encryption system by executing the Setup function and taking the security parameter λ as input. The algorithm selects a bilinear group G0 with a prime order p, whose generator is g, and selects two random exponents The public parameters and master key are expressed as:
[0100] PK=(G0,g,h=g ν ,e(g,g) μ )
[0101] MK=(ν,g μ )
[0102] Where h represents the result of the operation of the generator g in the G0 group to the power of ν; g ν represents the result of the operation of the generator g in the G0 group to the power of ν; g μ represents the result of the operation of the μ-th power of the generator g in the G0 group; e(g,g) μ represents a binary operation between the generator g in the group and g itself (such as the multiplication operation in the group), and μ is an integer exponent.
[0103] Step S2: When vehicles of various brands and models are driving in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data.
[0104] During the registration process, vehicles of various brands and models will provide their own attribute information (such as being near a building, speed below 43.5 miles per hour, whether it is integrated with public transportation and can provide real-time bus information, etc.), and can be associated with the identity of the vehicle owner. The trusted authority center verifies the attributes provided by the vehicle to determine whether the attributes are legal. If legal, it returns the permission flag flag = true, and if the attributes are illegal, it returns flag = false.
[0105] Step S3: Once the vehicle is successfully registered, vehicle users of various brands and models can execute the Keygen function to generate the corresponding attribute private key based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center. The attribute private key will be used to decrypt and access the protected urban road data.
[0106] The input parameters of the Keygen function include the master key MK and a set N about time, N contains the authorization attributes of the currently registered vehicle and all corresponding time interval numbers T within its validity period; the set N is expressed as follows:
[0107]
[0108] The key generation algorithm randomly selects Then, for each attribute j∈S of the vehicle and the traffic management department, a random selection Among them, r represents Random numbers on ; represents a set of p elements; j represents the attributes of each entity in the urban vehicle network; then calculate the key Veh SK for:
[0109]
[0110] Where D represents the operation result of the generator g in the G0 group, which is also the public partial key; η represents the time interval; Indicates the starting time of attribute j within the validity period; Indicates the expiration time of attribute j within the validity period; D j,η represents the partial key associated with attribute j of time interval η; It means taking attribute j and time interval η as input to calculate the corresponding hash value and multiplying it by r j times; D' j represents the partial key associated with attribute j; represents the r of the generator g in the G0 group j The result of raising the power.
[0111] Step S4: Assume that when exchanging urban road data across regions, both parties of the same vehicle have agreed to start transaction management and send the SM2 public key to each other for cross-chain communication.
[0112] Step S5: Refer to Figure 3 As shown, the vehicles in urban area A randomly select a secret string S and perform a hash operation on S to obtain Z = Hash (S). Subsequently, the vehicles in urban area A call the hash time lock contract C0 to interact with urban road data according to the negotiated content, and at the same time set the corresponding access tree structure and the effective access time of the file to encrypt the transmitted urban road data information and upload it to the IPFS interstellar file system. After the hash time lock contract C0 is successfully deployed, it will be broadcast to the entire network.
[0113] Step S6: Refer to Figure 4 As shown in the figure, after monitoring the hash time lock contract C0 deployed by the vehicles in city A regarding road data interaction, the vehicles in city B need to respond within the timestamp0, otherwise, C0 will be automatically invalidated due to timeout. In the process of responding, the vehicles in city B first use the attribute private key The encrypted content is decrypted to confirm the validity of the information. After confirmation, the hash time lock contract C1 is written according to the negotiated content, and the acquisition condition of the urban road data corresponding to the hash identifier Info1 on IPFS is set to provide the secret string S of Z for vehicles in urban area A; then the vehicles in urban area B also set the access tree structure and the effective access time of the file to encrypt the urban road data and upload it to the IPFS interstellar file system, and then deploy the cross-chain smart contract.
[0114] Step S7: Refer to Figure 5 As shown, the vehicle in city A also uses the attribute private key after monitoring the contract C1 deployed on the chain by the vehicle in city B Decrypt the encrypted data stored on the IPFS interplanetary file system and confirm the validity of the urban road data information. If there is a problem, roll back the transaction to invalidate the contract; if it meets the requirements, the vehicle in urban area A sends the secret string S to the contract C1 deployed on the chain by the vehicle in urban area B within the specified time to unlock the file hash identifier Info1 in C1; the vehicle in urban area B obtains the secret string S provided by the vehicle in urban area A through observation, and then sends S to C0 to unlock the file hash identifier Info0; the vehicle in urban area A needs to unlock the data within the timestamp1 timestamp, otherwise the entire data interaction process will be rolled back due to timeout.
[0115] Step S8: After the whole process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit transactions and complete data interaction, thus completing the first phase of transactions. After the first phase of transactions is completed, the proxy nodes selected by the vehicle chains in each urban area according to the RAFT consensus algorithm will submit all urban road data transactions Tx1, Tx2...Tx n The transaction package is packaged (including data obtained from other vehicles and roadside units in the city), and a hash value of the transaction package is generated, and finally the transaction package is signed using the SM2 signature algorithm.
[0116] The specific method is to arrange these multiple data interactions in chronological order, and calculate the hash value of each group of transactions in pairs, and then recursively calculate their hash values in the same way to finally generate a Merkle Root hash value, that is, SHA-256 (Tx 1n )=(((SHA-256(Tx1)||SHA-256(Tx2))||(SHA-256(Tx3)||SHA-256(Tx4)))...||SHA-256(Tx n )), and then enter the second stage of affairs;
[0117] Among them, Tx 1n Indicates transaction Tx1 to transaction Txn SHA stands for Secure Hash Algorithm.
[0118] Step S9: The second phase of the transaction begins. Vehicles in different urban areas send the packaged transaction packets to the trusted relay chain of their respective urban areas. And the hash value of the transaction package Submit them to their respective urban traffic management departments;
[0119] The vehicles in urban areas A and B use the proposed HR-CP-ABE algorithm to set the access strategy and effective access time of the transaction package. And the hash value of the transaction package and their respective signatures to obtain the ciphertext E a , E b , and then transmitted to the A and B traffic management departments.
[0120] The specific encryption process is as follows:
[0121] In addition to collecting corresponding road conditions and traffic flow data, vehicles of various brands and models will also regularly generate equipment information, which can be used as a basis for the corresponding vehicle brand to optimize the performance of its own brand models and is business data. For example, vehicle speed, acceleration, braking information, etc., this information can be used to evaluate the behavior and performance of vehicles of this brand model, and can be used as a reference for the optimization of the next generation of models. At the same time, there are many different entities in the Internet of Vehicles network, and the composition of each entity set is complex. In order to achieve confidentiality and effective access control of urban road data, data access rights must be distinguished not only by identity, but also by attributes.
[0122] Before the urban road data is transmitted, the access control tree structure of the urban road data and the validity period of the data file access are set first. For the two different data types of business data and general data, different access tree structures need to be assigned to them respectively.
[0123] When encrypting, the access strategy is applied and the Encrypt function is executed. The algorithm requires the vehicle to input the public key PK, the urban road data M to be encrypted, the access control tree structure Γ, and the time interval T. The urban road data M is encrypted by constructing the access tree structure Γ and the time interval T. When encrypting, the commercial business data M needs to be distinguished. business And general urban road data M general .
[0124] The algorithm first selects a polynomial q for each node x (including leaf nodes) in the access tree structure Γ X ; These polynomials are selected in a top-down manner, starting from the root node R, and for each node x in the visited tree structure, the polynomial qX The number of times d X Set to be greater than the threshold k of the node X Small 1, i.e. d X =k X -1; where d X Represents the polynomial q X The number of times.
[0125] Starting from the root node R, the algorithm randomly selects a And set q R (0) = s business , then randomly select q R Other d R nodes to fully define it; among them, s business express The random number related to the business data; q R represents the polynomial of the node R; d R Indicates the number of nodes.
[0126] It is also the left child node L of the root node general Generator polynomial q general , and set q general (0) = s general =q R (index(L general )); For any other node x, set q x (0) = q parent(x) (index(x)) and randomly select d X other nodes to fully define q X , where q parent(x) The polynomial representing the parent of x.
[0127] Next, randomly select l business ,l general ∈G1, where l business Indicates the point on the elliptic curve G1 that is related to the business data, denoted as l business =(x business ,y business );l general Represents the point on the elliptic curve G1 related to the general data, denoted as l general =(x general ,y general ); G1 represents the set of points on the elliptic curve; as the symmetric key pair of AES, the urban road data M business ,M general Encrypted ciphertext:
[0128] C=(C1 business =AES.encrypt(lbusiness ,M business ),
[0129] C1 general =AES.encrypt(l general ,M general ))
[0130] Let Y be the set of leaf nodes in the access tree structure Γ, and then construct the ciphertext CT together through the given access tree structure Γ and the decryption time interval number T. The ciphertext CT is expressed as follows:
[0131]
[0132] in, Indicates the part of the ciphertext related to business data; represents a binary operation between a generator g in a group and g itself (such as a multiplication operation in a group), μ is an integer exponent, s business express Random numbers related to business data; C business Indicates that the business data of the ciphertext encrypted by the symmetric key needs to be subjected to power operation to achieve encryption of the attribute; The result of the operation of the generator g in the G0 group to the power of ν is then S business The result of the power operation; Indicates the part of the ciphertext related to the common data; C general The general data representing the ciphertext encrypted with the symmetric key needs to be exponentially operated to achieve the encryption of the attribute; The result of the operation of the generator g in the G0 group to the power of ν is then S general The result of the power operation; Y represents the set of leaf nodes in the access control tree; C y represents the ciphertext obtained after encrypting the leaf node y; C' y Represents the ciphertext obtained by encrypting the attributes of the leaf node y; It represents the result of hashing the leaf node's attributes and the time interval T and then performing a power operation on them.
[0133] Only vehicles that meet the access policy during a specific time period can decrypt and access the corresponding different types of urban road data.
[0134] Step S10: After receiving the ciphertext sent by vehicles from City A and City B, the traffic management departments of City A and City B can use their own attribute private key Let the ciphertext E a , E b Decrypt to get the plaintext In order to prevent differences in road data information caused by attacks on vehicles in urban areas A and B, it is necessary to use the SM2 signature verification algorithm and the SM2 public key of the vehicle sending the data to verify the validity of the signature. At the same time, it is also necessary to verify the Merkle Root hash value to ensure that each data interaction in the transaction package is valid and has not been tampered with.
[0135] The specific decryption process is as follows:
[0136] When vehicle users of various brands and models or traffic management departments receive the encrypted urban road data file, they can use their private key to try to decrypt the urban road data file by executing the Decrypt function; only when the vehicle attributes meet the corresponding access control tree structure within the time range T can the corresponding plaintext data be restored. The decryption algorithm includes two parameters, namely the ciphertext CT containing the access structure tree Γ and the private key SK of the vehicle user within the time interval T. T .
[0137] If the attribute set of the vehicle user within the time interval T can satisfy the access tree structure Γ, then the algorithm will decrypt the ciphertext and return the urban road data M.
[0138] The decryption algorithm first defines a recursive function DecryptNode(CT,SK T ,x), one of the input parameters is the ciphertext Another parameter is the private key of the vehicle user It is in the time interval T and the valid attribute set S T Associated, the last parameter is the node x of the access tree structure.
[0139] If this node is a leaf node, then i=att(x) will be defined and the recursive function DecryptNode will be defined as follows: T , i represents a set of attributes; att(x) means that att(x) is defined only when x is a leaf node and represents an attribute associated with a leaf node x of the access control tree; S T represents a set of valid attributes on the time interval T; then
[0140]
[0141] Among them, CT represents the urban road data in ciphertext form; SK T Represents the private key of the vehicle user; D i,T Represents the key part related to the attribute and time interval; C X Represents the ciphertext part corresponding to the leaf node x; H(i,T) rirepresents the result of hashing the attribute set and the corresponding time interval as input and then performing a power operation; if Then DecryptNode(CT,SK T ,x)=⊥.
[0142] Now consider the recursive case when x is a non-leaf node. The algorithm DecryptNode(CT,SK T ,x) is executed as follows: for all child nodes z of x, call DecryptNode(CT,SK T ,z) and store the output as F z ; Let S x is any k x The set of child nodes z of size, k x represents the threshold of the access control tree, so that F z ≠⊥; if no such set exists, then the node is not satisfied and the function returns ⊥.
[0143] Otherwise, calculate and return the result.
[0144]
[0145] Among them, q Z (0) represents the multinomial expression of node z; q x (0) represents a polynomial expression for node x.
[0146] If the access tree structure satisfies S T ,set up
[0147] The algorithm now decrypts by computing:
[0148] Calculate common data:
[0149]
[0150] Among them, C1 general Represents general urban road data in ciphertext form after being encrypted with a symmetric key;
[0151] l general Represents a point on the elliptic curve G1, denoted by l general =(x general ,y general ).
[0152] Calculate business data:
[0153]
[0154] Among them, C1 businessIndicates the business urban road data in ciphertext form after being encrypted by a symmetric key;
[0155] l business Represents a point on the elliptic curve G1, denoted by l business =(x business ,y business ).
[0156] Step S11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information, thereby completing the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
[0157] In the cross-chain transaction management of data between vehicles of the same brand and model in different urban areas, the elected vehicle proxy node can always package the urban road data collected by other vehicles and roadside units in the same urban area in this period into a total data packet at a fixed period, and then transmit the data packet to the traffic management department of the corresponding urban area through a smart contract. After confirming the validity of the urban road data information on the blockchain, the traffic management department only needs to sign the total data packet, without the need to sign and confirm multiple data interactions one by one, which effectively improves the efficiency of the traffic management department in processing urban road data.
[0158] The present invention also provides a cross-chain system for urban vehicle networks based on ciphertext revocable attribute encryption, which can be implemented by executing the process steps of the cross-chain method for urban vehicle networks based on ciphertext revocable attribute encryption, that is, those skilled in the art can understand the cross-chain method for urban vehicle networks based on ciphertext revocable attribute encryption as a preferred implementation of the cross-chain system for urban vehicle networks based on ciphertext revocable attribute encryption. The system specifically includes the following contents:
[0159] Module M1: Executes the Setup function through the trusted hub center and uses the security parameter λ as input to generate the public parameter PK and master key MK required by the encryption system;
[0160] Module M2: When vehicles of different models travel in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data;
[0161] Module M3: After the vehicle is successfully registered, vehicle users of different models execute the Keygen function to generate the corresponding attribute private key based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center;
[0162] Module M4: Assume that when exchanging urban road data across regions, both parties of the same vehicle have agreed to start transaction management and send the SM2 public key to each other for cross-chain communication;
[0163] Module M5: Set the vehicle in urban area A to randomly select a secret string S, and perform a hash operation on S to obtain Z = Hash (S). According to the negotiated content, the hash time lock contract C0 is called to interact with urban road data. At the same time, the corresponding access tree structure and the effective access time of the file are set to encrypt the transmitted urban road data information and upload it to the IPFS interstellar file system. After the hash time lock contract C0 is successfully deployed, it will be broadcast to the entire network;
[0164] Module M6: Set that vehicles in urban area B need to respond within timestamp0 after listening to the hash time lock contract C0 deployed by vehicles in urban area A regarding road data interaction. Otherwise, C0 will be automatically invalidated due to timeout.
[0165] Module M7: After monitoring the contract C1 deployed on the chain by the vehicle in city B, the vehicle in city A also uses the attribute private key Decrypt the encrypted data stored in the IPFS interplanetary file system and confirm the validity of urban road data information;
[0166] Module M8: After the entire process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit the transaction and complete the data exchange, thus completing the transaction of the first phase;
[0167] Module M9: The second phase of the transaction begins. Vehicles in different urban areas submit the packaged transaction package and the hash value of the transaction package to the traffic management department of their respective urban areas through the trusted relay chain of the urban area.
[0168] Module M10: After receiving the ciphertext sent by vehicles from City A and City B respectively, the traffic management departments of City A and City B use their own attribute private keys to decrypt the ciphertext to obtain the plaintext and the vehicle's signature, and verify the validity of the signature;
[0169] Module M11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information to complete the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
[0170] The embodiments of the present invention provide a cross-chain method and system for urban Internet of Vehicles based on ciphertext revocable attribute encryption, which utilizes cross-chain technology and cryptographic methods to be applied in the scenario of urban Internet of Vehicles data interaction to solve the problems of urban road data security and discretization of operation modes faced by urban Internet of Vehicles.
[0171] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, the system and its various devices, modules, and units provided by the present invention can be completely realized in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps to realize the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0172] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A cross-chain method for urban vehicle networking based on ciphertext revocable attribute encryption, characterized in that: include: Step S1: Execute the Setup function through the trusted hub center and use the security parameter λ as input to generate the public parameter PK and master key MK required by the encryption system; Step S2: When vehicles of different models travel in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data; Step S3: After the vehicle is successfully registered, vehicle users of different models execute the Keygen function to generate corresponding attribute private keys based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center; Step S4: Assume that the two parties of the same vehicle have agreed to start transaction management when exchanging urban road data across regions, and send the SM2 public key to each other for cross-chain communication; Step S5: Set the vehicle in urban area A to randomly select a secret string S, and perform a hash operation on S to obtain Z = Hash (S). According to the negotiated content, the hash time lock contract C0 is called to interact with urban road data. At the same time, the corresponding access tree structure and the effective access time of the file are set to encrypt the transmitted urban road data information and upload it to the IPFS interplanetary file system. After the hash time lock contract C0 is successfully deployed, it is broadcast to the entire network; Step S6: Set that after vehicles in urban area B monitor the hash time lock contract C0 for road data interaction deployed by vehicles in urban area A, they need to respond within timestamp0, otherwise, C0 will be automatically invalidated due to timeout; Step S7: After monitoring the contract C1 deployed on the chain by the vehicle in city B, the vehicle in city A uses the attribute private key Decrypt the encrypted data stored in the IPFS interplanetary file system and confirm the validity of urban road data information; Step S8: After the entire process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit the transaction and complete the data exchange, thus completing the transaction of the first phase; Step S9: The second phase of the transaction begins. Vehicles in different urban areas submit the packaged transaction package and the hash value of the transaction package to the traffic management department of their respective urban areas through the trusted relay chain of the urban area to which they belong; Step S10: After receiving the ciphertext sent by the vehicles from City A and City B respectively, the traffic management departments of City A and City B use their own attribute private keys to decrypt the ciphertext to obtain the plaintext and the signature of the vehicle, and verify the validity of the signature; Step S11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information, thereby completing the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
2. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 1 is characterized in that: The step S1 comprises: Choose a bilinear group G0 of prime order p, whose generator is g, and choose two random exponents represents a set of p elements; public parameters and master keys are represented as: PK=(G0,g,h=g ν ,e(g,g) μ ) MK=(ν,g μ ) Where h represents the result of the operation of the generator g in the G0 group to the power of ν; g ν represents the result of the operation of the generator g in the G0 group to the power of ν; g μ represents the result of the operation of the μ-th power of the generator g in the G0 group; e(g,g) μ represents a binary operation between a generator g in the group and g itself, and μ is an integer exponent.
3. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 1 is characterized in that: The step S2 comprises: During the registration process, vehicles of different models will provide their own attribute information and associate it with the identity of the vehicle owner. The trusted authority center confirms the attributes provided by the vehicle to determine whether the attributes are legal. If they are legal, it returns the authority flag flag = true, otherwise it returns flag = false.
4. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 2 is characterized in that: In step S3, the input parameters of the Keygen function include the master key MK and a set N about time, where N includes the authorization attributes of the currently registered vehicle and all corresponding time interval numbers T within its validity period; the set N is expressed as follows: The key generation algorithm randomly selects Then, for each attribute j∈S of the vehicle and the traffic management department, a random selection Among them, r represents Random numbers on ; represents a set of p elements; j represents the attributes of each entity in the urban vehicle network; then calculate the key Veh SK for: Where D represents the operation result of the generator g in the G0 group, which is also the public partial key; η represents the time interval; Indicates the starting time of attribute j within the validity period; Indicates the expiration time of attribute j within the validity period; D j,η represents the partial key associated with attribute j of time interval η; It means taking attribute j and time interval η as input to calculate the corresponding hash value and multiplying it by r j times; D' j represents the partial key associated with attribute j; represents the r of the generator g in the G0 group j The result of raising the power.
5. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 1 is characterized in that: The step S6 includes: during the response process, the vehicle in urban area B first uses the attribute private key The encrypted content is decrypted to confirm the validity of the information. After confirmation, the hash time lock contract C1 is written according to the negotiated content, and the acquisition condition of the file hash identifier Info1 corresponding to the urban road data on IPFS is set to that the vehicles in urban area A provide the secret string S of Z; then the vehicles in urban area B also set the access tree structure and the effective access time of the file to encrypt the urban road data and upload it to the IPFS interstellar file system, and then deploy the cross-chain smart contract.
6. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 5 is characterized in that: Confirming the validity of the urban road data information in step S7 includes: If there is a problem, the transaction will be rolled back to invalidate the contract; if it meets the requirements, the vehicle in urban area A will send the secret string S to the contract C1 deployed on the chain by the vehicle in urban area B within the specified time to unlock the file hash identifier Info1 in C1; the vehicle in urban area B obtains the secret string S provided by the vehicle in urban area A through observation, and then sends S to C0 to unlock the file hash identifier Info0; the vehicle in urban area A needs to unlock the data within the timestamp1 timestamp, otherwise the entire data interaction process will be rolled back due to timeout.
7. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 4 is characterized in that: The step S8 comprises: After the first phase of transactions is completed, the proxy nodes selected by the vehicle chains in each urban area according to the RAFT consensus algorithm will trade all urban road data in this period, Tx1, Tx2, and Tx n Packing and generating a hash value of the transaction package, and finally signing the transaction package using the SM2 signature algorithm; Specifically, these multiple data interactions are arranged in chronological order, and the hash value of each group of transactions is calculated in pairs, and then their hash values are recursively calculated in the same way to finally generate a MerkleRoot hash value, that is, SHA-256 (Tx 1n )=(((SHA-256(Tx1)||SHA-256(Tx2))||(SHA-256(Tx3)||SHA-256(Tx4)))...||SHA-256(Tx n )), and then enter the second stage of affairs; Among them, Tx 1n Indicates Tx1 to Tx n SHA stands for Secure Hash Algorithm.
8. The urban vehicle network cross-chain method based on ciphertext revocable attribute encryption according to claim 7 is characterized in that: The step S9 comprises: The vehicles in urban areas A and B use the proposed HR-CP-ABE algorithm to set the access strategy and effective access time of the transaction package. And the hash value of the transaction package and their respective signatures to obtain the ciphertext E a , E b , and then transmitted to the traffic management departments of A and B; The specific encryption process is as follows: Set the access control tree structure of urban road data and the validity period of data file access; When encrypting, the access strategy is applied and the Encrypt function is executed. The algorithm requires the vehicle to input the public key PK, the urban road data M to be encrypted, the access control tree structure Γ, and the time interval T. The urban road data M is encrypted by constructing the access tree structure Γ and the time interval T. When encrypting, the commercial business data M needs to be distinguished. business And general urban road data M general ; First, a polynomial q is selected for each node x in the access tree structure Γ. X ; These polynomials are selected in a top-down manner, starting from the root node R, and for each node x in the visited tree structure, the polynomial q X The number of times d X Set to be greater than the threshold k of the node X Small 1, i.e. d X =k X -1; where d X Represents the polynomial q X The number of times; Starting from the root node R, the algorithm randomly selects a And set q R (0) = s business , then randomly select q R D R nodes are defined; among them, s business express The random number related to the business data; q R represents the polynomial of the node R; d R Indicates the number of nodes; It is also the left child node L of the root node general Generator polynomial q general , and set q general (0) = s general =q R (index(L general )); For any other node x, set q x (0) = q parent(x) (index(x)) and randomly select d X other nodes to fully define q X , where q parent(x) The polynomial representing the parent node of x; Next, randomly select l business ,l general ∈G1, where l business Indicates the point on the elliptic curve G1 that is related to the business data, denoted as l business =(x business ,y business );l general Represents the point on the elliptic curve G1 related to the general data, denoted as l general =(x general ,y general ); G1 represents the set of points on the elliptic curve; as the symmetric key pair of AES, the urban road data M business ,M general Encrypted ciphertext: C=(C1 business =AES.encrypt(l business ,M business ), C1 general =AES.encrypt(l general ,M general )) Let Y be the set of leaf nodes in the access tree structure Γ, and then construct the ciphertext CT together through the given access tree structure Γ and the decryption time interval number T. The ciphertext CT is expressed as follows: in, Indicates the part of the ciphertext related to business data; represents a binary operation between a generator g in a group and g itself, μ is an integer exponent, s business express Random numbers related to business data; C business Indicates that the ciphertext business data after symmetric key encryption needs to be subjected to power operation to achieve attribute encryption; sbusiness The result of the operation of the generator g in the G0 group to the power of ν is then S business The result of the power operation; Indicates the part of the ciphertext related to the common data; C general The general data representing the ciphertext encrypted with the symmetric key needs to be exponentially operated to achieve the encryption of the attribute; The result of the operation of the generator g in the G0 group to the power of ν is then S general The result of the power operation; Y represents the set of leaf nodes in the access control tree; C y represents the ciphertext obtained after encrypting the leaf node y; C' y Represents the ciphertext obtained by encrypting the attributes of the leaf node y; It represents the result of hashing the attributes of the leaf node and the time interval T and then performing a power operation; Vehicles that meet the access policy during a specific time period can decrypt and access corresponding different types of urban road data.
9. A cross-chain system for urban Internet of Vehicles based on ciphertext revocable attribute encryption, characterized in that: include: Module M1: Executes the Setup function through the trusted hub center and uses the security parameter λ as input to generate the public parameter PK and master key MK required by the encryption system; Module M2: When vehicles of different models travel in the corresponding urban area, they register with the trusted hub center of the urban area to obtain public parameters, generate corresponding attribute private keys, and participate in the transmission of urban road data; Module M3: After the vehicle is successfully registered, vehicle users of different models execute the Keygen function to generate the corresponding attribute private key based on the uploaded vehicle attributes and the public parameters provided by the trusted hub center; Module M4: Assume that when exchanging urban road data across regions, both parties of the same vehicle have agreed to start transaction management and send the SM2 public key to each other for cross-chain communication; Module M5: Set the vehicle in urban area A to randomly select a secret string S, and perform a hash operation on S to obtain Z = Hash (S). According to the negotiated content, the hash time lock contract C0 is called to interact with urban road data. At the same time, the corresponding access tree structure and the effective access time of the file are set to encrypt the transmitted urban road data information and upload it to the IPFS interstellar file system. After the hash time lock contract C0 is successfully deployed, it will be broadcast to the entire network; Module M6: Set that vehicles in urban area B need to respond within timestamp0 after listening to the hash time lock contract C0 deployed by vehicles in urban area A regarding road data interaction. Otherwise, C0 will be automatically invalidated due to timeout. Module M7: After monitoring the contract C1 deployed on the chain by the vehicle in city B, the vehicle in city A uses the attribute private key Decrypt the encrypted data stored in the IPFS interplanetary file system and confirm the validity of urban road data information; Module M8: After the entire process is confirmed to be correct, vehicles in urban areas A and B jointly choose to submit the transaction and complete the data exchange, thus completing the transaction of the first phase; Module M9: The second phase of the transaction begins. Vehicles in different urban areas submit the packaged transaction package and the hash value of the transaction package to the traffic management department of their respective urban areas through the trusted relay chain of the urban area. Module M10: After receiving the ciphertext sent by vehicles from City A and City B respectively, the traffic management departments of City A and City B use their own attribute private keys to decrypt the ciphertext to obtain the plaintext and the vehicle's signature, and verify the validity of the signature; Module M11: If the verification is successful, the traffic management departments of City A and City B will sign and confirm the packaged transaction respectively, and finally submit the second-phase transaction and update the on-chain information to complete the data transmission of the entire stage; if the verification is unsuccessful, the second-phase transaction will be rolled back and feedback will be provided.
