Disclosure of Invention
In view of the above, aiming at the defects of the existing tamper-resistant technology, the invention mainly solves the problem that different tamper-resistant methods can be intelligently selected according to different scenes in the uploading or downloading process of an update package in a vehicle-mounted system, and provides a self-adaptive tamper-resistant data structure and a self-adaptive tamper-resistant method for the update package in an internet of vehicles.
The technical scheme of the invention is as follows:
the invention provides an adaptive tamper-proof DATA structure of an update packet in a vehicle networking system, which comprises an ID field, a Ts field, a TAG field, an MD field and the content DATA of the update packet to be transmitted,
wherein the ID field occupies midA byte for storing a data ID value; ts field mTSA byte indicating an update packet upload timestamp; TAG field in mTAGA byte containing n TAG bits TAG1,TAG2,...,TAGnWherein TAG1Storing a current vehicle speed status, TAG2,...,TAGnRepresenting scenes related to an update package in the intelligent networked automobile; MD field mmdBytes storing an update package information digest for verifying the integrity cryptographic value.
Further, when n is 3, TAG2Type, TAG, for storing current update package3For storing update package subdivision categories.
Further, ID takes 4 bytes, Ts takes 4 bytes, TAG takes 1 byte, where: TAG1Occupies 2 bits; TAG2: occupying 2 bits and storing the type of the current update package; TAG3Occupying 4 bits and storing the subdivision types of the update packets; MD takes 36 bytes, the first 16 bytes are MD5 algorithm values, and the last 20 bytes are SHA _1 algorithm values.
Further, 01 denotes medium speed; 10 represents a low speed; and 11 denotes stationary.
Further, for TAG200 denotes an in-vehicle system update package; and 01, an in-vehicle system application update package.
Further, for TAG20000 represents a traffic safety type vehicle application; 0001 denotes traffic information consultation classVehicle-mounted applications; 0010 shows commercial vehicle applications such as information services.
A method of adaptive tamper-proofing of update packages in a car networking, using a data structure according to claims 1-6, and performing the steps of:
s1, the server selects the update package to be transmitted, assigns an ID, acquires the current time and assigns a value to Ts;
s2, obtaining the attribute of the current update package, according to the requirement of the TAG bit, the server end respectively gives TAG bits TAG2,...,TAGnAssigning;
s3, acquiring the current update package information, and generating an information abstract to assign a value to the MD;
s4, the vehicle-mounted terminal acquires the update package, judges the current running speed state of the vehicle and gives a TAG1Field assignment;
s5, giving a security level according to the reaction condition of the combined value of the n marking bits, selecting a proper integrity measurement scheme according to the security level, and if the update package passes the integrity measurement, updating the system; otherwise, refusing updating or directly deleting the updating package.
Further, the integrity measurement scheme includes three types: firstly, preferably based on an integrity measurement scheme of an MD5 algorithm, information summary is generated on information through the MD5 algorithm, and the method is suitable for the condition that the requirement on safety level is general;
secondly, preferably, based on a mixed integrity measurement scheme of an MD5 algorithm and an SHA _1 algorithm, an information digest is generated on information through an MD5, and a 160-bit information digest is generated on information through an SHA _1 algorithm, and the scheme is used for the situation that the requirement on the security level is high;
and thirdly, preferably, based on an integrity measurement scheme of MD5 and a third-party certification authority, after information is extracted through an MD5 algorithm, the information is certified by the third-party certification authority, and the method is suitable for the condition with very high requirement on the security level.
Further, the method for the server to select the update package to be transmitted includes:
uploading the update package to the Internet of vehicles application market, and waiting for a user to download and install the update; or the server is directly sent to the vehicle user end and is directly installed in a patch mode.
The invention has the beneficial effects that:
1. the invention can improve the safety index of the vehicle-mounted system, and once the tamper-proof system and the tamper-proof method are realized, the vehicle terminal can be effectively prevented from installing the maliciously-tampered installation package/upgrading package; 2. the invention provides a self-adaptive tamper-proof data structure of an update package in an internet of vehicles, which adds an ID field, a Ts field, a marking bit field and an MD field in the novel structural form, wherein the marking bit field can more flexibly select an integrity measurement scheme most suitable for the current environment in an internet of vehicles system; 3. according to the invention, by adopting the mode of intelligently selecting the tamper-proof method, the most appropriate solution can be selected in the current scene, the measurement redundancy can be effectively avoided, and the fineness of the integrity measurement is insufficient, so that the tamper is effectively prevented; 4. the invention initiates a multi-scene tamper-proof mechanism under the vehicle-mounted system, so that the system is more diversified, and the self-adaptive capacity of the whole vehicle-mounted system is improved.
Detailed Description
The following describes a data structure and a method for updating packet adaptive tamper-proofing in the car networking in a manner of combining with the drawings of the specification.
As shown in the update packet transmission flowchart in the car networking system of fig. 1, the car is continuously communicating with the external device during the driving process. The vehicle's system application update package and system update package will be sent from the vehicle application marketplace and vehicle server to the vehicle's on-board system during the communication process. If a hacker makes actions of autonomy exchange of the update package or injection of viruses and the like to endanger the safety of the vehicle by attacking the communication line, the update package received by the vehicle is unreliable. Therefore, a tamper-proof method needs to be selected in different scenarios to ensure that the update package received by the vehicle-mounted terminal of the vehicle is reliable.
The vehicle has different security levels when receiving the system update package and the system application update package in different states. If the current automobile has a lower safety level, but a high-strength anti-tampering method is selected at the moment, measurement redundancy is caused, and the work of integrity measurement becomes more complicated. When the automobile safety level is high, but a tamper-proof method with low strength is selected, the update package is in danger of being tampered.
The invention provides a self-adaptive tamper-proof data structure of an update package in an internet of vehicles, which is used for marking the safety level of an automobile receiving different update packages in different states so that a vehicle application market and a vehicle server can adopt a corresponding tamper-proof method according to the safety level when sending the system update package and the system application update package to a vehicle-mounted terminal, and the structure is shown in figure 2.
The flow chart of the method of the invention is shown in fig. 3, and the following steps are carried out on the basis of the data structure:
s1, the server selects the update package to be transmitted, assigns an ID, acquires the current time and assigns a value to Ts;
s2, obtaining the attributes of the current update package, and according to the requirement of the marker bit, respectively giving TAG2,...,TAGnAssigning;
s3, acquiring the content of the current update package, and generating an information abstract to assign a value to the MD field;
s4, the vehicle-mounted terminal acquires the update package, judges the current state of the vehicle and sends the TAG according to the state of the vehicle1Assigning;
s5, establishing a mapping table of the security level and the integrity measurement scheme according to the security level represented by the combined value of the n marker bits, selecting a proper integrity measurement scheme, and performing system updating if the update package passes the integrity measurement; otherwise, refusing updating or directly deleting the updating package.
When n is 3, as an implementable manner, the data structure includes:
ID: 4 bytes are occupied for storing the ID value of the data;
ts: the time stamp of the message, namely the uploading time of the current update package, is represented by 4 bytes;
TAG: occupying 1 byte and representing scenes related to an update package in the intelligent networked automobile; wherein:
TAG1: and occupying 2 bits and storing the current state of the vehicle. The preferred driving states are divided into the following 4 states: 00 denotes high speed; 01 represents medium speed; 10 represents a low speed; 11 denotes stationary;
TAG2: and occupying 2 bits and storing the type of the current update package. The types of application software in the preferred internet of vehicles are roughly divided into: 00 denotes an in-vehicle system update package; 01 represents an in-vehicle system application update package;
TAG3: and 4 bits, and storing the subdivision type of the update package. Preferably, for application software, the method is subdivided into the following steps: 0000 represents a traffic safety class vehicle application; 0001 denotes a traffic information consultation type vehicle-mounted application; 0010 represents commercial vehicle applications such as information services;
MD: the byte takes 36, the first 16 bytes are MD5 value, the last 20 bytes are SHA _1 value;
DATA: indicating the contents of the update package that needs to be transmitted.
If the data structure is utilized, the TAG can be identified1,TAG2,...,TAGnThe assignment of (c) is summarized in table 1 (preferably using binary stream representation):
TABLE 1
In the above table, it can be seen that, in the scenario related to the update package in the car networking system, the three flag bits are all assigned with the values of the security level according to different situations. The highest grade is 1, and the grades are sequentially decreased according to the safety requirement (such as 2, 3.). Higher security levels indicate that the choice of tamper-proof verification scheme for the update package is more stringent in the current scenario. The essence of tamper resistance is an integrity measure.
Thus, in a tamper resistant system, three schemes are provided: firstly, an integrity measurement scheme based on the MD5 algorithm is preferred, specifically, a 16-byte information digest is generated on information through the MD5 to prevent the information from being tampered, so that the method is suitable for a situation with low requirements on security level; secondly, it is preferable to use a mixed integrity measurement scheme based on MD5 and SHA _1, specifically, a 16-byte information digest is generated for information by MD5 and a 20-byte information digest is generated for information by SHA _1 at the same time, but it is almost impossible to find the hash value of MD5 and SHA _1 collision at the same time if necessary, so this scheme is used in the case of high security level requirement; and thirdly, preferably, based on an integrity measurement scheme of the MD5 and a third-party certification authority, specifically, after the MD5 generates the message digest for tamper resistance, the message digest is certified by the third-party certification authority as the "repudiation-resistant" behavior certification, and the method is suitable for the condition with a very high requirement on the safety level of the automobile.
At the same time, some specifications are made, such as when TAG is detected2Field bits all 00 or TAG detected3When the field bits are 0000, namely the highest security level is reflected, the integrity measurement scheme based on the MD5 and a third-party certification authority is directly selected. The following specific proposals for the selection of tamper-proof verification schemes at different security levels are summarized in table 2 (preferably using binary stream representation):
TABLE 2
TAG1-TAG2-TAG3 |
Tamper-proof verification scheme
|
00-01-0000
|
Selecting authentication mechanism based on MD5 and third partyIs used for measuring the integrity of the network
|
00-01-0001
|
Selecting a mixed integrity measurement scheme based on MD5 and SHA _1
|
00-01-0010
|
Selecting an integrity measurement scheme based on MD5
|
01-01-0000
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
01-01-0001
|
Selecting a mixed integrity measurement scheme based on MD5 and SHA _1
|
01-01-0010
|
Selecting an integrity measurement scheme based on MD5
|
10-01-0000
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
10-01-0001
|
Selecting a mixed integrity measurement scheme based on MD5 and SHA _1
|
10-01-0010
|
Selecting an integrity measurement scheme based on MD5
|
11-01-0000
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
11-01-0001
|
Mixed integrity measurement scheme based on MD5 and SHA _1 is selected
|
11-01-0010
|
Selecting an integrity measurement scheme based on MD5
|
00-00-null
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
01-00-null
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
10-00-null
|
Integrity measurement scheme based on MD5 and third-party certification authority
|
11-00-null
|
Integrity measurement scheme based on MD5 and third-party certification authority |
By adding three marking bits in front of the update package, the tamper-resistant system of the client can select a corresponding measurement scheme according to the table by only acquiring the values of the three marking bits, so that the system can conveniently select the integrity measurement scheme most suitable for the current scene. Wherein the MD5 algorithm represents the fifth version of the message digest algorithm; SHA _1 denotes a secure hash algorithm.
The method for selecting the update package needing to be transmitted by the server side comprises the following steps: uploading the update package to the Internet of vehicles application market, and waiting for a user to download and install the update; or the server is directly sent to the vehicle user end and is directly installed in a patch mode.
If the update package is downloaded in the application store, the update package is uploaded on the Internet of vehicles server sideThe server Side comprises Road-Side Units (RSU), Base Station (BS), and vehicle factory, and gives ID, Ts, and TAG of update package2,TAG3,...,TAGnAnd assigning values to fields such as MD (machine direction) and the like, and uploading the assigned update package to an application market to wait for downloading by a vehicle-mounted terminal. Obtaining the current vehicle state after downloading, and then giving TAG1And assigning, namely after all the tag bits are assigned, analyzing the value of each tag bit by the vehicle-mounted terminal, and judging the integrity measurement scheme most suitable for the current scene according to the priority of the value. If the current scene has general safety requirements, an MD5 scheme is selected for encryption, if the current scene has high safety requirements, the vehicle-mounted terminal correspondingly selects an MD5 and SHA _1 mixed integrity measurement scheme, if the current scene has high safety requirements, the MD5 integrity measurement needs to be selected, meanwhile, a Trusted Center (TC) is added for a third party authentication scheme, the vehicle-mounted terminal waits for calling a corresponding algorithm for integrity measurement, an application update package can be installed after the integrity measurement is passed, otherwise, the update package is rejected or the update package is directly deleted after the update package is tampered.
If the server is directly sent to the vehicle user side, the ID, Ts and TAG of the system update package are carried out at the vehicle networking server side2,TAG3,...,TAGnAnd after the fields such as MD and the like are assigned, the fields can be directly sent to the vehicle terminal, and the current vehicle state also needs to be acquired at the vehicle terminal to give the TAG1And (4) assigning values, selecting the most appropriate integrity measurement scheme by combining with the marker bits, and after the update package passes the integrity measurement, waiting for the vehicle to stop driving, and then updating the system. And if the system update package fails to pass the integrity measurement, rejecting the update or directly deleting the system update package. Fig. 4 is a timing chart illustrating a system upgrade performed by the server side directly sending the system update package to the vehicle-mounted terminal.
The above-mentioned embodiments, which further illustrate the objects, technical solutions and advantages of the present invention, should be understood that the above-mentioned embodiments are only preferred embodiments of the present invention, and should not be construed as limiting the present invention, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.