Debugging port security access method and device, vehicle-mounted electronic equipment and storage medium
By using encryption algorithms and UID calculations in vehicle electronic devices, the generated keys and passwords are solved, and the problem of password leakage of debug ports is achieved is achieved, and high-security access of the device is prevented from hackers.
Patent Information
- Application Number
- CN202411683222.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-01-14
AI Technical Summary
The debugging port password in the on-board electronic equipment is easily leaked, resulting in damage to security. In the prior art, the password is clearly stored in the device and is easily hacked.
The debugging port password is encrypted using encryption algorithm, and the algorithm key and original password are calculated using the unique identifier (UID) of the on-board electronic device, stored in the device, and the target password is generated through the encryption algorithm every time it is accessed to ensure that Password security.
Effectively prevent password leakage, achieve secure access with one machine and one secret, avoid hacker intrusion, and enhance the security of on-board electronic devices.
Smart Images

Figure CN119312303A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-mounted information security technology, and in particular to a debugging port security access method, device, vehicle-mounted electronic equipment and storage medium. Background Art
[0002] With the development of electronic technology, intelligent modern cars have been widely used in people's daily travel. Among them, various electronic devices and systems installed in modern cars to increase the functionality of cars can be considered as on-board electronic devices. On-board electronic devices have networking functions, which can be connected to external networks through various communication interfaces, such as wireless networks, Bluetooth, on-board mobile hotspots (Wi-Fi) and other wireless communication technologies to achieve networking functions. However, the communication interfaces on on-board electronic devices are easy to become the entry point for hacker attacks. After hackers invade the vehicle through these communication interfaces, they can control the key functions of the vehicle, such as controlling the vehicle's braking, acceleration or steering, which will seriously threaten the safety of the driver and passengers.
[0003] Currently, most in-vehicle electronic devices need to meet the information security ISO21424 international standard to ensure that these communication interfaces meet information security requirements and avoid hacker attacks. Among them, the ISO21424 international standard also has clear requirements for the debug port (a type of communication interface) in in-vehicle electronic devices, which requires the debug port to be deleted or disabled during production, that is, the hardware debug port must be deleted during the production stage or the software debug interface must be permanently disabled.
[0004] However, deleting or disabling the debugging port is not conducive to the subsequent maintenance of the vehicle-mounted electronic equipment. At this time, in order to facilitate the subsequent maintenance of the vehicle-mounted electronic equipment and meet the requirements of the ISO21424 international standard, the debugging port is protected by a password in the relevant technology instead of deleting or disabling the debugging port. However, the password used by the debugging port of each vehicle-mounted electronic device is generally directly stored in plain text in the memory of the vehicle-mounted electronic device, which can easily cause the password to be leaked. Summary of the invention
[0005] The present application provides a debug port security access method, device, vehicle-mounted electronic device and storage medium to solve the technical problem in the related art that the password of the debug port is stored in plain text in the vehicle-mounted electronic device, which is prone to password leakage.
[0006] In a first aspect, the present application provides a debug port security access method, which is applied to an in-vehicle electronic device, the in-vehicle electronic device includes at least one debug port, and the debug port security access method includes: When receiving the debug port access password entered by the user, the pre-set encryption algorithm is called; The original password is encrypted using the algorithm key through the encryption algorithm to obtain the debug port target password. The algorithm key and the original password are both obtained by calculating the unique identifier (Unique ID, UID) of the vehicle-mounted electronic device; If the debug port access password and the debug port target password are consistent, the user is allowed to access the debug port.
[0007] In the above, when receiving the debug port access password input by the user, the preset encryption algorithm is called, and the original password is encrypted by the encryption algorithm using the algorithm key to obtain the debug port target password, and when the debug port access password and the debug port target password are consistent, the technical means of allowing the user to access the debug port solves the technical problem that the debug port password is stored in plain text in the vehicle-mounted electronic device in the related art, which is easy to cause password leakage. At present, the debug port target password is no longer stored in plain text in the vehicle-mounted electronic device, but is stored in the vehicle-mounted electronic device in the form of an algorithm key and an original password. Each time the user accesses the debug port, the vehicle-mounted electronic device needs to call the encryption algorithm to use the algorithm key to encrypt and calculate the original password to obtain the debug port target password, and the debug port target password will not be displayed, which ensures the security of the password and prevents the possibility of direct password leakage. In addition, the algorithm key and the original password are obtained by calculating the UID of the vehicle-mounted electronic device. Since the UID is unique, the effect of one machine and one password is achieved. In this way, even if the debug port target password of a certain vehicle-mounted electronic device is leaked, other vehicle-mounted electronic devices are also in a safe state and there is no risk of leakage.
[0008] In one embodiment of the present application, the debug port secure access method further includes: When the debug port access password and the debug port target password are confirmed to be inconsistent, the user is not allowed to access the debug port; Count the number of times the debug port access password is entered; When the input times do not reach the preset times threshold, the debug port access password re-entered by the user continues to be received; when the input times reach the preset times threshold, the user is prohibited from re-entering the debug port access password.
[0009] As described above, by setting a preset number of times threshold, when a user enters an incorrect debug port access password, if the current number of inputs does not reach the preset number of times threshold, the user is allowed to re-enter, which can avoid the problem of the user being unable to access the debug port due to an incorrect password input due to misoperation, that is, a certain number of fault tolerances is provided. If the current number of inputs reaches the preset number of times threshold, the user is prohibited from re-entering, which can effectively ensure the security of the password and avoid the situation where the user finds the correct debug port target password by continuously re-entering when the user does not know the debug port target password.
[0010] In one embodiment of the present application, the debug port secure access method further includes: When the vehicle-mounted electronic device is powered on for the first time, an initial key is received, and the length of the initial key is the same as the target password of the debug port; Read the UID of the vehicle's electronic equipment; Use the preset password generation rules to perform password generation calculation on the UID and the initial key to obtain the algorithm key and original password of the encryption algorithm; Save the algorithm key and the original password.
[0011] As described above, by receiving the initial key with the same length as the target password of the debug port, reading the UID of the on-board electronic device, and using the password generation rule to calculate the UID and the initial key, the algorithm key and the original password required for the encryption algorithm are obtained, which can ensure the uniqueness of the algorithm key and the original password (because the UID of each on-board electronic device is different), and then ensure the uniqueness of the debug port target password obtained based on the algorithm key and the original password, achieving the effect of one machine and one password.
[0012] In one embodiment of the present application, a password generation calculation is performed on the UID and the initial key using a preset password generation rule to obtain the algorithm key and the original password of the encryption algorithm, including: Convert the UID into a first character sequence of a preset length; Splitting the first character sequence into a first sub-character sequence and a second sub-character sequence; Performing encryption calculation on the first sub-character sequence and the initial key to obtain a second character sequence that meets the key length requirement of the encryption algorithm; The second character sequence is used as an algorithm key of the encryption algorithm, and the second sub-character sequence is used as an original password.
[0013] As described above, when the password generation rule is used to calculate the UID and the initial key, the UID is first converted into a first character sequence of a preset length, the first character sequence is split to obtain a first sub-character sequence and a second sub-character sequence, and then the first sub-character sequence and the initial key are encrypted to obtain the second character sequence as the algorithm key, and the second sub-character sequence is used as the original password. The original password and the algorithm key can be obtained through a complex calculation process, thereby increasing the security of the debug port target password.
[0014] In one embodiment of the present application, the UID is transformed into a first character sequence of a preset length, including: The UID is hashed using an irreversible first hash algorithm to obtain a first character sequence of a preset length.
[0015] As described above, the UID is transformed into a first character sequence of a preset length by an irreversible first hash algorithm, so that the security of the calculation process can be ensured.
[0016] In one embodiment of the present application, the length of the first sub-character sequence is the same as that of the initial key. The first sub-character sequence and the initial key are encrypted and calculated to obtain a second character sequence that meets the key length requirement of the encryption algorithm, including: Performing an XOR calculation on the initial key and the first sub-character sequence to obtain a third character sequence; The third character sequence is hashed using the second hash algorithm to obtain a second character sequence that meets the key length requirement of the encryption algorithm.
[0017] In the above, in the process of obtaining the second character sequence, the initial key and the first sub-character sequence are first XORed, which can increase the computational complexity and further increase the difficulty of cracking the algorithm key, thereby ensuring the security of the algorithm key.
[0018] In one embodiment of the present application, the algorithm key is stored in a hardware security module of the vehicle-mounted electronic device for use by the encryption algorithm.
[0019] As mentioned above, the algorithm key is stored in the hardware security module, which can ensure secure key management.
[0020] In a second aspect, the present application further provides a debug port security access device, which is applied to an in-vehicle electronic device, the in-vehicle electronic device includes at least one debug port, and the debug port security access device includes: An algorithm calling unit, used to call a preset encryption algorithm upon receiving a debug port access password input by a user; A password determination unit, used to encrypt the original password using an algorithm key through an encryption algorithm to obtain a debug port target password, wherein the algorithm key and the original password are both obtained by calculating the UID of the vehicle-mounted electronic device; The access permission unit is used to allow the user to access the debug port when it is confirmed that the debug port access password and the debug port target password are consistent.
[0021] In a third aspect, the present application further provides an in-vehicle electronic device, comprising: at least one debugging port, one or more processors and a memory, A memory for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement the debug port security access method as described in the first aspect.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the debug port security access method of the first aspect is implemented.
[0023] The beneficial effects of the debug port security access device, the vehicle-mounted electronic device, and the storage medium mentioned above can refer to the beneficial effects of the debug port security access method. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a debug port security access method provided by an embodiment of the present application; Figure 2 A flowchart of a debug port security access method provided by another embodiment of the present application; Figure 3 A schematic diagram of the structure of a debug port security access device provided by one embodiment of the present application; Figure 4 A schematic diagram of the structure of an on-vehicle electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only the parts related to the embodiments of the present application rather than all structures are shown in the accompanying drawings, and those skilled in the art should be able to think of it after reading the specification of this application that as long as the technical features do not contradict each other, any combination of the technical features can constitute an optional implementation method.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated before and after are in an "or" relationship. In the description of the present application, "multiple" means two or more, and "several" means one or more.
[0027] For vehicle-mounted electronic devices, the debugging port of the microcontroller unit (MCU) can be used to maintain hardware and software, such as burning data required for the operation of vehicle-mounted electronic devices through the debugging port, and updating and upgrading software through the debugging port. However, an exposed debugging port can be easily hacked, so the security protection of the debugging port is crucial.
[0028] In the current industry, in order to ensure the security of the debug port, it is necessary to delete or disable the debug port when producing the vehicle-mounted electronic equipment. However, this is not conducive to the subsequent maintenance of the vehicle-mounted electronic equipment. Therefore, in the related art, in order to facilitate the subsequent maintenance of the vehicle-mounted electronic equipment and meet the requirements of the ISO21424 international standard, a password for identity authentication is set for the debug port. That is, when the password entered by the user is consistent with the password set for the debug port, it means that the user identity authentication is passed. At this time, the user can access the debug port, that is, debug the vehicle-mounted electronic equipment through the debug port.
[0029] However, the password currently set for the debug port is fixed, not one password for each device (i.e., on-board electronic device). Therefore, when the debug port password of one on-board electronic device is leaked, the debug ports of other on-board electronic devices may also be affected, posing a security risk. In addition, the current debug port password is generally stored in plain text in the memory of the on-board electronic device, which cannot guarantee the security of the password and there is a high possibility that the password will be leaked. Once the password is leaked, the debug port is no longer secure.
[0030] Based on this, the present application provides a debug port security access method. In the debug port security access method, the password set for the debug port is no longer stored in plain text in the vehicle-mounted electronic device, but is stored in the vehicle-mounted electronic device in the form of an algorithm key and an original password. After the user enters the password each time, the vehicle-mounted electronic device will encrypt and calculate the original password through the algorithm key to obtain the real password of the debug port, and the password will not be displayed, which ensures the security of the password and prevents the possibility of direct leakage of the password. In addition, the algorithm key and the original password are obtained by calculating the UID of the vehicle-mounted electronic device, achieving the effect of one machine and one password. In this way, even if the password of the debug port of a vehicle-mounted electronic device is leaked, other vehicle-mounted electronic devices are also in a safe state and there is no risk of leakage.
[0031] The debug port security access method provided in the embodiment of the present application is applied to an on-board electronic device, that is, the debug port security access method can be executed by the on-board electronic device, and the on-board electronic device can be a physical entity or composed of multiple physical entities.
[0032] The in-vehicle electronic device includes one or more processors, and the processor may be an MCU and / or a Field Programmable Gate Array (FPGA) and / or a System-on-Chip (SoC), etc. Currently, the in-vehicle electronic device is described as including at least an MCU.
[0033] The on-board electronic device may also include a memory (which can also be considered as the memory of the on-board electronic device), and the memory and the processor may be connected via a bus or other means. As a computer-readable storage medium, the memory can be used to store software programs, computer executable programs, and modules (units), such as the program instructions / modules (units) corresponding to the debug port security access method in the embodiment of the present application. The memory can store computer programs required for at least one function, data created according to the use of the on-board electronic device, etc. The processor can implement the corresponding functions of the on-board electronic device based on the software programs, computer executable programs, and modules stored in the memory, such as implementing the debug port security access method based on the computer program stored in the memory.
[0034] The processor (such as MCU) of the vehicle-mounted electronic device is also provided with at least one debugging port, so as to realize the functions such as hardware and software maintenance through the debugging port. The specific data of the debugging port can be set in combination with the actual situation of the vehicle-mounted electronic device, and is not limited at present.
[0035] The on-board electronic equipment also includes a hardware security module (HSM). The HSM is used for the production, storage and processing of vehicle safety information. It is an independent chip or a specific area on the chip. Among them, the implementation methods of HSM include built-in HSM and external HSM. Currently, there is no limitation on the implementation method of HSM. It can be understood that if a built-in HSM is used, the processor and HSM are integrated together. If an external HSM is used, the processor and HSM can communicate through the I2O bus and other methods. HSM supports functions such as secure storage and symmetric algorithms, and can realize encryption and decryption of symmetric keys, symmetric verification, etc. At this time, in order to achieve secure storage, the memory of the on-board electronic equipment also contains an area, and the data stored in this area can only be accessed by the HSM. Currently, this area is recorded as the secure storage area of the HSM.
[0036] Optionally, the vehicle-mounted electronic device may further include a display screen, through which interaction with the user may be achieved. Optionally, the display screen may be a touch display screen, that is, the user may achieve interaction by touching the display screen.
[0037] Currently, if a user wants to access the debug port, he needs to enter a password first. After that, the on-board electronic device determines whether the password entered by the user is correct. If it is correct, the user can continue to access the debug port to implement functions such as hardware and software maintenance through the debug port. When the on-board electronic device determines whether the password entered by the user is correct, the debug port security access method can be executed.
[0038] Figure 1 A flowchart of a debug port security access method provided by an embodiment of the present application, refer to Figure 1 The debug port security access method includes steps 110 to 130: Step 110: When receiving the debug port access password input by the user, call the preset encryption algorithm.
[0039] Exemplarily, when a user needs to access the debug port, the on-board electronic device will remind the user to enter the password required to access the debug port. At this time, the on-board electronic device can first call up the password input interface through the display screen, so that the user can enter the password required to access the debug port in the interface. Currently, the password entered by the user is recorded as the debug port access password. It is understandable that users need certain professional capabilities when performing maintenance and other work on the hardware and software of the on-board electronic device through the debug port. Therefore, the user currently mentioned can be a staff member with maintenance capabilities. The staff has a certain computing ability and can calculate according to the debug port password generation rules to obtain the debug port access password and enter the debug port access password.
[0040] Currently, the password set for the debug port is recorded as the debug port target password. In one embodiment, the debug port target password is obtained according to the UID of the vehicle-mounted electronic device. Each vehicle-mounted electronic device has a corresponding UID, and the UID is unique. Different vehicle-mounted electronic devices can be distinguished by the UID. Optionally, the UID of the MCU in the vehicle-mounted electronic device is used as the UID of the vehicle-mounted electronic device, and the debug port target password is finally obtained based on the UID of the MCU.
[0041] The length of the debug port target password can be set according to the actual situation. In one embodiment, the length of the debug port target password is 16 bytes. At this time, the debug port access password entered by the user should also meet the 16-byte length. On this basis, the user can first check the UID of the vehicle-mounted electronic device, and then calculate the UID according to the debug port target password generation rule to obtain the debug port access password, and then enter the debug port access password.
[0042] When the on-board electronic device detects that the user inputs a 16-byte password, it determines that the debug port access password has been received. At this time, the on-board electronic device calls the pre-stored (i.e., pre-set) encryption algorithm, i.e., uses the encryption algorithm interface to implement the call of the encryption algorithm. It can be understood that, in order to ensure the storage security of the debug port target password, the debug port target password is not directly stored in the on-board electronic device, but the algorithm key and the original password required to generate the debug port target password are stored in the on-board electronic device, and the original password is processed using the pre-set encryption algorithm using the algorithm key to obtain the debug port target password.
[0043] Among them, the key is a parameter that can convert plaintext into ciphertext, or convert ciphertext into plaintext. Currently, the debug port target password can be considered as the ciphertext that needs to be converted, the algorithm key can be considered as the key required to convert the debug port target password, and the original password can be considered as the plaintext required to convert the debug port target password. The encryption algorithm is the algorithm used when calculating the original password using the algorithm key.
[0044] Encryption algorithms are generally divided into symmetric encryption algorithms and asymmetric encryption algorithms. Currently, the encryption algorithm used by vehicle-mounted electronic devices is a symmetric encryption algorithm. In one embodiment, the AES256_ECB algorithm is taken as an example of the encryption algorithm currently used. Among them, AES stands for Advanced Encryption Standard, and 256 indicates that the key length required by the encryption algorithm is 256 bits, that is, the length of the algorithm key is 256 bits. It can be understood that 1 byte = 8 bits, so the length of the algorithm key can also be expressed as 32 bytes. ECB (Electronic Codebook) mode is one of the simplest encryption modes. It divides the plaintext into blocks of fixed size and encrypts each block independently. Since the AES256_ECB algorithm is a more commonly used encryption algorithm, the embodiment does not explain its specific calculation logic in detail, and the existing AES256_ECB algorithm can be referred to. In actual applications, vehicle-mounted electronic devices can also use other types of encryption algorithms, and the embodiment does not limit this.
[0045] After the vehicle-mounted electronic device calls the encryption algorithm, step 120 may be executed.
[0046] Step 120: Encrypt the original password using the algorithm key through the encryption algorithm to obtain the debug port target password. The algorithm key and the original password are both obtained by calculating the UID of the vehicle-mounted electronic device.
[0047] Both the algorithm key and the original password can be pre-set, or they can be obtained by the on-board electronic device through calculation of the UID. In one embodiment, it is taken as an example that both the algorithm key and the original password are obtained by calculating the UID. Among them, the algorithm key and the original password can be calculated at the same time, that is, the on-board electronic device can calculate the UID once to obtain the algorithm key and the original password respectively. In practical applications, the algorithm key and the original password can also be calculated separately. That is, the on-board electronic device can first calculate the UID to obtain the algorithm key or the original password, and then calculate the UID to obtain the original password or the algorithm key.
[0048] The rules used when calculating the algorithm key and the original password are not currently limited. For example, the algorithm key and the original password can be obtained by performing data processing methods such as hash calculation, scrambling, splitting and / or XOR calculation on the UID. Optionally, when obtaining the algorithm key and the original password through the UID, an initial default key can also be introduced. The initial default key can be manually set and provided to the on-board electronic device. After that, the on-board electronic device can calculate the UID in combination with the initial default key (may use hash calculation, scrambling, splitting and / or XOR calculation, etc.) to obtain the algorithm key and the original password. Among them, the on-board electronic device can calculate the UID when it is powered on for the first time to obtain the algorithm key and the original password, and store the algorithm key and the original password. Among them, the length of the algorithm key needs to meet the key length requirements of the encryption algorithm. For example, when the encryption algorithm is AES256_ECB, the calculated algorithm key should be 32 bytes. The length of the original password can be set according to the actual situation. For example, when the target password of the debug port is 16 bytes and AES256_ECB is used as the encryption algorithm, the length of the original password is set to 16 bytes.
[0049] Optionally, the algorithm key is stored in the HSM of the vehicle-mounted electronic device for use by the encryption algorithm. It is understandable that the HSM can implement functions such as key storage and processing. The original password can be stored in a secure storage area of the HSM or other areas of the memory. In one embodiment, the original password is stored in a secure storage area of the HSM as an example. At this time, after the vehicle-mounted electronic device calls the encryption algorithm, the process of encrypting the original password using the algorithm key through the encryption algorithm can also be considered to be executed by the HSM, that is, after the processor calls the encryption algorithm, the HSM runs the encryption algorithm and uses the algorithm key to encrypt the original password. Optionally, the user cannot view the algorithm key and the original password to further ensure security.
[0050] When the vehicle electronic device calls the encryption algorithm, the encryption algorithm can use the algorithm key to encrypt the original password, and the result obtained after encryption is the debug port target password. For example, the AES256_ECB algorithm is the currently used encryption algorithm, the algorithm key is 32 bytes, and the original password is 16 bytes. At this time, the encryption algorithm uses the 32-byte algorithm key to encrypt the 16-byte original password to obtain the 16-byte debug port target password.
[0051] It is understandable that for users, the UID can also be calculated according to the calculation rules of the original password and algorithm key to obtain the algorithm key and the original password, and then the encryption algorithm is used to encrypt the original password through the algorithm key to obtain the debug port access password.
[0052] After obtaining the debug port target password, the vehicle-mounted electronic device executes step 130 .
[0053] Step 130: When it is confirmed that the debug port access password is consistent with the debug port target password, the user is allowed to access the debug port.
[0054] Exemplarily, after the in-vehicle electronic device obtains the debug port target password, it compares the received debug port access password with the debug port target password to see if they are consistent (i.e., the same). If they are consistent, it means that the user has entered the correct password. Therefore, the user is considered to have legal access, i.e., the user's identity authentication has passed. Therefore, the user is allowed to access the debug port, that is, to maintain the hardware and software of the in-vehicle electronic device through the debug port.
[0055] If the debug port access password is inconsistent with the debug port target password, it means that the user has entered an incorrect password. In this case, the user is considered to have illegally accessed the debug port, and therefore, the user is not allowed to access the debug port. In this case, in order to avoid the problem that the user cannot access the debug port due to mistakenly entering an incorrect password, the number of password inputs allowed can be set to ensure that the user has a chance to enter the correct password when entering an incorrect password. In this case, the debug port security access method may also include: when it is confirmed that the debug port access password and the debug port target password are inconsistent, the user is not allowed to access the debug port; counting the number of times the debug port access password is entered; when the number of inputs does not reach a preset number threshold, continuing to receive the debug port access password re-entered by the user, and when the number of inputs reaches the preset number threshold, prohibiting the user from re-entering the debug port access password.
[0056] Exemplarily, after determining that the debug port access password and the debug port target password are inconsistent, the vehicle-mounted electronic device does not allow the user to access the debug port, and then the vehicle-mounted electronic device determines the number of inputs of the debug port access password currently entered by the user. It can be understood that after the vehicle-mounted electronic device is powered on this time, each time the debug port access password entered by the user is received, the number of inputs will be increased by 1. After obtaining the current number of inputs, if it is determined that the current number of inputs does not reach (i.e., is less than) the preset number of times threshold, it means that the user can continue to enter the debug port access password. At this time, the interface for entering the debug port access password can continue to be displayed to allow the user to continue to enter the debug port access password, that is, continue to receive the debug port access password re-entered by the user, and when the debug port access password is received, the encryption algorithm is called, that is, step 110 is executed. If the current number of inputs reaches the preset number of times threshold, it means that the user has entered the debug port access password a certain number of times and none of them are entered correctly, it can be considered that the user does not know the real debug port target password, and therefore, the user is prohibited from accessing the debug port, that is, the user is prohibited from entering the debug port access password again. At this time, if the user wants to continue to access the debug port, the vehicle-mounted electronic device needs to be powered off and then powered on again, and the user can continue to enter the debug port access password. The preset number of times threshold can be set according to actual conditions, for example, set to 3 times.
[0057] Optionally, before the user enters the debug port access password each time, the in-vehicle electronic device will first count the current number of inputs, and allow the user to continue to enter the debug port access password when the number of inputs does not reach a preset threshold.
[0058] Optionally, when the user is prohibited from accessing the debug port, a corresponding prompt may be given through the display screen to make it clear to the user that he cannot continue to enter the password.
[0059] The following is an exemplary description of the debug port security access method provided by the above embodiment. In this example, the AES256_ECB algorithm is used as the encryption algorithm currently used, and the preset number of times threshold is 3 times. At present, when the user determines that the debug port needs to be accessed, the debug port password input interface can be called up by operating the vehicle-mounted electronic device. At this time, the vehicle-mounted electronic device determines that the current number of inputs of the debug port access password is 0, which has not reached 3 times. Therefore, the user is allowed to continue to enter the debug port access password, and after receiving the debug port access password entered by the user, the AES256_ECB algorithm is called to encrypt the original password using the algorithm key to obtain the debug port target password. After that, it is determined whether the debug port target password is consistent with the debug port access password entered by the user. If they are consistent, it means that the user's identity authentication has passed and continued access is allowed. If they are inconsistent, the current number of inputs is counted as 1. At this time, the number of inputs has not reached 3 times. Therefore, the user is allowed to re-enter the debug port access password, that is, the vehicle-mounted electronic device continues to receive the debug port access password entered by the user. If the user continues to enter the wrong debug port access password, and the number of inputs counted reaches 3 times, the user is prohibited from re-entering the debug port access password. At this time, the user can control the vehicle-mounted electronic equipment to power off and then power it on again, and then perform the above steps again to continue accessing the debug port.
[0060] In the above, when receiving the debug port access password input by the user, the preset encryption algorithm is called, and the original password is encrypted by the encryption algorithm using the algorithm key to obtain the debug port target password, and when the debug port access password and the debug port target password are consistent, the technical means of allowing the user to access the debug port solves the technical problem that the debug port password is stored in plain text in the vehicle-mounted electronic device in the related art, which is easy to cause password leakage. At present, the debug port target password is no longer stored in plain text in the vehicle-mounted electronic device, but is stored in the vehicle-mounted electronic device in the form of an algorithm key and an original password. Each time the user accesses the debug port, the vehicle-mounted electronic device needs to call the encryption algorithm to use the algorithm key to encrypt and calculate the original password to obtain the debug port target password, and the debug port target password will not be displayed, which ensures the security of the password and prevents the possibility of direct password leakage. In addition, the algorithm key and the original password are obtained by calculating the UID of the vehicle-mounted electronic device. Since the UID is unique, the effect of one machine and one password is achieved. In this way, even if the debug port target password of a certain vehicle-mounted electronic device is leaked, other vehicle-mounted electronic devices are also in a safe state and there is no risk of leakage. In addition, by setting a preset number of times threshold, when a user enters an incorrect debug port access password, if the current number of inputs does not reach the preset number of times threshold, the user is allowed to re-enter, which can avoid the problem of the user being unable to access the debug port due to an incorrect password input due to misoperation, that is, a certain number of fault tolerance is provided. If the current number of inputs reaches the preset number of times threshold, the user is prohibited from re-entering, which can effectively ensure the security of the password and avoid the situation where the user finds the correct debug port target password by continuously re-entering when he does not know the debug port target password. In addition, the algorithm key is stored in the HSM, which can ensure secure key management.
[0061] Figure 2 A flowchart of a debug port security access method provided by another embodiment of the present application, Figure 2 The method shown is in Figure 1 Based on the method shown, the generation process of the algorithm key and the original password is further described. Figure 2 The debug port security access method includes steps 210 to 270: Step 210: When the vehicle-mounted electronic device is powered on for the first time, an initial key is received, and the length of the initial key is the same as the target password of the debug port.
[0062] The initial key can be considered as a manually set key. The initial key is used to obtain the algorithm key, that is, the algorithm key can be obtained by performing appropriate calculations on the initial key and UID. The initial key is fixed, that is, each on-board electronic device can use a fixed initial key. At this time, after the user knows the calculation rules of the initial key and the debug port target password, he can calculate the debug port access password in combination with the UID.
[0063] Exemplarily, when the vehicle-mounted electronic device is powered on for the first time, the algorithm key and the original password for accessing the debug port are actively configured. The configuration process can be recorded as security KEY configuration, and the configuration process is the process presented in steps 210 to 240. After the active configuration starts, an initial key is manually assigned to the vehicle-mounted electronic device. The initial key can be manually input into the vehicle-mounted electronic device, or the initial key can be manually stored in the vehicle-mounted electronic device during the production process of the vehicle-mounted electronic device. Afterwards, after the active configuration starts, the vehicle-mounted electronic device can read the stored initial key.
[0064] Currently, the length of the initial key is the same as the length of the debug port target password to facilitate subsequent calculations. Currently, when the debug port target password is 16 bytes, the length of the initial key is also 16 bytes.
[0065] Step 220: Read the UID of the vehicle-mounted electronic device.
[0066] Currently, the UID of the vehicle-mounted electronic device is the UID of the MCU of the vehicle-mounted electronic device. In one embodiment, the length of the UID of the MCU in the vehicle-mounted electronic device is 8 bytes. In actual applications, the UID of the MCU may also be of other lengths, which is not limited in the embodiment.
[0067] After receiving the initial key, the on-board electronic device reads the UID of the MCU.
[0068] Step 230: Use the preset password generation rule to perform password generation calculation on the UID and the initial key to obtain the algorithm key and original password of the encryption algorithm.
[0069] Password generation rules refer to calculation rules used to generate algorithm keys and original passwords. Password generation rules can be pre-stored in the vehicle-mounted electronic equipment for use. The specific content of the password generation rules can be set according to actual needs, including the calculation of the UID and the initial key, and can include calculations for converting character lengths (such as hash calculations), encryption calculations (such as XOR calculations, etc.). The calculation process when using password generation rules can be considered as password generation calculations.
[0070] Currently, the vehicle-mounted electronic device uses the password generation rule to calculate the UID and the initial key, and then obtains the algorithm key and the original password. The following is an exemplary description of the calculation process corresponding to the password generation rule. At this time, step 230 includes steps 231-234: Step 231: transform the UID into a first character sequence of a preset length.
[0071] Currently, the length of UID is 8 bytes. In order to facilitate subsequent calculations, the length of UID is first transformed. Among them, the length after the change is a preset length, and its specific value can be set in combination with the specific content of the current password generation rule. In one embodiment, when the length of the debug port target password is 16 bytes, the preset length is 32 bytes, that is, the preset length is twice the length of the debug port target password. That is, the on-board electronic equipment converts an 8-byte character sequence (i.e., UID) into a 32-byte character sequence. In one embodiment, the converted character sequence is recorded as the first character sequence.
[0072] The calculation method used for length conversion is not currently limited, and any existing calculation method that can realize length conversion can be used in this step. In one embodiment, the length conversion is realized by using a hash calculation as an example. At this time, step 231 can be specifically as follows: using an irreversible first hash algorithm to perform a hash calculation on the UID to obtain a first character sequence of a preset length.
[0073] Currently, the hash algorithm used when transforming the UID into the first character sequence is recorded as the first hash algorithm, and the first hash algorithm is irreversible to ensure the security of the calculation process. In one embodiment, the first hash algorithm is Hash256. Among them, Hash256 is an encryption algorithm commonly used in cryptography, which maps data of any length to a hash value of a fixed length, and the hash value of the fixed length can be considered as the first character sequence currently obtained. The Hash256 algorithm is the abbreviation of SHA-256 (Secure Hash Algorithm 256 bits), which is irreversible. In practical applications, other hash algorithms can also be used.
[0074] Exemplarily, after reading the UID, Hash256 calculation is performed on the UID to obtain a 32-byte first character sequence. Since Hash256 is an existing encryption algorithm, the implementation process of the algorithm is not described in detail at present.
[0075] Step 232: Split the first character sequence into a first sub-character sequence and a second sub-character sequence.
[0076] Exemplarily, the first character sequence is split into two sequences, and currently, the two sequences are respectively recorded as a first sub-character sequence and a second sub-character sequence, wherein the first sub-character sequence is used to calculate with the initial key to obtain the algorithm key, and the second sub-character sequence is used as the original password.
[0077] Currently, the length of the second sub-character sequence is equal to the length of the debug port target password, that is, the length of the original password is equal to the length of the debug port target password. Optionally, the length of the second sub-character sequence is equal to the length of the first sub-character sequence, in which case the lengths of the initial key, the second sub-character sequence, the first sub-character sequence, and the debug port target password are all equal.
[0078] It can be understood that since the length of the first character sequence is 32 bytes and the length of the debug port target password is 16 bytes, when splitting the first character sequence, the first 16 bytes of the first character sequence can be taken as the first sub-character sequence and the last 16 bytes of the first character sequence can be taken as the second sub-character sequence, or the first 16 bytes of the first character sequence can be taken as the second sub-character sequence and the last 16 bytes of the first character sequence can be taken as the first sub-character sequence.
[0079] In practical applications, other splitting methods may also be used. For example, the first character sequence is first split into four segments, and then they are combined into a first sub-character sequence and a second sub-character sequence according to a certain rule.
[0080] Step 233: Perform encryption calculation on the first sub-character sequence and the initial key to obtain a second character sequence that meets the key length requirement of the encryption algorithm.
[0081] Currently, the on-board electronic device can perform encryption calculation on the first sub-character sequence and the initial key, that is, use the initial key to encrypt the first sub-character sequence to obtain an encrypted character sequence. Currently, the obtained character sequence is recorded as the second character sequence. The length of the second character sequence should meet the length of the algorithm key used by the encryption algorithm, that is, the length of the second character sequence should be equal to the length of the algorithm key. For example, when the encryption algorithm is the AES256_ECB algorithm, the length of the algorithm key is 32 bytes, so the length of the second character sequence should also be 32 bytes.
[0082] Among them, the encryption calculation can be considered as using the initial key to encrypt the first sub-character sequence to increase the computational difficulty of the algorithm key generation process, thereby increasing the difficulty of cracking. The specific implementation means of the encryption calculation can be set in combination with the actual situation. As long as the technical means can be used to encrypt the first character sequence using the initial key and obtain a character sequence that meets the length requirements, they can be used as the current encryption calculation implementation means. In one embodiment, taking the encryption calculation consisting of XOR calculation and hash calculation as an example, at this time, step 233 includes steps 2331-2332: Step 2331: Perform an XOR calculation on the initial key and the first sub-character sequence to obtain a third character sequence.
[0083] Currently, the length of the first sub-character sequence and the initial key are the same, both are 16 bytes. Therefore, the first sub-character sequence and the initial key can be XORed. The XOR calculation is to increase the difficulty of cracking and ensure the security of the algorithm key. Among them, Exclusive OR (XOR) is a mathematical operator, which is often used in logical operations and bit operations in computers. When the two input values are different, the output of the XOR operation is true (1), otherwise the output is false (0). The XOR calculation is a calculation using XOR logic. At this time, each character in the two sequences can be compared one by one to obtain a new character sequence by XOR calculation. Currently, the obtained character sequence is recorded as the third character sequence. The length of the third character sequence is 16 bytes.
[0084] Step 2332: Use the second hash algorithm to perform hash calculation on the third character sequence to obtain a second character sequence that meets the key length requirement of the encryption algorithm.
[0085] After the third character sequence is currently obtained, it is necessary to convert the third character sequence into a second character sequence that meets the key length requirements of the encryption algorithm, that is, to transform the length of the third character sequence. The calculation method used for length transformation is not currently limited, and the existing calculation methods that can realize length transformation can be used for this step. In one embodiment, the length transformation is described by using a hash calculation method as an example. Currently, the hash algorithm used when transforming the third character sequence into the second character sequence is recorded as the second hash algorithm. In one embodiment, the length of the algorithm key of the encryption algorithm is 32 bytes, that is, the length of the second character sequence is 32 bytes, and the length of the third character sequence is 16 bytes. Therefore, it is necessary to use a second hash algorithm to transform the 16-byte third character sequence into a 32-byte second character sequence. In one embodiment, the second hash algorithm is the same as the first hash algorithm, both of which are Hash256. In practical applications, other hash algorithms can also be used.
[0086] Step 234: Use the second character sequence as the algorithm key of the encryption algorithm, and use the second sub-character sequence as the original password.
[0087] Exemplarily, after obtaining the second character sequence, the second character sequence can be used as an algorithm key, and the second sub-character sequence can also be used as an original password.
[0088] Step 240: Save the algorithm key and the original password.
[0089] After obtaining the algorithm key and the original password, the vehicle electronic device saves the algorithm key and the original password so that the algorithm key and the original password can be used when a subsequent user needs to access the debug port. Optionally, the algorithm is stored in the HSM of the vehicle electronic device for use by the encryption algorithm. The original password can be stored in a secure storage area of the HSM.
[0090] After saving the algorithm key and original password, the active configuration can be considered complete.
[0091] It should be noted that the aforementioned steps 210 to 240 can be implemented before the vehicle-mounted electronic device leaves the factory, that is, when the vehicle-mounted electronic device produced in the factory is powered on for the first time, active configuration can be performed to obtain the algorithm key and the original password. The subsequent steps 250 to 270 can be implemented during the use of the vehicle-mounted electronic device after leaving the factory, that is, during the normal operation of the vehicle-mounted electronic device, when the user requests to access the debug port, the user will be prompted to enter the corresponding password and execute steps 250 to 270.
[0092] Step 250: When receiving the debug port access password input by the user, call the preset encryption algorithm.
[0093] Please refer to step 110.
[0094] Step 260: Encrypt the original password using the algorithm key through the encryption algorithm to obtain the debug port target password. The algorithm key and the original password are both obtained by calculating the UID of the vehicle-mounted electronic device.
[0095] Please refer to step 120.
[0096] Step 270: When it is confirmed that the debug port access password and the debug port target password are consistent, the user is allowed to access the debug port.
[0097] Please refer to step 130.
[0098] The following is an exemplary description of the debug port security access method provided in the above embodiment. In this example, the AES256_ECB algorithm is used as the encryption algorithm currently used, the length of the original password and the debug port target password are both 16 bytes, the length of the algorithm key is 32 bytes, and the first hash algorithm and the second hash algorithm are both Hash256. Currently, when the on-board electronic device produced in the factory is powered on for the first time, the security KEY configuration is performed. At this time, the initial key assigned to the on-board electronic device is obtained. The current initial key is named original_data, and its length is 16 bytes. The initial keys of each on-board electronic device produced by the factory can be the same. Afterwards, the UID of the MCU is read, and the length of the UID is 8 bytes. Afterwards, the UID is Hash256 calculated to obtain a 32-byte first character sequence. Currently, the first character sequence is named UID_HASH. Afterwards, the sequence of the last 16 bytes in UID_HASH is taken as the first sub-character sequence, and the sequence of the first 16 bytes in UID_HASH is taken as the second sub-character sequence. Currently, the first sub-character sequence and the second sub-character sequence are named UID_HASH_L and UID_HASH_H, respectively. After that, perform XOR calculation on original_data and UID_HASH_L to obtain the third character sequence. Currently, the third character sequence is named original_key, that is, original_key = (original_data) xor (UID_HASH_L), and original_key is 16 bytes. After that, perform Hash256 calculation on original_key to obtain the second character sequence of 32 bytes. Currently, the second character sequence is named original_key_hash. After that, store original_key_hash as the algorithm key (i.e. encryption KEY) of AES256_ECB in HSM (also known as HSM encryption module), and store UID_HASH_H as the original password in the secure storage area of HSM. Afterwards, during the normal operation of the on-board electronic equipment, when the user requests to access the debug port, the on-board electronic equipment reminds the user to enter the 16-byte debug port access password. The current debug port access password is named KEY1. When the on-board electronic equipment receives the 16-byte KEY1, it uses the AES256_ECB algorithm interface and uses original_key_hash as the algorithm key to encrypt and calculate UID_HASH_H to obtain the debug port target password. The current debug port target password is named password.Afterwards, it is determined whether password is equal to KEY1. If they are equal, the user is allowed to continue accessing. If they are not equal, the user is not allowed to continue accessing. When the user fails to enter the debug port access password for 3 times (i.e., they are not equal to password), it is determined that the user is prohibited from accessing during the current cycle (i.e., during power-on). The user can access the vehicle electronic equipment again after it is powered on again.
[0099] In the above, by receiving the initial key with the same length as the target password of the debug port, reading the UID of the vehicle-mounted electronic device, and using the password generation rule to calculate the UID and the initial key, the algorithm key and the original password required by the encryption algorithm can be obtained, which can ensure the uniqueness of the algorithm key and the original password (because the UID of each vehicle-mounted electronic device is different), and then ensure the uniqueness of the debug port target password obtained based on the algorithm key and the original password, and achieve the effect of one machine and one secret. In addition, when using the password generation rule to calculate the UID and the initial key, the UID is first transformed into a first character sequence of a preset length, and then the first character sequence is split to obtain a first sub-character sequence and a second sub-character sequence, and then the first sub-character sequence and the initial key are encrypted and calculated to obtain a second character sequence as the algorithm key, and the second sub-character sequence is used as the original password, so that the original password and the algorithm key can be obtained through a complex calculation process, which increases the security of the debug port target password. In addition, the UID is transformed into a first character sequence of a preset length by an irreversible first hash algorithm, which can ensure the security of the calculation process. Furthermore, in the process of obtaining the second character sequence, the initial key and the first sub-character sequence are first XORed, which can increase the computational complexity and thus increase the difficulty of cracking the algorithm key, thereby ensuring the security of the algorithm key.
[0100] Figure 3 The schematic diagram of the structure of a debug port security access device provided by an embodiment of the present application is used to execute the debug port security access method provided by the above embodiment, and has the corresponding functions and beneficial effects of the execution method. Currently, the debug port security access device is applied to vehicle-mounted electronic equipment, and the vehicle-mounted electronic equipment includes at least one debug port. Figure 3 As shown, the debug port security access device includes: an algorithm calling unit 301, a password determining unit 302 and an access allowing unit 303.
[0101] Among them, the algorithm calling unit 301 is used to call a preset encryption algorithm when receiving the debug port access password input by the user; the password determination unit 302 is used to encrypt the original password using the algorithm key through the encryption algorithm to obtain the debug port target password, and the algorithm key and the original password are both obtained by calculating the UID of the vehicle-mounted electronic device; the access permission unit 303 is used to allow the user to access the debug port when it is confirmed that the debug port access password and the debug port target password are consistent.
[0102] In one embodiment of the present application, the debug port security access device further includes: an access disallowing unit, a times counting unit, and an input setting unit. The access disallowing unit is used to disallow the user to access the debug port when it is confirmed that the debug port access password and the debug port target password are inconsistent; the times counting unit is used to count the times the debug port access password is input; and the input setting unit is used to continue to receive the debug port access password re-entered by the user when the input times do not reach a preset times threshold, and prohibit the user from re-entering the debug port access password when the input times reach the preset times threshold.
[0103] In one embodiment of the present application, the debug port security access device further includes: a key receiving unit, a UID reading unit, a password calculation unit, and a password storage unit. Among them, the key receiving unit is used to receive an initial key when the vehicle-mounted electronic device is powered on for the first time, and the initial key has the same length as the debug port target password; the UID reading unit is used to read the UID of the vehicle-mounted electronic device; the password calculation unit is used to perform password generation calculation on the UID and the initial key using a preset password generation rule to obtain the algorithm key of the encryption algorithm and the original password; the password storage unit is used to store the algorithm key and the original password.
[0104] In one embodiment of the present application, the password calculation unit includes: a length conversion subunit, used to convert the UID into a first character sequence of a preset length; a sequence splitting subunit, used to split the first character sequence into a first sub-character sequence and a second sub-character sequence; an encryption calculation subunit, used to perform encryption calculation on the first sub-character sequence and the initial key to obtain a second character sequence that meets the key length requirement of the encryption algorithm; a password determination subunit, used to use the second character sequence as the algorithm key of the encryption algorithm and the second sub-character sequence as the original password.
[0105] In one embodiment of the present application, the length conversion subunit is specifically used to: use an irreversible first hash algorithm to perform a hash calculation on the UID to obtain a first character sequence of a preset length.
[0106] In one embodiment of the present application, the first sub-character sequence and the initial key have the same length, and the encryption calculation subunit includes: an XOR calculation subunit, used to perform an XOR calculation on the initial key and the first sub-character sequence to obtain a third character sequence; and a hash calculation subunit, used to perform a hash calculation on the third character sequence using a second hash algorithm to obtain a second character sequence that meets the key length requirement of the encryption algorithm.
[0107] In one embodiment of the present application, the algorithm key is stored in a hardware security module of the in-vehicle electronic device for use by the encryption algorithm.
[0108] It is worth noting that in the embodiment of the above-mentioned device, the units included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0109] Figure 4 This is a schematic diagram of the structure of a vehicle-mounted electronic device provided by an embodiment of the present application. The device is used to execute the debug port security access method provided by the above embodiment and has the corresponding functions and beneficial effects of the execution method. Figure 4 As shown, the vehicle-mounted electronic device includes a processor 401, a memory 402, and a debug port 403. The figure takes a processor 401 and a debug port 403 as an example. The memory 402 is used to store one or more programs; when the one or more programs are executed by the one or more processors 401, the one or more processors implement the debug port security access method as in the aforementioned embodiment. In addition, the vehicle-mounted electronic device also includes an HSM. For the relevant description of the vehicle-mounted electronic device, reference can be made to the relevant description of the vehicle-mounted electronic device in the aforementioned embodiment.
[0110] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is used to perform relevant operations in the debug port security access method provided in any embodiment of the present application.
[0111] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0112] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0113] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A debug port security access method, characterized in that: Applied to an in-vehicle electronic device, the in-vehicle electronic device includes at least one debugging port, and the debugging port security access method includes: When receiving the debug port access password entered by the user, the pre-set encryption algorithm is called; The original password is encrypted by using the encryption algorithm and the algorithm key to obtain the debug port target password, wherein the algorithm key and the original password are both obtained by calculating the unique identifier UID of the vehicle-mounted electronic device; When it is confirmed that the debug port access password is consistent with the debug port target password, the user is allowed to access the debug port.
2. The debug port security access method according to claim 1, characterized in that: Also includes: When it is confirmed that the debug port access password and the debug port target password are inconsistent, not allowing the user to access the debug port; Counting the number of times the debug port access password is entered; When the input times do not reach the preset times threshold, continue to receive the debug port access password re-entered by the user; when the input times reach the preset times threshold, prohibit the user from re-entering the debug port access password.
3. The debug port security access method according to claim 1, characterized in that: Also includes: When the vehicle-mounted electronic device is powered on for the first time, receiving an initial key, the initial key having the same length as the debug port target password; Reading the UID of the vehicle-mounted electronic device; Using a preset password generation rule to perform a password generation calculation on the UID and the initial key to obtain the algorithm key of the encryption algorithm and the original password; The algorithm key and the original password are saved.
4. The debug port security access method according to claim 3, characterized in that: The using a preset password generation rule to perform a password generation calculation on the UID and the initial key to obtain the algorithm key of the encryption algorithm and the original password includes: Converting the UID into a first character sequence of a preset length; Splitting the first character sequence into a first sub-character sequence and a second sub-character sequence; Performing encryption calculation on the first sub-character sequence and the initial key to obtain a second character sequence that meets the key length requirement of the encryption algorithm; The second character sequence is used as the algorithm key of the encryption algorithm, and the second sub-character sequence is used as the original password.
5. The debug port security access method according to claim 4, characterized in that: The step of converting the UID into a first character sequence of a preset length comprises: The UID is hashed using a first irreversible hash algorithm to obtain a first character sequence of a preset length.
6. The debug port security access method according to claim 4, characterized in that: The first sub-character sequence has the same length as the initial key, The step of performing encryption calculation on the first sub-character sequence and the initial key to obtain a second character sequence that meets the key length requirement of the encryption algorithm includes: Performing an XOR calculation on the initial key and the first sub-character sequence to obtain a third character sequence; The third character sequence is hashed using a second hash algorithm to obtain a second character sequence that meets the key length requirement of the encryption algorithm.
7. The debug port security access method according to claim 1 or 3, characterized in that: The algorithm key is stored in the hardware security module of the vehicle-mounted electronic device for use by the encryption algorithm.
8. A debug port security access device, characterized in that: Applied to an in-vehicle electronic device, the in-vehicle electronic device includes at least one debugging port, and the debugging port security access device includes: An algorithm calling unit, used to call a preset encryption algorithm upon receiving a debug port access password input by a user; A password determination unit, used to encrypt the original password using the algorithm key through the encryption algorithm to obtain a debug port target password, wherein the algorithm key and the original password are both obtained by calculating the unique identifier UID of the vehicle-mounted electronic device; The access permission unit is used to allow the user to access the debug port when confirming that the debug port access password is consistent with the debug port target password.
9. A vehicle-mounted electronic device, characterized in that: include: at least one debug port, one or more processors and memory, The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the debug port security access method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the debug port security access method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Debugging method and device, electronic equipment and vehicle
CN120915610A
Debugging method and device, electronic equipment and vehicle
CN120915610B