Internet of vehicles battery charging and discharging data transmission covert communication method based on block chain

Through the combination of the round sequence HV-TM method and the HMAC value and address transaction matrix, the problems of low embedding rate and large number of transactions in the charging and discharging data transmission of the Internet of Vehicles are solved, and efficient and safe hidden communication is achieved, ensuring that Privacy and integrity of battery data.

CN119030684APending Publication Date: 2024-11-26CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410988778.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing hidden communication method for charging and discharging data transmission of Internet of Vehicles battery has problems such as low embedding rate, large transaction number, insufficient detection resistance and tracking resistance on the blockchain platform, making it difficult to ensure the high security and privacy of battery data. .

Method used

The round-sequenced HV-TM method is used to combine the HMAC value and address transaction matrix. By building a transaction matrix on the blockchain and using the HV-TM algorithm to perform disorderly and continuous transmission of transactions, the embedding capacity and communication efficiency are improved, and the Double ordering rules extract ciphertext information.

Benefits of technology

It improves the practicality and embedding rate of hidden communication, reduces the number of transactions, enhances communication efficiency and concealment, and ensures the safe transmission of battery data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030684A_ABST
    Figure CN119030684A_ABST
Patent Text Reader

Abstract

The invention relates to an Internet of Vehicles battery charging and discharging data transmission covert communication method based on a block chain, and belongs to the field of Internet of Vehicles information transmission security. The method comprises the following steps: a vehicle end negotiates a random seed s, a contract address set and an external account address set with a data security center; acquiring battery data when the vehicle end is charged or discharged, and encrypting the battery data to form ciphertext information; the vehicle end continuously constructs block chain transactions according to an embedding algorithm, disorderly and continuously sends the transactions in the current transaction round through an HV-TM method, and after confirming that all transactions in the current transaction round are all linked, the vehicle end enters the next transaction round to repeatedly construct the transactions until all ciphertexts are sent; the data security center sorts transactions through a two-time sequencing rule, and then reversely extracts ciphertext information according to an embedding algorithm; and the data security center reversely operates the decrypted ciphertext to obtain charging and discharging data of the primary battery. According to the method, the practicability of covert communication is enhanced through round sequencing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of vehicle networking information transmission security, and relates to a vehicle networking battery charging and discharging data transmission covert communication method based on blockchain. Background Art

[0002] The Internet of Vehicles technology is developing rapidly, and data security is very important. Among them, a series of data generated by charging and discharging can be used to predict the remaining life of the battery through a model. Accurately predicting the remaining service life of lithium-ion batteries under different conditions of use can not only ensure the safe and reliable operation of the system, but also maximize the use of the remaining value of the battery. This is related to the confidentiality and integrity of private battery data of car companies. The data set needs to be extremely secure, not tampered with, and cannot be leaked. Otherwise, the battery data will be modified by malicious elements, so that bad batteries will be installed in the vehicle again, or incomplete data will affect the predicted battery life, and then make wrong battery scrapping strategies. In order to ensure the data security of battery charging, ensure the integrity of the data, prevent man-in-the-middle attacks, data corruption, etc., the academic community currently usually uses data encryption to prevent unauthorized parties from decoding communications. However, in many cases, the existence of communication or changes in communication modes are enough to arouse suspicion and reveal the occurrence of events. Encryption technology can only prevent messages from being tampered with or stolen, but cannot ensure that the existence of communication or changes in communication modes are not detected. To solve this problem, covert channels came into being. By hiding the communication, the ciphertext can be embedded in a carrier to covertly transmit secret information in an insecure network environment, thereby improving the security and privacy of communication. In order to conceal the relationship between the sender and the receiver, and the behavior of the communication, it is not desirable to be discovered by a third party, so covert communication is very important. An important point is that the battery charging and discharging privacy data of the car company itself needs to be extremely secure, not tampered with, and cannot be leaked. The car company needs to be able to ensure the security of data transmission and does not want it to be known by a third party, so it is very important to build a covert communication method for the transmission of battery charging data for the Internet of Vehicles.

[0003] In recent years, the construction of covert channels based on blockchain has been introduced to improve the security of the carrier and realize the anonymity of the sender.

[0004] In 2018, Partala first proposed a blockchain-based steganography method on page 18 of the journal "Cryptography". The paper is Provably secure covert communication on blockchain, in which a blockchain-based covert channel (BLOCCE) scheme is constructed. The scheme uses the least significant bit (LSB) of the sending address to embed secret messages. It is the first provably secure system to implement secret communication on the blockchain. However, the embedding rate of this scheme is too low to be applied in practice. In 2020, the paper Whispers on ethereum: Blockchain-based covert data embedding schemes proposed a data embedding method on the blockchain platform, which simply uses the output bit of the HMAC value to map to one bit of the secret data, then writes it to the amount VALUE field, uses the HMAC method to calculate the HMAC value, and then maps it to the bit to complete the information embedding. This scheme uses the public key to generate a linked address to embed information, so that the order of the secret data is guaranteed, but the embedding rate is low and it will cause address waste. In 2021, the paper A novel covert communication method based on bitcoin transaction proposed an embedding scheme that combines transaction matrix and VALUE field embedding information. As the number of addresses increases, the number of transactions will also increase significantly. In 2022, the paper Research on a covert communication model realized by using smart contracts in blockchain environment proposed the use of smart contracts to implement a covert communication model, but only voting contracts or bidding contracts can be used. This scheme uses parameters to map hidden information, but contracts cannot be reused. In 2023, the paper A derivative matrix-based covert communication method in blockchain combines the methods of generative addresses and address mapping matrices to construct a covert channel. It generates multiple addresses to form a matrix, and uses the LCG algorithm to generate random numbers to scramble the matrix. The embedding rate of this scheme is low.

