Chip JTAG debugging port protection method and system, storage medium and electronic equipment
By dynamically burning the key to protect the chip JTAG debug port, the network security risks and the inability to re-enable the JTAG debug port in the existing technology are solved, and higher security and flexibility are achieved.
Patent Information
- Application Number
- CN202510001655.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-02
AI Technical Summary
The prior art has limitations in protecting the chip JTAG debug port, and the inability to re-enable the JTAG debug port for further debugging and analysis.
The JTAG debug port is protected by dynamic burn keys, a one-to-one key is generated using product feature numbers, and the JTAG protection mode is configured through software code, and the file dynamic burn key is burned into the MCU, and the JTAG debug port is disabled, but the communication interface is reserved for subsequent local decryption activation.
It realizes the unique key protection of each product, prevents remote access to the JTAG debug port, improves security, and retains the flexibility to reactivate the JTAG debug port under necessary conditions.
Smart Images

Figure CN119760798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip security protection, and in particular to a chip JTAG debugging port protection method. Background Art
[0002] With the continuous evolution of communication technology, users can now use computers to achieve seamless data interaction with various vehicle systems and remote servers. Automotive network security faces many security threats. In order to ensure that the data content in vehicle communications is not illegally obtained or leaked, there is an urgent need for an analysis of potential weak links and corresponding prevention and control measures or design methods. A widely used approach is to apply key encryption technology. At every stage of data flow, even if attackers manage to intercept all communication data, as long as they fail to obtain the corresponding decryption key, these data (i.e. ciphertext) will still be indecipherable to them.
[0003] In an existing technical solution, the JTAG access process is better protected by coordinating the encryption module and algorithm of the cloud server with the three protection modes of JTAG pass-through, password protection, and permanent shutdown. This technical solution is mainly based on a series of complex encryption protection operations on the key in the cloud and interacting with local devices to achieve protection of the JTAG access process, but this method still has certain network security risks, and a series of protections for the cloud need to be considered.
[0004] In another existing technical solution, the security and reliability of the burned files and chips are improved by encrypting and decrypting the burned files without saving the keys on the ground and disabling the JTAG debug port by flashing the ECU. This technical solution can encrypt and decrypt the burned files without saving the keys on the ground and disable the JTAG debug port after the burning is completed, but does not consider re-enabling the JTAG debug port to achieve further debugging and analysis. In practical applications, there may be certain limitations. Summary of the invention
[0005] In order to solve the problems in the prior art, the present invention provides a chip JTAG debugging port protection method.
[0006] The specific technical solutions are as follows:
[0007] A chip JTAG debugging port protection method, comprising:
[0008] Obtain the product feature number, and use the product feature number as the basis to generate a one-to-one key in segments, with each segment of the key using a different encryption algorithm;
[0009] Configure the registers of the chip in the product, develop the chip protection function module to generate the protection software code, and the chip compiles the software code with integrated protection function to form a burning file;
[0010] The one-to-one key is written into the chip's MCU by dynamically burning the file, and the MCU that has been burned is powered off and then powered on again.
[0011] Furthermore, a specific section of the encryption algorithm is provided with a key interface for inputting different contents to realize exclusive control over the key.
[0012] Furthermore, the processing of the burning file also includes: importing the burning file into the burner, the host computer of the burning device extracts the product feature number and automatically generates a verification key locally through encryption algorithm software.
[0013] Furthermore, the dynamic burning includes: starting the burning program, transmitting the key to a specific address segment of the burning file through the burner and burning it into the MCU.
[0014] Furthermore, after the MCU is powered on again, it tries to access the JTAG debug port in multiple ways again and performs a protection function check based on the access result:
[0015] If all accesses fail, the protection of the JTAG debug port takes effect;
[0016] If any access method is successful, the entire program will be erased and dynamically burned again.
[0017] Furthermore, the ECU of the chip is reserved with a communication interface for reactivating the JTAG debugging port, and the communication interface can only be connected to a local host computer and a communication tool.
[0018] A chip JTAG debug port protection system is applicable to the above-mentioned chip JTAG debug port protection method, comprising:
[0019] Key generation module: obtains the product feature code and generates a one-to-one key based on the product feature number;
[0020] Protection function module: generates software code with JTAG key protection function;
[0021] Burning module: compiles the software code generated by the protection function module to form a burning file, and writes the one-to-one key into the MCU through dynamic burning of the burning file;
[0022] ECU: includes MCU, which verifies whether the protection function of the JTAG debug port is effective and provides a communication interface for local decryption and activation of the JTAG debug port.
[0023] Furthermore, the protection function module is communicatively connected to the burning module, and the burning module and the key generation module are communicatively connected to the MCU.
[0024] A storage medium stores a computer program, which implements the above-mentioned chip JTAG debugging port protection method when executed by a processor.
[0025] An electronic device comprises a storage medium, a processor and a computer program stored in the storage medium and executable on the processor, wherein the processor executes the above-mentioned chip JTAG debugging port protection method.
[0026] The above technical solution has the following advantages or technical effects:
[0027] 1. The method of the present invention for protecting the JTAG debugging port of a chip by dynamically burning a key can achieve the effect that each product has its own unique key and the JTAG debugging port cannot be accessed or contacted by any remote means after shipment.
[0028] 2. The MCU of the present invention also reserves a communication interface. When there is actual need, the decrypted JTAG debugging port can still be activated and decrypted through a key and a pre-designed method after the product is returned, which not only ensures the safety and reliability of the product during use, but also retains the flexibility of the JTAG debugging port being activated and used under necessary conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a flow chart of the method of the present invention;
[0030] Figure 2 This is a flow chart of decrypting and activating the JTAG debugging port of a chip according to the present invention;
[0031] Figure 3 It is a schematic diagram of system connection of the present invention. DETAILED DESCRIPTION
[0032] In order to make the technical solution of the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] Embodiment 1:
[0034] like Figure 1 As shown, a chip JTAG debugging port protection method includes:
[0035] Get the product feature number, use the product feature number as the basis to generate a one-to-one key in segments, each segment of the key uses a different encryption algorithm, and a key interface is developed for a specific segment of the encryption algorithm, and different content can be input as needed to achieve exclusive control of the key. The product feature number is the product feature number of the BMS control board.
[0036] Based on the resources and architecture of the chip itself, configure the specific registers of the chip in the product, develop the chip's protection function module to generate protection software code, and the chip compiles the software code with integrated protection function to form a burning file.
[0037] The one-to-one key is written into the vehicle controller MCU through dynamic burning of the burning file, and the MCU that has been burned is powered off and then powered on again. After the dynamic burning of the burning file is completed and the MCU is restarted, the connection of the JTAG debugging port is closed. At this time, the outside world cannot access or contact the JTAG debugging port through any remote communication method, and the protection function can take effect. After the JTAG port is protected by dynamically burning the key, the corresponding session and unlocking service will be closed before the product is shipped, so that the JTAG port cannot be accessed or contacted through any remote communication method, and the controller data cannot be maliciously accessed or tampered with.
[0038] There are seven common types of automotive network security, and the treatment measures are shown in Table 1 below:
[0039] Table 1: Types of automotive cybersecurity and their measures
[0040] type Security Threat Weaknesses measure Backend Server Information cracking, internal attacks, unauthorized access, etc. Perform security control on back-end systems to minimize the risk of internal attacks, minimize unauthorized access, and prevent data leakage. Prevent unauthorized personnel from accessing personal or system key data through system design and access control. Vehicle Telematics Signal interference code injection, replay attack, etc. Use secure mechanisms (such as HSM) to store keys. Use access control techniques and design to protect system data / code. Prevent unauthorized personnel from accessing personal or system critical data. Measures should be taken to detect malicious insider messages or activities. Detection and recovery measures should be taken for denial of service attacks. Measures should be taken to prevent and detect unauthorized access. Measures should be taken to protect the system from viruses or malware. The vehicle should verify the authenticity and integrity of the information it receives. Vehicle function upgrade The upgrade package was maliciously modified, the OTA upgrade process was attacked, DoS, etc. Adopt a secure software update procedure. Use a secure method to store keys. Adopt security controls for back-end systems. Personnel misoperation Personnel failed to perform information security work according to the established procedures, etc. Define and control user roles and access rights. Organizational level Ensure security processes are defined and followed, including logging of actions and access related to the management of security functions. Short Range Communication USB, OBD, WIFI, NFC, etc. Implement security controls for systems with remote access. Implement security controls for external interfaces. Implement security controls to minimize the risk of foreseeable third-party software installed on vehicles. Software should be security assessed, certified, and integrity protected. Vehicle data and codes Malicious access or malicious tampering of vehicle data, system diagnostic data, etc. Use access control techniques to protect system data and code. Use access control techniques to prevent unauthorized personnel from accessing personal or system critical data. Use secure measures (such as security modules) to store keys. Correlate data from different sources to mitigate data manipulation attacks on sensors or transmitted data.
[0041] It can be seen that the possible threats to automotive network security need to be addressed by adopting adequate security mechanisms and access control technologies. Protecting access to the JTAG debug port (a commonly used programming debug port for Joint Test Action Group chips) is a very important protective measure against network security threats.
[0042] The prior art protects the JTAG access process by encrypting and protecting the key in the cloud and interacting with the local device. However, this method is still connected to the outside world, and there are still certain network security risks from the perspective of exposure and controllability. The present invention protects the JTAG debug port by dynamically burning the key and closes the corresponding session and unlocking service before the product is shipped. In this way, the JTAG debug port cannot be accessed or contacted through any remote communication method, and can only be reactivated through local interaction and decryption operations after the product is returned, which has higher security.
[0043] Import the burning file with integrated JTAG key protection function into the burner. At this time, the host computer of the burner can also extract the product feature number and automatically generate the verification key locally through the developed encryption algorithm software. After the burning program of the burner starts running, the key will be automatically transmitted to the specific address segment of the burning file through the burner according to the set method and burned into the MCU of the vehicle controller, thereby realizing the dynamic burning function.
[0044] After the programming is completed, the programmer will automatically power off the MCU and then power it back on. After the MCU is powered on again, it will retry multiple ways to access the JTAG debug port and perform a protection function check based on the access results: if all accesses fail, the protection of the JTAG debug port will take effect; if any access method succeeds, the entire program will be erased and dynamically programmed again. After dynamically programming the key to protect the chip JTAG port, the protection function check will be automatically performed, which can effectively prevent personnel from missing or misoperating.
[0045] After the product is encrypted and protected with JTAG, it will enter the subsequent production stage. At this time, some basic software interactions that do not go through the JTAG debug port can still be performed through specific communication interfaces and sessions, but before the final shipment of the product, these local and remote sessions and services in the application environment will be closed and cannot be opened again by sending specific instructions through the software. In this way, after the product is shipped and in the subsequent use, the JTAG debug port inside the MCU cannot be accessed or touched by any remote or conventional local means, which can meet the automotive network security requirements. If a problem occurs during the use of the product and needs to be analyzed in depth by debugging through the JTAG port, the product needs to be replaced and returned to the manufacturer, and then the manufacturer's designated technical team will decrypt, activate JTAG and analyze it.
[0046] The controller ECU (Electronic Control Unit) has a reserved communication interface for reactivating the JTAG debugging port. The communication interface can only be connected to the local host computer and communication tools. The communication interface is used to implement interaction, conversation and service with the local host computer and communication tools. Figure 2 As shown, after the problematic product is returned to the manufacturer, the technical team can first identify the product feature number, then determine the corresponding key interface content, and then input it into the developed encryption algorithm software to extract the automatically generated verification key. The technical team interacts with the specific communication interface through the local host computer, communication tools and wiring harness, and transmits the verification key to the MCU in a pre-defined sequence and method under the reserved session and service. When the MCU verifies the incoming verification key and the key written during the previous encryption and verifies that they are consistent, the JTAG debug port will be reactivated. After ensuring the maturity of the software and reaching an agreement with the user, there is no need to upgrade the function of the controller software, and there is no need to interact with the back-end server; the short-range communication method requires knowing the specific product feature number, encryption algorithm, communication interface and session at the same time to access the JTAG port, which has high security and reliability.
[0047] The prior art can encrypt and decrypt the burning file in a way of preserving the key without dropping it to the ground and deactivate the JTAG debug port after the burning is completed, but does not consider a solution of re-enabling the JTAG debug port to achieve further debugging and analysis; the present invention configures the JTAG protection mode through software code and applies it to the burning file, and can deactivate the JTAG debug port after the burning is completed, but can still subsequently transfer the key generated according to the product feature number and the encryption algorithm to the chip through the reserved communication interface and protocol, and then reactivate the JTAG debug port to achieve further debugging and analysis needs.
[0048] The present invention protects the JTAG debugging port by dynamically burning a key and closes the corresponding session and unlocking service before the product is shipped, so that the JTAG debugging port cannot be accessed or contacted by any remote communication method, and can only be reactivated through local interaction and decryption operations after the product is returned, which has higher security and certain flexibility.
[0049] The prior art encrypts and decrypts the burning file itself in a way that the key is not stored on the ground, which can indeed play a good protection role. However, the burning file is single, and the key is also single. From a probabilistic perspective, there is still a certain risk of being cracked. The present invention can generate a key one-to-one based on the product feature number and the encryption algorithm, and then, on the basis of the burning file that implements the JTAG key protection function through software code, dynamically combines the key with a specific address segment of the burning file during the burning process, thereby achieving the same effect of deactivating the JTAG debug port after the burning is completed, but the key for reactivating the JTAG debug port is different, and the specific product feature number, encryption algorithm, communication interface and session must be known at the same time to access the JTAG debug port, which has higher security and reliability.
[0050] Embodiment 2:
[0051] like Figure 3 As shown, a chip JTAG debug port protection system includes: a key generation module, a protection function module, a burning module and an ECU, the ECU includes an MCU, the protection function module is communicatively connected to the burning module, and the burning module and the key generation module are communicatively connected to the MCU.
[0052] Key generation module: obtains the product feature code and generates a one-to-one key based on the product feature number;
[0053] Protection function module: generates software code with JTAG key protection function;
[0054] Burning module: compiles the software code generated by the protection function module to form a burning file, and writes the one-to-one key into the MCU through dynamic burning of the burning file;
[0055] ECU: includes MCU, which verifies whether the protection function of the JTAG debug port is effective and provides a communication interface for local decryption and activation of the JTAG debug port.
[0056] The system of this embodiment is applicable to the method of Embodiment 1. The MCU in the embodiment is the MCU of the vehicle-mounted controller. By protecting the JTAG debugging port of the vehicle-mounted controller MCU, the requirements for automobile network security can be met.
[0057] Embodiment 3:
[0058] A storage medium is provided in a vehicle-mounted controller and stores a computer program thereon. When the computer program is executed by a processor, the method of embodiment 1 is implemented.
[0059] Embodiment 4:
[0060] An electronic device, specifically a vehicle-mounted controller, includes a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, and the processor executes the method of embodiment 1.
[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, systems, storage media, electronic devices, and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0064] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A chip JTAG debug port protection method, characterized in that: include: Obtain the product feature number, and use the product feature number as the basis to generate a one-to-one key in segments, with each segment of the key using a different encryption algorithm; Configure the registers of the chip in the product, develop the chip protection function module to generate the protection software code, and the chip compiles the software code with integrated protection function to form a burning file; The one-to-one key is written into the chip's MCU by dynamically burning the file, and the MCU that has been burned is powered off and then powered on again.
2. A chip JTAG debug port protection method according to claim 1, characterized in that: A specific section of the encryption algorithm is provided with a key interface for inputting different contents to realize exclusive control over the key.
3. A chip JTAG debug port protection method according to claim 1, characterized in that: The processing of the burning file also includes: importing the burning file into the burner, the upper computer of the burning device extracts the product feature number and automatically generates a verification key locally through encryption algorithm software.
4. A chip JTAG debug port protection method according to claim 3, characterized in that: The dynamic burning includes: starting the burning program, transmitting the key to the specific address segment of the burning file through the burner and burning it into the MCU.
5. A chip JTAG debug port protection method according to claim 1, characterized in that: After the MCU is powered on again, it tries to access the JTAG debug port in multiple ways again and performs a protection function check based on the access result: If all accesses fail, the protection of the JTAG debug port takes effect; If any access method is successful, the entire program will be erased and dynamically burned again.
6. A chip JTAG debug port protection method according to claim 1, characterized in that: The ECU of the chip is reserved with a communication interface for reactivating the JTAG debugging port, and the communication interface can only be connected to a local host computer and a communication tool.
7. A chip JTAG debug port protection system, applicable to a chip JTAG debug port protection method according to any one of claims 1 to 6, characterized in that: include: Key generation module: obtains the product feature code and generates a one-to-one key based on the product feature number; Protection function module: generates software code with JTAG key protection function; Burning module: compiles the software code generated by the protection function module to form a burning file, and writes the one-to-one key into the MCU through dynamic burning of the burning file; ECU: includes MCU, which verifies whether the protection function of the JTAG debug port is effective and provides a communication interface for local decryption and activation of the JTAG debug port.
8. A chip JTAG debug port protection system according to claim 7, characterized in that: The protection function module is connected to the burning module for communication, and the burning module and the key generation module are connected to the MCU for communication.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, a chip JTAG debug port protection method according to any one of claims 1 to 6 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, a chip JTAG debug port protection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Firmware protection unit of microcontroller with on-chip flash memory and protection method
CN106503494A
MCU-based FPGA property right protection and remote updating system and method
CN108875318A
Recorder and secret key security programming method
CN114201183A
Core code protection method of embedded chip
CN116049776A
JTAG security management module, security management method and chip
CN118260812A