Vehicle-mounted terminal anti-dismounting method based on SM2 encryption

文档序号:409955 发布日期:2021-12-17 浏览:2次 中文

阅读说明:本技术 一种基于sm2加密的车载终端防拆方法 (Vehicle-mounted terminal anti-dismounting method based on SM2 encryption ) 是由 李大明 郑宇江 张国磊 于 2020-06-11 设计创作,主要内容包括:本发明提供一种基于SM2加密的车载终端防拆方法,包括以下步骤:步骤S1:对车载终端上定义一个合适的CAN报文ID和内容;步骤S2:对CAN报文内容通过加密芯片进行加密,获得加密后的报文内容;步骤S3:车载终端向ECU发送加密后的报文内容,ECU开始解密工作;步骤S4:若ECU解密出来的报文与定义的相符,ECU回应一个加密过的肯定报文发送给车载终端,车载终端通过该报文判定车载终端与ECU依旧相连;步骤S5:若车载终端在一定时间后没有收到肯定报文,则判断车载终端已与ECU断开连接,车载终端被拆。本发明通过SM2对CAN报文内容加密,最大程度的保障防拆报文的安全性,使得车载终端的防拆功能更加可靠。(The invention provides a vehicle-mounted terminal anti-dismantling method based on SM2 encryption, which comprises the following steps: step S1: defining a proper CAN message ID and content on the vehicle-mounted terminal; step S2: encrypting the CAN message content through an encryption chip to obtain the encrypted message content; step S3: the vehicle-mounted terminal sends the encrypted message content to the ECU, and the ECU starts decryption; step S4: if the message decrypted by the ECU is consistent with the definition, the ECU responds an encrypted positive message and sends the encrypted positive message to the vehicle-mounted terminal, and the vehicle-mounted terminal judges that the vehicle-mounted terminal is still connected with the ECU through the message; step S5: if the vehicle-mounted terminal does not receive the positive message after a certain time, the vehicle-mounted terminal is judged to be disconnected with the ECU, and the vehicle-mounted terminal is detached. According to the invention, the content of the CAN message is encrypted through the SM2, so that the security of the anti-dismantling message is ensured to the greatest extent, and the anti-dismantling function of the vehicle-mounted terminal is more reliable.)

1. A vehicle-mounted terminal anti-dismounting method based on SM2 encryption is characterized by comprising the following steps:

step S1: defining a proper CAN message ID and content on the vehicle-mounted terminal;

step S2: encrypting the CAN message content through an encryption chip to obtain the encrypted message content;

step S3: the vehicle-mounted terminal sends the encrypted message content to the ECU, and the ECU starts decryption;

step S4: if the message decrypted by the ECU is consistent with the definition, the ECU responds an encrypted positive message and sends the encrypted positive message to the vehicle-mounted terminal, and the vehicle-mounted terminal judges that the vehicle-mounted terminal is still connected with the ECU through the message;

step S5: if the vehicle-mounted terminal does not receive the positive message after a certain time, the vehicle-mounted terminal is judged to be disconnected with the ECU, and the vehicle-mounted terminal is detached.

2. The in-vehicle terminal tamper method based on SM2 encryption of claim 1, wherein: the CAN encryption in the step S2 adopts SM2 encryption.

Technical Field

The invention mainly relates to the field of automotive electronics, in particular to a vehicle-mounted terminal anti-dismounting method based on SM2 encryption.

Background

At present, in a method for preventing the vehicle-mounted terminal from being disassembled, some methods are used for detecting the disassembly through CAN message interaction between an ECU and the vehicle-mounted terminal, an ID CAN message is appointed between the vehicle-mounted terminal and the ECU, and whether the terminal is disassembled is judged through whether the message is interacted between the terminal and the ECU.

The main risk existing in the prior art is that the safety of the ID and the content of the CAN message is not guaranteed, once the CAN ID and the content appointed between the terminal and the ECU are intercepted by a person, other people CAN not know whether the terminal is detached or not in a message simulating mode.