[0005] Covert communication technology requires a carrier to embed secret information, but traditional covert channels lack good anti-detection, anti-tracking and robustness. In addition, for battery data security, traditional covert channel communication scenarios are limited and have prominent performance defects. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a covert communication method for battery charging and discharging data transmission in Internet of Vehicles based on blockchain.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A blockchain-based vehicle networking battery charging and discharging data transmission covert communication method, comprising the following steps:

[0009] S1. The vehicle and the data security center negotiate the random seed s, the contract address set, and the external account address set;

[0010] S2. Obtain battery data when the vehicle is charging or discharging, and encrypt the battery data to form ciphertext information;

[0011] S3. The vehicle side continuously constructs blockchain transactions according to the embedded algorithm, and sends transactions in the current transaction round in an unordered and continuous manner through the round sequencing HV-TM method. After confirming that all transactions in the current transaction round are on the chain, it enters the next transaction round and repeatedly constructs transactions until all ciphertexts are sent;

[0012] S4. The data security center monitors the transactions of the smart contract, filters out the transactions generated by the agreed address, sorts the transactions using two sequencing rules, and then extracts the ciphertext information based on the embedded algorithm;

[0013] S5. The data security center performs reverse operation to decrypt the ciphertext and obtain the original battery charge and discharge data.

[0014] Further, in step S1, the data security center agrees with the vehicle end on the private na external account addresses, the public nc contract account addresses and the random number seed s belonging to the current vehicle, wherein the process of negotiating the random seed s using the ECDHE method is:

[0015] 1) The data security center and the vehicle end each randomly generate a random number as a private key d, and multiply it with a base point G of the elliptic curve to obtain a public key Q, Q = d*G, where * is the elliptic curve point multiplication. The public and private keys of the vehicle end are Q1 and d1, and the public and private keys of the data center are Q2 and d2;

[0016] 2) Both parties exchange their public keys Q. The vehicle side calculates d1*Q2 to get a point (x1, y1). The security center calculates d2*Q1 to get a point (x2, y2). On the elliptic curve, the x coordinates of both parties are the same, so:

[0017] d1Q2=d1d2*G=d2d1*G=d2Q1

[0018] Then use the x of both parties as the random seed s;

[0019] The data security center uses the public key of the vehicle to encrypt and send na external account addresses and nc contract addresses to the current vehicle, and the vehicle uses the private key to decrypt the corresponding addresses;

[0020] After the vehicle end decrypts the corresponding contract address set, it divides the contract address set into set 1 and set 2 according to the HMAC value, where HMAC value = HMAC (Addr, Sx), HMAC() represents the method of calculating the HMAC value, Addr represents an address, and Sx represents the random number generated by the random seed.

[0021] Further, in step S2, the vehicle side obtains the battery charging and discharging data from the battery management system, encrypts it using the public key PKe of the security center, and then converts it into ciphertext Ce through the following steps, which include the following steps:

[0022] S21. Use the secret key generation algorithm to generate two random numbers S1 and S2 based on the random seed s:

[0023] S1,S2=gen(s)

[0024] Wherein, gen() represents the key generation method, which uses the Mersenne Twister algorithm to generate random numbers S1 and S2;

[0025] S22. Determine the delimiters start and end:

[0026] start=hash(S2)[128:]

[0027] end=hash(S2)[:128]

[0028] Wherein, hash(S2) indicates that the hash value of the random number S2 is calculated, the separator start takes the last 128 bits of the hash value of the random number S2, and the separator end takes the first 128 bits of the hash value of the random number S2;

[0029] S23. Encrypt the original text using the private key:

[0030] C=Enc(PKe,M)

[0031] Among them, Enc() is the encryption function, and PKe is the public key of the data security center;

[0032] S24, perform an XOR operation on the encrypted ciphertext C and the hash value of the random number S1, and then concatenate them with the separator to obtain the final secret information Ce:

[0033] Ce=start+C^hash(S1)+end

[0034] Among them, ^ represents the XOR operation, and hash(S1) represents the hash value of S1.

[0035] Further, in step S3, the following contents are specifically included:

[0036] The ciphertext information is continuously segmented, and the address transaction matrix is ​​constructed according to the segmented ciphertext information, and the segmented ciphertext information is used to construct the transaction TX according to the embedding algorithm, where the constructed transaction is expressed as:

[0037] TX=<sender,contract,receiver,amount,gas>

[0038] Among them, sender, receiver, and amount are data fields belonging to the transaction. Sender is the sender address, receiver is the receiver address, and amount is the token amount of the smart contract transaction; contract is the contract address and belongs to the receiver field of the transaction; gas is the gas fee required for the transaction and belongs to the gas field;

[0039] According to the HV-TM method, the smart contracts in one of the two subsets of the contract address set are called in turn to send the transaction out;

[0040] Repeatedly construct transactions and continue to send them out until all contracts in the subset are called and the current round ends, waiting for all transactions in the current round to be uploaded to the chain;

[0041] After all transactions in the current round are uploaded to the chain, the next round of transactions will be sent by calling a contract in another subset.

[0042] Furthermore, when constructing the address transaction matrix, the gas field, data field, and recipient field of the transaction are embedded into the address transaction matrix through the embedding algorithm. The specific process is as follows:

[0043] Put the first na*na bits of the ciphertext into the transaction matrix. If the number in row i and column j in the matrix is ​​bit '1', a transaction TX=<An[i],Ac[k],An[j],LB,gas> ; The rows and columns of the matrix are represented by i, j to represent the EOA address number, and k to represent the contract address number. When entering a round, k=0. After each transaction of a matrix is ​​called, k++;

[0044] LB is the decimal representation of the amount, corresponding to the binary bit information of the amount, and gas is the decimal gas fee, which can represent the embedded binary bit information LC:

[0045] gas=(estimateGas(TXtemp)×Y) / / lg×lg+LC;

[0046] TXtemp=<An[i],Ac[k],An[j],LB> ;

[0047] estimateGas is a function used by the blockchain platform to estimate the gas fee required for a transaction. Y is an increment used to amplify the estimated gas fee to ensure that the gas field is calculated, embedded, and sent to the chain. If the gas is too small and cannot be sent to the chain, it needs to be continuously multiplied by Y; lg represents an integer divisible number, set to 1000.

[0048] Furthermore, in the process of sequencing transactions through the address transaction matrix, address index 0 in the set and address index 1 in the set call the contract address to generate a transaction mapping bit 1, and no transaction is generated between addresses in other matrices, indicating mapping bit 0; assuming that the matrix length is n and the width is m, a matrix can embed nxm bits;

[0049] The receiver fills the transaction into the matrix to get the correct bit sequence;

[0050] During a round, all contracts in a set are called in sequence. A contract can be called multiple times by the index transaction in the address transaction matrix.

[0051] Furthermore, the order of contract calls in each contract address set is determined based on its HMAC value, and the process is as follows:

[0052] Each contract in the contract address set uses the HMAC(Ac, Sx) function to calculate its HMAC value, where the parameters are Ac, a contract address, and Sx, a random number. The HMAC values ​​are sorted, and the order of the contracts after sorting is the order in which they are called;

[0053] The receiver determines the final transaction order according to the contract address and transaction matrix. First, the address matrix is ​​used to determine the order of all transactions that call the same contract, and then the HMAC value is used to determine the order of different contracts.

[0054] Before entering the next round, the contract address set will be shuffled using random numbers.

[0055] Furthermore, in step 4, the security center continuously monitors the transaction events of the smart contract. After monitoring the completion of a round of transaction data, the bit data is taken out according to the secondary sequencing and embedding rules.

[0056] Among them, in the first sequencing process, after the security center monitors the contract transaction of one of the subsets of the smart contract set on the blockchain platform chain, the EOA address is assembled into a transaction matrix to complete a sequencing, that is, the address in the matrix that has a transaction is set to bit 1, and the address that has no transaction is set to bit 0; then the LB and LC information in the transaction are taken out to form a binary information that is fully embedded in the matrix;

[0057] The data extracted from the transaction includes the bit data and gas field in the transaction matrix, and the amount in the data field:

[0058] lc=(gas%lg)2, lb=(amount)2

[0059] lc and lb are in binary form, where amount is a decimal number representing the amount of tokens that can be embedded in the contract, which complies with the transaction rules of the token contract;

[0060] Specifically: extract the sender, reverder, amount, and gas data of the transaction, fill the bit '1' into the transaction matrix according to the address of the sender and reverder. A contract is only called by one transaction in the transaction matrix at a time. After the matrix is ​​filled, extract the bits '0' and '1', and extract the bit data in the amount and gas, and finally sort the bits;

[0061] In the second sequencing, the smart contract is sorted according to its HMAC value, that is, the embedded information in the matrix is ​​sorted; the contract address set is shuffled according to a random number, but the HMAC value is consistent, and thus the order of the contract addresses is also consistent, thereby arranging all the secret information in multiple contracts. A smart contract address is mapped to a transaction matrix. After the transactions within a round are sequenced, the mapped secret information is determined. After the order between rounds is determined, the complete secret information can be extracted.

[0062] Furthermore, in step 5, the security center splices out the complete secret information Ce, and performs the reverse operation to obtain the original charging data M, that is, removes the separators start and end, then XORs the hash (S1), and finally uses the private key SKe to decrypt and obtain M:

[0063] C=(Ce-start-end)^hash(S1)

[0064] M=Dec(SKe,C)

[0065] Where Dec is the decoding method, C is the ciphertext, start is the last 128 bits of hash(S2), and end is the first 128 bits of hash(S2).

[0066] The beneficial effects of the present invention are:

[0067] The round sequencing algorithm (HV-TM) proposed in the present invention combines the HMAC value with the address transaction matrix to reduce the number of transactions and transaction rounds, improve communication efficiency, expand the embedding capacity, and dynamically improve the average embedding rate of each transaction. The present invention enhances the practicality of covert communication through round sequencing.

[0068] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0070] Figure 1 is a flow chart of the overall method provided by an embodiment of the present invention;

[0071] Figure 2 A round sequencing diagram of the HV-TM method provided in an embodiment of the present invention;

[0072] Figure 3 This is an experimental diagram of the embedding capacity and round variation of the HV-TM method provided by an embodiment of the present invention;

[0073] Figure 4 The figure is an experimental diagram of the number of addresses and round changes of the HV-TM method provided in the embodiment of the present invention, wherein: Figure 4 a is a schematic diagram showing the number of rounds required to transmit information using different methods with a fixed contract address set; Figure 4 b is a schematic diagram showing the number of rounds required to transmit information using different methods with a fixed EOA address. DETAILED DESCRIPTION

[0074] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0075] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0076] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0077] See also Figure 1 to Figure 4 , which is a blockchain-based covert communication method for battery charging and discharging data transmission in Internet of Vehicles. It specifically includes:

[0078] Step S1, the vehicle side negotiates with the data security center on the random seed s, the contract address set, and the external account address (EOA) set.

[0079] Step S2, when the vehicle is charging or discharging, the battery related data is obtained, and then the encryption key is used to encrypt the data into ciphertext information.

[0080] In step S3, the vehicle side continuously constructs blockchain transactions according to the embedded algorithm, and then sends them out regularly through the HV-TM method. During the current round, transactions can be sent in an unordered and continuous manner. Before the next round starts, it is determined that all transactions in the previous round are on the chain, and then transactions are repeatedly constructed until all ciphertexts are sent out.

[0081] In step S4, the data security center monitors the transactions of the smart contract, filters out the transactions generated by the agreed address, sorts the transactions using two sequencing rules, and then extracts the ciphertext information based on the embedded algorithm.