The published Chinese invention patent, application number CN201510727747.1, patent name: a vehicle-mounted terminal anti-dismounting method is disclosed on the application date: the invention discloses 2015-11-02, relates to the technical field of anti-dismantling, and particularly relates to a vehicle-mounted terminal anti-dismantling method, which comprises the following steps: 1) a fixed password is agreed between the vehicle-mounted terminal and the vehicle ECU, 2) the vehicle ECU generates a random password R, the fixed password and the random password R of the vehicle ECU are combined, an MD5 encrypted value is generated, the MD5 encrypted value is a dynamic password A, the vehicle ECU sends a heartbeat interaction request to the vehicle-mounted terminal through a CAN bus, and the heartbeat interaction request frame comprises the random password R. 3) And after receiving the heartbeat interaction request of the vehicle ECU, the CAN transceiver of the vehicle-mounted terminal takes out the random password R, the vehicle-mounted terminal combines the fixed password and the random password R of the vehicle-mounted terminal to generate an MD5 encrypted value as a dynamic password B, and the dynamic password B is sent to the vehicle ECU through the CAN transceiver to be used as a heartbeat frame. 4) And after the vehicle ECU receives the heartbeat frame, comparing the dynamic password A with the dynamic password B, if the dynamic password A is consistent with the dynamic password B, the vehicle-mounted terminal is normal, otherwise, the vehicle-mounted terminal is considered to be detached.

Disclosure of Invention

The invention provides a vehicle-mounted terminal anti-dismounting method based on SM2 encryption, and provides a vehicle-mounted terminal anti-dismounting method based on SM2 encryption aiming at the defects in the prior art, which comprises the following steps:

step S1: defining a proper CAN message ID and content on the vehicle-mounted terminal;

step S2: encrypting the CAN message content through an encryption chip to obtain the encrypted message content;

step S3: the vehicle-mounted terminal sends the encrypted message content to the ECU, and the ECU starts decryption;

step S4: if the message decrypted by the ECU is consistent with the definition, the ECU responds an encrypted positive message and sends the encrypted positive message to the vehicle-mounted terminal, and the vehicle-mounted terminal judges that the vehicle-mounted terminal is still connected with the ECU through the message;

step S5: if the vehicle-mounted terminal does not receive the positive message after a certain time, the vehicle-mounted terminal is judged to be disconnected with the ECU, and the vehicle-mounted terminal is detached.

Preferably, the CAN encryption in step S2 is performed by SM2 encryption.

The invention has the beneficial effects that: the content of the CAN message is encrypted through the SM2, so that the safety of the anti-dismantling message is guaranteed to the greatest extent, and the anti-dismantling function of the vehicle-mounted terminal is more reliable.

Drawings

FIG. 1 is a flow chart of the present invention;

Detailed Description

As shown in fig. 1, the present invention includes the following steps:

step S1: defining a proper CAN message ID and content on the vehicle-mounted terminal;

step S2: encrypting the CAN message content through an encryption chip to obtain the encrypted message content;

step S3: the vehicle-mounted terminal sends the encrypted message content to the ECU, and the ECU starts decryption;

step S4: if the message decrypted by the ECU is consistent with the definition, the ECU responds an encrypted positive message and sends the encrypted positive message to the vehicle-mounted terminal, and the vehicle-mounted terminal judges that the vehicle-mounted terminal is still connected with the ECU through the message;

step S5: if the vehicle-mounted terminal does not receive the positive message after a certain time, the vehicle-mounted terminal is judged to be disconnected with the ECU, and the vehicle-mounted terminal is detached.

In this embodiment, the CAN encryption in step S2 is preferably performed by SM2 encryption.

In use, the content of the CAN message is encrypted through the SM2 algorithm, so that other people cannot acquire the correct message content even if the CAN message interaction between the terminal and the ECU is intercepted, and the vehicle-mounted terminal cannot be deceived by simulating the correct CAN message content.

The above-described embodiments are merely illustrative of the principles and utilities of the present patent application and are not intended to limit the present patent application. Modifications and variations can be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of this patent application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of this patent application.

5页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于云计算和SM2加密的发动机远程自动标定方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!