[0082] Step S5, the data security center performs reverse operation to decrypt the ciphertext to obtain the original battery charge and discharge data.

[0083] Example

[0084] This embodiment provides a blockchain-based vehicle network battery charging and discharging data transmission covert communication method, which is used to improve the security of vehicle battery charging and discharging data information transmission and the communication efficiency of covert communication. The method is divided into five steps, namely key data negotiation, information encryption, transaction construction and transaction sending, hidden information extraction, and information decryption. Its completion process is as follows Figure 1 shown.

[0085] In this embodiment, step S1 mainly performs key data negotiation. The data security center agrees with the vehicle side on the private na external account addresses (EOA) belonging to the current vehicle, and the public nc contract account addresses and random number seeds s. Considering the negotiation efficiency and security, the ECDHE (Elliptic Curve Diffie–Hellman key Exchange) method is used to negotiate the random seed s and encrypt and send the account address. The data security center uses the public key of the vehicle side to encrypt and send na EOA addresses and nc contract addresses to the current vehicle, and the vehicle uses the private key to decrypt the address. The HMAC function is used to calculate the HMAC value to sort the EOA address array An and the contract address array Ac.

[0086] Specifically, the process of negotiating the random seed s using the ECDHE method is:

[0087] 1) The data security center and the vehicle end each randomly generate a random number as a private key d, and multiply it with a base point G of the elliptic curve to obtain a public key Q, Q = d*G, where * is the elliptic curve point multiplication. At this time, the public and private keys of the vehicle end are Q1 and d1, and the public and private keys of the data center are Q2 and d2;

[0088] 2) Both parties exchange their public keys Q. Finally, the vehicle calculates d1*Q2 to get a point (x1, y1), and the security center calculates d2*Q1 to get a point (x2, y2). Since the elliptic curve can satisfy the commutative and associative laws of multiplication, d1Q2=d1d2*G=d2d1*G=d2Q1. Therefore, the x coordinates of both parties are the same. Take x as the shared key, which is the random seed s.

[0089] The data security center encrypts and sends the EOA address set and the contract address set to the current vehicle end. After receiving it, the vehicle end divides the contract address set into two sets according to the HMAC value, namely set 1 and set 2. Among them, HMAC value = HMAC (Addr, Sx), HMAC () represents the method of calculating the HMAC value, Addr represents an address, and Sx represents the random number generated by the random seed.

[0090] This embodiment mainly performs information encryption in step S2. When the vehicle is charging or discharging, the original battery data M is obtained, and the random number generated by the seed s is used to encrypt it to obtain the ciphertext Ce. The charging data is concatenated using a string, and then converted into a binary bit stream using an encryption method. Specifically, battery charging and discharging data can usually be obtained from a battery management system (BMS). BMS is a system for monitoring and managing electric vehicle batteries, which can monitor the battery status, charging and discharging conditions, temperature and other information in real time. The vehicle end uses the public key PKe of the security center for encryption, and then it is converted into the ciphertext Ce through the following steps, which include the following steps:

[0091] S21. First, use the secret key generation algorithm (Gen) to generate two random numbers S1 and S2 according to the random seed s:

[0092] S1,S2=gen(s)

[0093] The Gen method uses the Mersenne twister algorithm to generate random numbers S1 and S2. This algorithm can quickly generate high-quality random numbers with a discrete uniform distribution between period intervals. If a 32-bit integer is generated, the period is up to 2 (19937) -1, where 219937 is a large Mersenne prime;

[0094] S22. Determine the delimiters start and end:

[0095] start=hash(S2)[128:]

[0096] end=hash(S2)[:128]

[0097] Wherein, hash(S2) indicates that the hash value of the random number S2 is calculated, the separator start takes the last 128 bits of the hash value of the random number S2, and the separator end takes the first 128 bits of the hash value of the random number S2;

[0098] S23. Encrypt the original text using the private key:

[0099] C=Enc(PKe,M)

[0100] Among them, Enc() is the encryption function, and PKe is the public key of the data security center;

[0101] S24, perform an XOR operation on the encrypted ciphertext C and the hash value of the random number S1, and then concatenate them with the separator to obtain the final secret information Ce:

[0102] Ce=start+C^hash(S1)+end

[0103] Among them, ^ represents XOR operation, and hash(S1) represents the hash value of S1. The ordinary ciphertext is XOR-encrypted again to prevent the leakage of the key SKe and ensure the diversity of the ciphertext.

[0104] In step S3, this embodiment mainly performs the operations of constructing transactions and sending transactions. The ciphertext information is continuously segmented into the ciphertext required by the transaction matrix, and the segmented ciphertext is used to construct the transaction TX according to the embedding algorithm. According to the HV-TM method, the smart contracts of set 1 are called in sequence to send the transaction out. Then the transaction is repeatedly constructed and sent out until all the contracts in set 1 are called, the current round ends, and all transactions are waited for to be on the chain. Before entering the next round, that is, before calling the contract of set 2, ensure that all transactions are on the chain. According to the HV-TM method, when the round is replaced, the EOA set and the contract address set will be shuffled by random numbers to improve concealment. Enter the next round, continue to repeatedly construct the contract to call the transaction TX, and then send it out.

[0105] TX=<sender,contract,receiver,amount,gas> , where sender, receiver, and amount are data fields belonging to the transaction, sender is the sender address, receiver is the receiver address, contract is the contract address, and belongs to the receiver field of the transaction, amount is the token amount of the smart contract transaction, and gas is the gas fee required for the transaction, which belongs to the gas field.

[0106] The address transaction matrix can realize the ordering of transactions. For example, assuming there is a 1x4 matrix T = [0 1 0 0], then the address index 0 in the set and the address index 1 in the set call the contract address to generate a transaction mapping bit 1, and no transaction is generated between the addresses in other matrices, indicating the mapping bit 0, then this matrix embeds 4 bits, which is 0100. Assuming the matrix length is n and the width is m, a matrix can embed nxm bits. The receiver fills the transaction into the matrix to get the correct bit sequence. The sent transaction is called an index transaction. During a round, all contracts in a set are called in turn, and a contract can be called multiple times by the index transaction in the transaction matrix.

[0107] HV-TM sequencing algorithm details Figure 2As shown, every 9 bits are arranged in order to form a matrix, and 27 bits are arranged in 3 matrices. If the bit in the matrix is ​​'1', it means that a transaction TX(2,1) will occur at the EOA address of this row and column. The transaction is a contract call transaction. The contract is C1. According to the random number and the hash value, the token contract or other contract in the contract set is called. The contract will execute the call, transfer money, and record it in the blockchain. In a round, the transaction order is sent out of order, and there is no need to determine whether to put it on the chain, so the communication efficiency is improved. After all transactions in the round are sent out, it is determined to be on the chain, and then enter the next round. If the number of rounds is 1, then the sending process from the beginning to the end does not need to determine whether to put it on the chain, which greatly improves the communication efficiency. You only need to wait for all transactions to be put on the chain. If a transaction fails to be put on the chain, wait for it to be resent.

[0108] Each contract in the contract address set uses the HMAC(Ac, Sx) function to calculate its HMAC value, where the parameters are Ac, a contract address and Sx, a random number. The HMAC values ​​are then sorted, and the order after sorting is the contract call order, so that both the sender and the receiver can use this rule to sort the contract call order.

[0109] Therefore, the receiver can determine the final transaction order according to the contract address and transaction matrix. First, the address matrix is ​​used to determine the order of all transactions that call the same contract, and then the HMAC value is used to determine the order of different contracts. In order to improve concealment, the address set is shuffled with random numbers before calling the next contract. Since both parties have the same random seed, they can generate the same random number from the beginning to the end of the HV-TM method.

[0110] The embedding algorithm uses the address transaction matrix and the gas field, data field, and recipient field to embed data, and tries its best to embed more data. Put the first na*na bits of the ciphertext information into the transaction matrix. If the number in row i and column j in the matrix is ​​bit '1', a transaction TX=<An[i],Ac[k],An[j],LB,gas> The rows and columns i and j of the matrix represent the EOA address serial number, and k represents the contract address serial number. When entering a round, k=0. After each transaction of a matrix is ​​called, k++, because a matrix is ​​mapped to a contract.

[0111] Among them, LB is the decimal representation of the amount, corresponding to the binary bit information of the amount, and gas is the decimal gasoline fee number, which can represent the embedded binary bit information LC.

[0112] gas=(estimateGas(TXtemp)×Y) / / lg×lg+LC;

[0113] TXtemp=<An[i],Ac[k],An[j],LB> ;

[0114] Set lg = 1000, so gas can embed 3 decimal digits. Because the gas field must conform to the generality of contract call transactions, changes in the last three digits will not affect the significance. estimateGas is a function for the blockchain platform to estimate the gas fee required for a transaction. Y is an increment that amplifies the estimated gas fee to ensure that the gas field is calculated, embedded, and sent to the chain; if the gas is too small and cannot be sent to the chain, it needs to be continuously multiplied by Y.

[0115] The vehicle side continuously builds blockchain platform transactions according to the embedding algorithm. The main embedded fields are the gas field and the data field. The gas field is a field for every transaction, and the amount parameter in the data field is a parameter that only contracts that require a certain amount, such as token contracts or transfer contracts, have. Then the hidden carrier of the embedded information is the address transaction matrix, and the bit information filled in the matrix is ​​also secret information.

[0116] 1. Let k = 0; i = 0, j = 0, take out a bit '1', skip it if it encounters a bit '0', and update i and j, LB, LC. k represents the serial number of the contract address set, and i and j represent the row and column in the matrix respectively.

[0117] 2. Construct transaction TXtemp =<sender,contract,receiver,amount>

[0118] amount=LB, contract=Ac[k], sender=An[i], receiver=An[j],

[0119] gas=(estimateGas(TXtemp)×Y) / / lg×lg+LC;

[0120] Y=1.25, lg is a decimal number that can be written to the gas field, lg=1000.

[0121] TX=<TXtemp,gas> ;

[0122] 3. Repeat steps 1-2 until a na*na matrix is ​​completely filled.

[0123] 4. Repeat steps 1-3 to continue building the transaction matrix and transactions and sending them out.

[0124] 5. Before entering the next round, make sure that all transactions sent in the previous round are on the chain, and then disrupt the EOA address set and the contract address set used in the previous round.

[0125] 6. Repeat steps 1-5 until all secret messages have been sent.

[0126] The number of index transactions of the matrix corresponding to the embedded sent contract is na*na*F, F∈[0,1], F is the proportion of '1' in a matrix, then the total number of transactions sent in one round is r, as shown below:

[0127]

[0128] The number of bits that can be embedded in one round is rb, as shown below:

[0129]

[0130] The specific algorithm is as follows:

[0131] Algorithm 1: HV-TM method to construct transactions and send transactions

[0132] Input: Data: encrypted ciphertext array Ce, EOA address array An and contract address array Ac sorted by HMAC value

[0133] 1)OneRnum←nc / 2; / / indicates that the contract set is divided into two sets, and the number of sets is the number of contracts in one round

[0134] 2)U←1,Ac1←Ac[:OneRnum],Ac2←Ac[OneRnum:]; / / Ac1 means taking an address from set 1, Ac2 means taking an address from set 2

[0135] 3)p←0; / / p represents a single bit subscript of the ciphertext

[0136] 4) while p <Ce.length{

[0137] for k to OneRnum{

[0138] for j to na*na{

[0139] p,LB,LC=slice(Ce,k); / / Cut out the required bit information

[0140] if C[p]==1then{

[0141] sender=An[j / na]; receiver=An[j%na]; contract←AcU[k]; amount←LB;

[0142] TXtemp=<sender,receiver,contract,amount> ;

[0143] gas←(estimateGas(TXtemp)×Y) / / lg×lg+LC;

[0144] TX←<TXtemp,gas> ;write(TX); / / Send transaction

[0145] p←k+lb+lc;

[0146] }

[0147] An = mixAddr (An);

[0148] }

[0149] check(); / / Check the chain

[0150] U←U==1?2:1; / / switch set

[0151] }

[0152] Furthermore, for reused addresses, the concealment of the channel will be reduced. In order to solve this problem, the present invention uses long-period random numbers to scramble the address order, making it extremely difficult for attackers to obtain the correct transaction order through traffic analysis. The present invention uses random numbers to scramble the order, thereby improving the concealment of reused addresses. The method of scrambling the address set is to input a random number and then rearrange it. The algorithm is that the address with subscript i will be exchanged with the address with subscript (i+Sx)%len. Where Sx←gen(s1), len is the length of the address set. The specific scrambling function is shown in Algorithm 2.

[0153] Algorithm 2: Random number scrambling algorithm mixAddr:

[0154] Input: Address set A

[0155] Output: shuffled address set A

[0156] 1for i to A.length{

[0157] 2temp←A[i];

[0158] 3S←gen(s);

[0159] 4A[i]←A[(i+S)%len];

[0160] 5A[(i+S)%len]←temp;

[0161] }

[0162] In step S4, the present embodiment mainly extracts hidden information. After the security center continuously monitors the transaction events of the smart contract, it extracts the bit data according to the secondary sequencing and embedding rules.

[0163] After the security center monitors the contract transactions in the smart contract set 1 on the blockchain platform, it will assemble the EOA addresses into a transaction matrix to complete a sequencing, thereby extracting the information embedded in the matrix, that is, the addresses in the matrix that have undergone transactions are set to bit 1, and those that have not undergone transactions are set to bit 0. Then the LB and LC information in the transaction are taken out to form a binary information completely embedded in the matrix. The second is to sort according to the HMAC value of the smart contract to complete the second sequencing, that is, to sort the embedded information in the matrix. When the smart contract call transaction of the contract address set 2 is monitored, it means that the previous round has ended and entered the next round, and all transactions in the previous round are all on the chain, and then the contract address set 1 and the EOA address set will be scrambled using random numbers.

[0164] The data extracted from the transaction includes the bit data and gas field in the transaction matrix, and the amount in the data field:

[0165] lc=(gas%lg)2, lb=(amount)2

[0166] lc and lb are in binary form. Amount is a decimal number that represents the amount of contract tokens that can be embedded, which complies with the trading rules of token contracts. In all BNB token transfer transactions in the past six months, the amount value in the interval [0,0.6] accounts for 96.8% and [0,0.6] accounts for 84.8%. Therefore, this embodiment adjusts the amount value of transactions that transmit secret information to [0,0.6] to ensure that the transaction amount will not cause detection.

[0167] Through two sequential sorting transactions, the ciphertext information is extracted. According to the H=HMAC(Ac, Sx) value and the address transaction matrix, Sx is the random number generated by the agreed random seed. The H value is divided into two domains V1andV2, Ensure that the data security center can distinguish the order between rounds. Because the two contract address sets have no intersection, a single set is a contract for one round. The round replacement rule is to alternate between V1 and V2. When the round is replaced, the sender will ensure that all transactions of the previous round are on the chain. When the receiver receives transactions from contract addresses of different sets, it means that it has entered the next round.

[0168] The key is to extract the sender, reverder, amount, and gas data of the transaction in the first sequencing, and fill the bit '1' into the transaction matrix according to the address of the sender and reverder. For example, if the address set is arranged as u={AB C}, a 3X3 address transaction matrix is ​​formed. If address A and address B generate a transaction, then A->B maps the bit '1' of position {0, 1} in the matrix, and the transaction generated by C->A maps the bit '1' of position {2, 0}. Other positions where no transaction occurs are filled with 0, so the transmitted bit sequence is [010 000 100]. A contract is only called by one transaction in the transaction matrix at a time, so after filling the matrix, extract the bits '0' and '1', and extract the bit data in the amount and gas, and finally sort the bits. In the second sequencing, the HMAC value of the smart contract is used for sorting. Although the contract address set is shuffled according to the random number, the random seed of the recipient is to extract the consensus s, so the generated random number is also consistent, the HMAC value is consistent, and then the order of the contract address is also consistent, so all the secret information in multiple contracts can be arranged. Because a smart contract address is mapped to a transaction matrix. After the transactions within a round are sequenced, the mapped secret information is determined. After the order between rounds is determined, the complete secret information is extracted. The order between rounds is the regular switching between set 1 and set 2.

[0169] In step S5, the security center splices the complete secret information Ce, performs the reverse operation to obtain the original charging data M, that is, removes the separators start and end, then XORs the hash (S1), and finally uses the private key SKe to decrypt and obtain M.

[0170] C=(Ce-start-end)^hash(S1)

[0171] M=Dec(SKe,C)

[0172] Where Dec is the decoding method, C is the ciphertext, start is the last 128 bits of hash(S2), and end is the first 128 bits of hash(S2).

[0173] Finally, this embodiment also verifies the characteristics of the HV-TM method through experimental comparison.

[0174] like Figure 3 , the x-axis represents the embedding capacity, and the y-axis represents the number of rounds required for the method to transmit information. Figure 3It can be clearly seen that when the number of embedded bytes increases, the number of rounds required will also increase, and the more contract addresses or EOA addresses there are, the fewer rounds there are. The results of the bottom 8 contract addresses and 16 EOA addresses show that when transmitting 4000 bytes, the number of rounds required is still 1, so it is believed that there is no need to switch rounds at all, and only needs to send all in the current round, which has high communication efficiency. In particular, when the EOA address increases and doubles, the number of rounds reduced is more than when the contract address doubles.

[0175] like Figure 4 a, Figure 4 As shown in b, the transmission information used in the experiment are vehicle battery data, mp3 files, jpg picture files, and exe executable files. Figure 4 a, Figure 4 Experiment b compares the effect of the number of addresses on the number of rounds. Figure 4 The x-axis of a represents the number of EOA address sets increasing in sequence when there are 4 fixed address sets for the contracts, and the y-axis represents the number of rounds required for the method to transmit information. Figure 4 b is the x-axis with 4 EOA fixed addresses, the number of contract address sets increases successively, and the y-axis indicates the number of rounds required for the method to transmit information. Figure 4 In a, as the number of EOA addresses increases, the number of rounds quickly drops to 1 round. Different transmission information corresponds to different numbers of rounds. This is because the number of bits 0 and 1 in binary bits is different. If the number of bits 0 is the majority, the number of transactions that need to be sent will decrease, and the number of rounds will also decrease accordingly. Figure 4 In b, the number of contract addresses increases and the number of rounds decreases slowly, which is slightly less effective than the increase in EOA addresses. From the perspective of concealment, both types of addresses need to increase in large quantities to improve concealment, so the number of rounds will decrease rapidly.

[0176] The number of transactions and rounds required to send the first 7000 bytes of 4 types of information is shown in Table 1 below:

[0177] Table 1

[0178]

[0179] The numbers represent unit transactions, and R represents the number of rounds. Compared with the methods in other literatures, the HV-TM method requires fewer transmission transactions, and the number of rounds is always kept at 1, that is, there is no need to switch rounds, and all can be sent out in 1 round. Of course, if the number of bytes transmitted increases, the number of transactions and the number of rounds will also increase, but compared with literature 1 and 2, the efficiency is greatly improved. Among them, literature 1 is the 2018 paper Provably secure covert communication on blockchain, and literature 2 is the 2021 paper A novel covert communication method based on bitcoin transaction. Literature 1 is the first to propose a covert transmission scheme based on blockchain, which is characterized by the fact that only one bit can be embedded in a transaction. However, the embedding rate of this scheme is too low to be applied in practice. Literature 2 is the first to propose an embedding scheme that combines the use of transaction matrix and VALUE field embedding information. As the number of addresses increases, the number of transactions in this scheme will also increase significantly. In addition, the number of rounds is extremely large, and the communication efficiency is low. The hash-based MEB scheme is also a special embedding method. It uses the HMAC algorithm for the first time. It simply uses the output bit of the HMAC value to map to one bit of the secret data, and then writes it into the amount VALUE field. In other words, the HMAC algorithm is used to achieve embedding. Compared with other methods, this method embeds more information in a single transaction and uses very few rounds, which greatly improves communication efficiency.

[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A covert communication method for battery charging and discharging data transmission in Internet of Vehicles based on blockchain, Features: It includes the following steps: S1. The vehicle and the data security center negotiate the random seed s, the contract address set, and the external account address set; S2. Obtain battery data when the vehicle is charging or discharging, and encrypt the battery data to form ciphertext information; S3. The vehicle side continuously constructs blockchain transactions according to the embedded algorithm, and sends transactions in the current transaction round in an unordered and continuous manner through the HV-TM method. After confirming that all transactions in the current transaction round are on the chain, it enters the next transaction round and repeatedly constructs transactions until all ciphertexts are sent; S4. The data security center monitors the transactions of the smart contract, filters out the transactions generated by the agreed address, sorts the transactions using two sequencing rules, and then extracts the ciphertext information based on the embedded algorithm; S5. The data security center performs reverse operation to decrypt the ciphertext and obtain the original battery charge and discharge data.

2. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 1, Features: In step S1, the data security center agrees with the vehicle end on the private na external account addresses, the public nc contract account addresses and the random number seed s belonging to the current vehicle. The process of negotiating the random seed s using the ECDHE method is as follows: 1) The data security center and the vehicle end each randomly generate a random number as a private key d, and multiply it with a base point G of the elliptic curve to obtain a public key Q, Q = d*G, where * is the elliptic curve point multiplication. The public and private keys of the vehicle end are Q1 and d1, and the public and private keys of the data center are Q2 and d2; 2) Both parties exchange their public keys Q. The vehicle side calculates d1*Q2 to get a point (x1, y1). The security center calculates d2*Q1 to get a point (x2, y2). On the elliptic curve, the x coordinates of both parties are the same, so: d1Q2=d1d2*G=d2d1*G=d2Q1 Then use the x of both parties as the random seed s; The data security center uses the public key of the vehicle to encrypt and send na external account addresses and nc contract addresses to the current vehicle, and the vehicle uses the private key to decrypt the corresponding addresses; After the vehicle end decrypts the corresponding contract address set, it divides the contract address set into set 1 and set 2 according to the HMAC value, where HMAC value = HMAC (Addr, Sx), HMAC() represents the method of calculating the HMAC value, Addr represents an address, and Sx represents the random number generated by the random seed.

3. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 1, Features: In step S2, the vehicle obtains the battery charging and discharging data from the battery management system, encrypts it using the public key PKe of the security center, and then converts it into ciphertext Ce through the following steps, which include the following steps: S21. Use the secret key generation algorithm to generate two random numbers S1 and S2 based on the random seed s: S1,S2=gen(s) Wherein, gen() represents the key generation method, which uses the Mersenne Twister algorithm to generate random numbers S1 and S2; S22. Determine the delimiters start and end: start=hash(S2)[128:] end=hash(S2)[:128] Wherein, hash(S2) indicates that the hash value of the random number S2 is calculated, the separator start takes the last 128 bits of the hash value of the random number S2, and the separator end takes the first 128 bits of the hash value of the random number S2; S23. Encrypt the original text using the private key: C=Enc(PKe,M) Among them, Enc() is the encryption function, and PKe is the public key of the data security center; S24, perform an XOR operation on the encrypted ciphertext C and the hash value of the random number S1, and then concatenate them with the separator to obtain the final secret information Ce: Ce=start+C^hash(S1)+end Among them, ^ represents the XOR operation, and hash(S1) represents the hash value of S1.

4. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 1, Features: In step S3, the following contents are specifically included: The ciphertext information is continuously segmented, and the address transaction matrix is ​​constructed according to the segmented ciphertext information, and the segmented ciphertext information is used to construct the transaction TX according to the embedding algorithm, where the constructed transaction is expressed as: TX=<sender,contract,receiver,amount,gas> Among them, sender, receiver, and amount are data fields belonging to the transaction. Sender is the sender address, receiver is the receiver address, and amount is the token amount of the smart contract transaction; contract is the contract address and belongs to the receiver field of the transaction; gas is the gas fee required for the transaction and belongs to the gas field; According to the HV-TM method, the smart contracts in one of the two subsets of the contract address set are called in turn to send the transaction out; Repeatedly construct transactions and continue to send them out until all contracts in the subset are called and the current round ends, waiting for all transactions in the current round to be uploaded to the chain; After all transactions in the current round are uploaded to the chain, the next round of transactions will be sent by calling a contract in another subset.

5. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 4, Features: When constructing the address transaction matrix, the gas field, data field, and recipient field of the transaction are embedded into the secret data through the embedding algorithm. The specific process of constructing the address transaction matrix is ​​as follows: Put the first na*na bits of the ciphertext into the transaction matrix. If the number in row i and column j in the matrix is ​​bit '1', a transaction TX=<An[i],Ac[k],An[j],LB,gas> ; The rows and columns of the matrix are represented by i, j to represent the EOA address number, and k to represent the contract address number. When entering a round, k=0. After each transaction of a matrix is ​​called, k++; LB is the decimal representation of the amount, corresponding to the binary bit information of the amount, and gas is the decimal gas fee, which can represent the embedded binary bit information LC: gas=(estimateGas(TXtemp)×Y) / / lg×lg+LC; TXtemp=<An[i],Ac[k],An[j],LB> ; estimateGas is a function used by the blockchain platform to estimate the gas fee required for a transaction. Y is an increment used to amplify the estimated gas fee to ensure that the gas field is calculated, embedded, and sent to the chain. If the gas is too small and cannot be sent to the chain, it needs to be continuously multiplied by Y; lg represents an integer divisible number.

6. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 5, Features: In the process of sequencing transactions through the address transaction matrix, address index 0 in the set and address index 1 in the set call the contract address to generate a transaction mapping bit 1, and no transaction is generated between addresses in other matrices, indicating mapping bit 0; let the matrix length be n and the width be m, a matrix can embed nxm bits; The receiver fills the transaction into the matrix to get the correct bit sequence; During a round, all contracts in a set are called in sequence. A contract can be called multiple times by the index transaction in the address transaction matrix.

7. According to claim 6, the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method, Features: The order of contract calls in each contract address set is determined based on its HMAC value. The process is as follows: Each contract in the contract address set uses the HMAC(Ac, Sx) function to calculate its HMAC value, where the parameters are Ac, a contract address, and Sx, a random number. The HMAC values ​​are sorted, and the order of the contracts after sorting is the order in which they are called; The receiver determines the final transaction order according to the contract address and transaction matrix. First, the address matrix is ​​used to determine the order of all transactions that call the same contract, and then the HMAC value is used to determine the order of different contracts. Before entering the next round, the contract address set will be shuffled using random numbers.

8. According to the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method of claim 1, Features: In step 4, the security center continuously monitors the transaction events of the smart contract. After monitoring the completion of a round of transaction data, the bit data is taken out according to the secondary sequencing and embedding rules. Among them, in the first sequencing process, after the security center monitors the contract transaction of one of the subsets of the smart contract set on the blockchain platform chain, the EOA address is assembled into a transaction matrix to complete a sequencing, that is, the address in the matrix that has a transaction is set to bit 1, and the address that has no transaction is set to bit 0; then the LB and LC information in the transaction are taken out to form a binary information that is fully embedded in the matrix; The data extracted from the transaction includes the bit data and gas field in the transaction matrix, and the amount in the data field: lc=(gas%lg) 2 ,lb=(amount) 2 lc and lb are in binary form, where amount is a decimal number representing the amount of tokens that can be embedded in the contract, which complies with the transaction rules of the token contract; Specifically: extract the sender, reverder, amount, and gas data of the transaction, fill the bit '1' into the transaction matrix according to the address of the sender and reverder. A contract is only called by one transaction in the transaction matrix at a time. After the matrix is ​​filled, extract the bits '0' and '1', and extract the bit data in the amount and gas, and finally sort the bits; In the second sequencing, the smart contract is sorted according to its HMAC value, that is, the embedded information in the matrix is ​​sorted; the contract address set is shuffled according to a random number, but the HMAC value is consistent, and thus the order of the contract addresses is also consistent, thereby arranging all the secret information in multiple contracts. A smart contract address is mapped to a transaction matrix. After the transactions within a round are sequenced, the mapped secret information is determined. After the order between rounds is determined, the complete secret information can be extracted.

9. According to claim 1, the blockchain-based vehicle networking battery charging and discharging data transmission covert communication method, Features: In step 5, the security center splices out the complete secret information Ce, and performs the reverse operation to obtain the original charging data M, that is, remove the separators start and end, then XOR hash (S1), and finally use the private key SKe to decrypt and obtain M: C=(Ce-start-end)^hash(S1) M=Dec(SKe,C) Where Dec is the decoding method, C is the ciphertext, start is the last 128 bits of hash(S2), and end is the first 128 bits of hash(S2).