Electronic control apparatus and program for updating cryptographic key
The electronic control device and program address unauthorized encryption key updates by disabling the update function upon failure limits being met, ensuring security and reducing unnecessary replacements by controlling power supply and resetting failure counts.
Patent Information
- Application Number
- JP2023067154
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-04-17
AI Technical Summary
Unauthorized updates of encryption keys due to hacking or communication failures can lead to unnecessary replacement of electronic control units, as existing methods to prevent unauthorized updates by setting an upper limit on decryption failures may result in false positives.
An electronic control device and program that count decryption failures and disable the encryption key update function when the failure limit is exceeded, followed by stopping power supply to the unit and enabling the function upon restart, thereby preventing unauthorized updates and reducing unnecessary replacements.
The solution effectively prevents unauthorized encryption key updates and reduces the frequency of electronic control unit replacements while maintaining security, by disabling the update function only when necessary and resetting failure counts upon restart.
Smart Images

Figure 2024153335000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an electronic control unit mounted on a vehicle and an encryption key updating program. [Background technology]
[0002] Patent Document 1 discloses an in-vehicle network system including one first node and multiple second nodes. In this system, the first node transmits an encryption key for performing message authentication between nodes in an encrypted state to the multiple second nodes. The first node also transmits verification data to the multiple nodes for verifying whether the encrypted encryption key has been correctly decrypted.
[0003] The second node executes a process of decrypting the encryption key received from the first node. Furthermore, when the second node receives the verification data, it verifies whether the decryption of the encryption key was successful or unsuccessful based on the decrypted encryption key data and the verification data. If the second node succeeds in decrypting the encryption key, it updates the encryption key by storing the encryption key. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2018-121220 A Summary of the Invention [Problem to be solved by the invention]
[0005] An attempt may be made to illegally update the encryption key through external hacking. In hacking, attempts to update the encryption key may fail repeatedly until the encryption key is successfully decrypted. One method to prevent unauthorized updates of the encryption key through hacking is to set an upper limit on the number of failures that can occur before an encryption key update fails. With this method, if the number of failures exceeds the upper limit, the encryption key update function in the second node can be disabled. In this case, the second node must be replaced in order to update the encryption key, thereby preventing unauthorized updates of the encryption key through hacking.
[0006] Even if communication problems or procedural errors occur between nodes, decryption of the encryption key may fail. If an upper limit is set for the number of failures as described above, the number of failures may exceed the upper limit due to multiple failures in decryption of the encryption key caused by communication problems or procedural errors. In this case, even though there was no attempt to update the encryption key by hacking, it will be necessary to replace the second node in order to update the encryption key. [Means for solving the problem]
[0007] The electronic control device for solving the above problem is a device mounted in a vehicle and configured to be able to communicate with other electronic control devices via an in-vehicle network. The electronic control device includes a processing circuit. The processing circuit counts a failure count, which is the number of times an attempt to update an encryption key for performing message authentication with the other electronic control devices fails, disables an update function of the encryption key when the failure count exceeds an upper limit, and enables the update function when power supply from a power source of the vehicle to the electronic control device is stopped with the update function disabled and power supply from the power source to the electronic control device is started thereafter.
[0008] The encryption key updating program for solving the above problem is a program executed by an electronic control unit mounted on a vehicle. The electronic control unit is configured to be able to communicate with other electronic control units via an in-vehicle network. The encryption key updating program causes the electronic control unit to count a failure count, which is the number of times an encryption key for performing message authentication with the other electronic control units, to disable an encryption key updating function when the failure count exceeds an upper limit of the failure count, and to enable the updating function when power supply from a power source of the vehicle to the electronic control unit is stopped with the updating function disabled and power supply from the power source to the electronic control unit is started thereafter. Effect of the Invention
[0009] The above-described electronic control unit and encryption key update program has the effect of suppressing a decrease in security of the electronic control unit while suppressing an increase in the number of times the electronic control unit needs to be replaced. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a schematic diagram showing a vehicle equipped with an electronic control device according to an embodiment. [Diagram 2] FIG. 2 is a flowchart showing a series of processes executed by a master ECU and a slave ECU which are examples of electronic control devices according to the embodiment. [Diagram 3] FIG. 3 is a flowchart showing a series of processes executed by a master ECU which is an example of an electronic control device according to the embodiment. [Figure 4] FIG. 4 is a flowchart showing a series of processes executed by a slave ECU which is an example of an electronic control device according to the embodiment. [Diagram 5] FIG. 5 is a sequence diagram showing an example of the process flow when updating of the encryption key fails. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] An embodiment of an electronic control unit and an encryption key updating program will be described below with reference to Figs. 1 to 5. Hereinafter, the electronic control unit will be referred to as "ECU." "ECU" is an abbreviation of "Electronic Control Unit." The "encryption key" referred to here is a key for performing message authentication between multiple ECUs.
[0012] As shown in Fig. 1, a vehicle 10 includes a power source 13 and multiple ECUs. The multiple ECUs correspond to ECUs mounted on the vehicle 10. The ECUs operate when power is supplied from the power source 13. On the other hand, when the power supply from the power source 13 is stopped, the operation of the ECUs stops. The multiple ECUs include a master ECU 20 and multiple slave ECUs 30.
[0013] The master ECU 20 can communicate with a plurality of slave ECUs 30 via an in-vehicle network 12. An example of the in-vehicle network 12 is the CAN. "CAN" is an abbreviation for "Controller Area Network."
[0014] The master ECU 20 includes a processing circuit 21. For example, the processing circuit 21 includes a CPU 22, a first storage device 23, and a second storage device 24. For example, the first storage device 23 is a non-volatile memory, and the second storage device 24 is a volatile memory. The first storage device 23 stores software executed by the CPU 22. Data transmitted and received via the in-vehicle network 12 is encrypted. Therefore, when the processing circuit 21 of the master ECU 20 receives data from the slave ECU 30 via the in-vehicle network 12, the processing circuit 21 decrypts the data by using an encryption key stored therein.
[0015] The plurality of slave ECUs 30 each include a processing circuit 31. For example, the processing circuit 31 has a CPU 32 and a storage device 33. The storage device 33 is a non-volatile memory. Various software executed by the CPU 32 is stored in the storage device 33. As described above, the data transmitted and received via the in-vehicle network 12 is encrypted. Therefore, when the processing circuit 31 of the slave ECU 30 receives data from another ECU via the in-vehicle network 12, it decrypts the data by using the encryption key stored by itself.
[0016] Referring to FIG. 2, a series of processes executed in both the master ECU 20 and the slave ECU 30 when power supply from the power supply 13 is started will be described. In the master ECU 20, the processing circuit 21 executes a series of processes by the CPU 22 executing the software of the first storage device 23. In the slave ECU 30, the processing circuit 31 executes a series of processes by the CPU 32 executing the software of the storage device 33.
[0017] In step S11, the processing circuits 21 and 31 determine whether the update function of their own encryption key is disabled. If the update function is disabled (S11: YES), the processing circuits 21 and 31 transfer the process to step S13. If the update function is enabled (S11: NO), the processing circuits 21 and 31 end the series of processes.
[0018] In step S13, the processing circuits 21 and 31 enable their own update function. That is, the process of step S13 corresponds to a process of enabling the update function when the power supply to the ECU from the power supply 13 is stopped with the update function disabled and then the power supply to the ECU from the power supply 13 is started. In the next step S15, the processing circuits 21 and 31 reset the failure count CNT managed by themselves to 0 (zero). Although it will be described in detail later, the failure count CNT is the number of times the decryption of the encryption key has failed. Thereafter, the processing circuits 21 and 31 end the series of processes.
[0019] A series of processes executed by the master ECU 20 when an encryption key update is requested will be described with reference to Fig. 3. That is, the CPU 22 executes the software in the first storage device 23, and the processing circuit 21 executes the series of processes.
[0020] In step S21, the processing circuit 21 determines whether or not the update function of its own encryption key is enabled. If the update function is enabled (S21: YES), the processing circuit 21 proceeds to step S23. On the other hand, if the update function is disabled (S21: NO), the processing circuit 21 ends the series of processes.
[0021] In step S23, the processing circuit 21 creates a new encryption key and encrypts the encryption key. Then, the processing circuit 21 stores the new encryption key. In the next step S25, the processing circuit 21 creates verification data. The verification data is data used when the slave ECU 30 verifies whether the decryption of the encryption key has succeeded or failed.
[0022] In the next step S27, the processing circuit 21 transmits the encrypted encryption key data to the slave ECUs 30. In the next step S29, the processing circuit 21 transmits the verification data to the slave ECUs 30. In the next step S31, the processing circuit 21 judges whether or not the time elapsed since the time of transmitting the verification data reaches a predetermined waiting time. If the elapsed time reaches the waiting time, the processing circuit 21 regards that the decryption of the encryption key in the slave ECU 30 and the verification of whether or not the decryption of the encryption key has been successful have been completed. Therefore, if the elapsed time has not reached the waiting time (S31: NO), the processing circuit 21 repeats the judgment of step S31 until the elapsed time reaches the waiting time. On the other hand, if the elapsed time has reached the waiting time (S31: YES), the processing circuit 21 shifts the process to step S33.
[0023] In step S33, the processing circuit 21 inquires of the multiple slave ECUs 30 about the verification results. In the following step S35, the processing circuit 21 judges whether or not information on the verification results of the multiple slave ECUs 30 has been received. If the processing circuit 21 has not received information on the verification results from at least one of the multiple slave ECUs 30 (S35: NO), the processing circuit 21 repeats the judgment of step S35. On the other hand, if the processing circuit 21 has received information on the verification results from the multiple slave ECUs 30 (S35: YES), the processing circuit 21 transitions to step S37.
[0024] In step S37, the processing circuit 21 determines whether or not there is a slave ECU 30 that has failed to decrypt the encryption key among the multiple slave ECUs 30. A slave ECU 30 that has failed to decrypt the encryption key corresponds to a "device that has failed to update the encryption key." If there is a slave ECU 30 that has failed to decrypt (S37: YES), the processing circuit 21 shifts the process to step S39. On the other hand, if there is no slave ECU 30 that has failed to decrypt (S37: NO), the processing circuit 21 ends the series of processes.
[0025] In step S39, the processing circuit 21 determines whether or not there is a slave ECU 30 that has successfully decrypted the encryption key among the multiple slave ECUs 30. The slave ECU 30 that has successfully decrypted the encryption key corresponds to the "device that has successfully updated the encryption key." If there is a slave ECU 30 that has successfully decrypted the encryption key (S39: YES), the processing circuit 21 shifts the process to step S41. On the other hand, if there is no slave ECU 30 that has successfully decrypted the encryption key (S39: NO), the processing circuit 21 shifts the process to step S43.
[0026] In step S41, the processing circuit 21 requests the slave ECU 30 that has succeeded in decrypting the encryption key to update the failure count CNT. Then, the processing circuit 21 shifts the process to step S43.
[0027] In step S43, the processing circuit 21 updates the number of failures CNT managed by itself so that the number of failures CNT is increased by 1. That is, the process of step S43 corresponds to the process of counting the number of failures CNT, which is the number of times an encryption key update has failed.
[0028] In the next step S45, the processing circuit 21 judges whether the failure count CNT managed by itself has exceeded the count judgment value CNTth. The count judgment value CNTth is the upper limit of the failure count CNT. For example, an integer equal to or greater than 2 is set as the count judgment value CNTth. If the failure count CNT has exceeded the count judgment value CNTth (S45: YES), the processing circuit 21 shifts the process to step S47. On the other hand, if the failure count CNT is equal to or less than the count judgment value CNTth (S45: NO), the processing circuit 21 ends the series of processes.
[0029] In step S47, the processing circuit 21 disables the update function of its own encryption key. That is, the process of step S47 corresponds to the process of disabling the update function of the encryption key when the failure count CNT exceeds the upper limit of the failure count CNT. After that, the processing circuit 21 ends the series of processes.
[0030] A series of processes executed by the slave ECU 30 when an encryption key update is requested will be described with reference to Fig. 4. In the slave ECU 30, the CPU 32 executes software in the storage device 33, and the processing circuit 31 executes the series of processes.
[0031] In step S61, the processing circuit 31 determines whether or not its encryption key update function is enabled. If the update function is enabled (S61: YES), the processing circuit 31 proceeds to step S63. On the other hand, if the update function is disabled (S61: NO), the processing circuit 31 ends the series of processes.
[0032] In step S63, the processing circuit 31 determines whether or not new encrypted encryption key data has been received from the master ECU 20. If new encryption key data has been received (S63: YES), the processing circuit 31 proceeds to step S65. On the other hand, if new encryption key data has not been received (S63: NO), the processing circuit 31 repeats the determination of step S63.
[0033] In step S65, the processing circuit 31 decrypts the new encryption key that is in an encrypted state. At this time, the processing circuit 31 decrypts the new encryption key using the encryption key before the update. In the following step S67, the processing circuit 31 judges whether or not verification data has been received from the master ECU 20. If the processing circuit 31 has received the verification data (S67: YES), the processing circuit 31 shifts the process to step S69. On the other hand, if the processing circuit 31 has not received the verification data (S67: NO), the processing circuit 31 repeats the judgment of step S67.
[0034] In step S69, the processing circuit 31 uses the verification data to verify whether the decryption of the new encryption key has been successful. In the following step S71, the processing circuit 31 determines whether the decryption of the encryption key has failed based on the verification result. If the decryption has failed (S71: YES), the processing circuit 31 shifts the process to step S73. On the other hand, if the decryption has been successful (S71: NO), the processing circuit 31 shifts the process to step S79.
[0035] In step S73, the processing circuit 31 updates the failure count CNT so that the failure count CNT managed by itself is increased by 1. In the following step S75, the processing circuit 31 judges whether the failure count CNT has exceeded the count judgment value CNTth. If the failure count CNT has exceeded the count judgment value CNTth (S75: YES), the processing circuit 31 shifts the process to step S77. On the other hand, if the failure count CNT is equal to or less than the count judgment value CNTth (S75: NO), the processing circuit 31 shifts the process to step S79.
[0036] In step S77, the processing circuit 31 disables the update function. The process of step S77 corresponds to the process of disabling the update function of the encryption key when the failure count CNT exceeds the upper limit of the failure count CNT. Then, the processing circuit 31 shifts the process to step S79.
[0037] In step S79, the processing circuit 31 judges whether or not an inquiry regarding the verification result has been received from the master ECU 20. If the processing circuit 31 has received an inquiry (S79: YES), the processing circuit 31 shifts the process to step S81. On the other hand, if the processing circuit 31 has not received an inquiry (S79: NO), the processing circuit 31 repeats the judgment of step S79.
[0038] In step S81, the processing circuit 31 transmits information about the verification result to the master ECU 20. In the following step S83, the processing circuit 31 judges whether or not a request to update the number of failures CNT has been received from the master ECU 20. If the processing circuit 31 has received the request (S83: YES), the processing circuit 31 shifts the processing to step S85. On the other hand, if the processing circuit 31 has not received the request (S83: NO), the processing circuit 31 ends the series of processes.
[0039] In step S85, the processing circuit 31 updates the failure count CNT in the same manner as in step S73. That is, the process of step S85 corresponds to the process of counting the failure count CNT, which is the number of times that updating of the encryption key has failed. In the next step S87, the processing circuit 31 determines whether the failure count CNT has exceeded the count judgment value CNTth. If the failure count CNT has exceeded the count judgment value CNTth (S87: YES), the processing circuit 31 shifts the process to step S89. On the other hand, if the failure count CNT is equal to or less than the count judgment value CNTth (S87: NO), the processing circuit 31 ends the series of processes.
[0040] In step S89, the processing circuit 31 disables the update function. The process of step S89 corresponds to the process of disabling the update function of the encryption key when the failure count CNT exceeds the upper limit of the failure count CNT. After that, the processing circuit 31 ends the series of processes.
[0041] <Actions and Effects of the Present Embodiment> The operation of updating the encryption key will be described with reference to Fig. 5. For ease of understanding, it is assumed here that the control system of the vehicle 10 includes a first slave ECU 30 and a second slave ECU 30 as the slave ECUs 30.
[0042] A tool is communicatively connected to the control system. Then, the tool requests the master ECU 20 and the multiple slave ECUs 30 to update the encryption key (S100). Then, in the master ECU 20, a new encryption key is created and the encryption key is encrypted (S23). Next, verification data is generated (S25). Then, the master ECU 20 transmits data of the new encryption key to the multiple slave ECUs 30 (S27). Thereafter, the master ECU 20 transmits the verification data to the multiple slave ECUs 30 (S29).
[0043] When each of the slave ECUs 30 receives new encryption key data, the encryption key is decrypted (S65). When the verification data is received, the slave ECUs 30 verify whether the decryption of the encryption key has succeeded or failed (S69). In the example shown in Fig. 5, the first slave ECU 30 fails to decrypt the encryption key, whereas the second slave ECU 30 succeeds in decrypting the encryption key.
[0044] Therefore, in the first slave ECU 30, the failure count CNT is updated (S73). Then, as a result of comparing the failure count CNT with the count judgment value CNTth, if the failure count CNT exceeds the count judgment value CNTth (S75: YES), the encryption key update function of the first slave ECU 30 is disabled (S77).
[0045] The master ECU 20 transmits an inquiry about the verification result to the multiple slave ECUs 30 (S33). Then, the first slave ECU 30 transmits to the master ECU 20 information about the verification result that the encryption key has been unsuccessfully decrypted (S81). Meanwhile, the second slave ECU 30 transmits to the master ECU 20 information about the verification result that the encryption key has been successfully decrypted (S81). When the master ECU 20 receives information about the verification result from the multiple slave ECUs 30 (S35: YES), it transmits an update of the number of failures CNT to the second slave ECU 30 (S41).
[0046] Then, the failure count CNT is updated in the master ECU 20 and the second slave ECU 30 (S43, S85). Then, as a result of comparing the failure count CNT with the count judgment value CNTth, if the failure count CNT exceeds the count judgment value CNTth (S45: YES / S87: YES), the encryption key update function is disabled (S47, S89).
[0047] The power supply from the power source 13 to the master ECU 20 and the multiple slave ECUs 30 is stopped. After that, the power supply from the power source 13 to the master ECU 20 and the multiple slave ECUs 30 is started. Then, the encryption key update function is enabled in each of the master ECU 20 and the multiple slave ECUs 30 (S13). Furthermore, the failure count CNT is reset to 0 (zero).
[0048] In this embodiment, the following effects can be obtained. (1) In both the master ECU 20 and the multiple slave ECUs 30, when the failure count CNT exceeds the count judgment value CNTth, the encryption key update function is disabled. This prevents the encryption key from being illegally updated by external hacking. In addition, when power supply to the master ECU 20 and the multiple slave ECUs 30 is stopped with the update function disabled and power supply to the master ECU 20 and the multiple slave ECUs 30 is then started, the update function is enabled again in the master ECU 20 and the multiple slave ECUs 30. When the update function is enabled in this way, the encryption key can be updated. That is, it is not necessary to replace the master ECU 20 and the multiple slave ECUs 30 in order to update the encryption key. Therefore, in the master ECU 20 and the multiple slave ECUs 30, it is possible to suppress an increase in the number of ECU replacements while suppressing a decrease in security.
[0049] (2) In the master ECU 20 and the slave ECUs 30, when power supply to the master ECU 20 and the slave ECUs 30 is stopped with the update function disabled and power supply to the master ECU 20 and the slave ECUs 30 is then started, the failure count CNT is reset to 0 (zero). This makes it possible to prevent the update function from being disabled again in the master ECU 20 and the slave ECUs 30 due to a single failure in decrypting the encryption key.
[0050] (3) If decryption of the encryption key fails in only some of the slave ECUs 30, the number of failures CNT is updated in the slave ECUs 30 and the master ECU 20 that succeeded in decryption of the encryption key. This allows the master ECU 20 and the slave ECUs 30 to disable the update function at their own discretion.
[0051] <Example of change> The above embodiment can be modified as follows: The above embodiment and the following modifications can be combined with each other to the extent that no technical contradiction occurs.
[0052] When the encryption key update fails in some of the slave ECUs 30, the processing circuit 21 of the master ECU 20 may not request the slave ECUs 30 that have succeeded in updating the encryption key to update the failure count CNT. In this case, when the failure count CNT managed by the processing circuit 21 itself exceeds the count judgment value CNTth, the processing circuit 21 may not only disable its own update function but also instruct the slave ECUs 30 to disable their update functions.
[0053] The processing circuit 21 of the master ECU 20 may not need to update the failure count CNT managed by itself when the encryption key update fails in at least one of the multiple slave ECUs 30. In this case, if the update function is disabled in at least one of the multiple slave ECUs 30, the processing circuit 21 of the master ECU 20 may disable its own update function when it acquires information that there is a slave ECU 30 whose update function has been disabled.
[0054] When power supply to the master ECU 20 and the multiple slave ECUs 30 is stopped with the update function disabled, and then power supply to the master ECU 20 and the multiple slave ECUs 30 is started again, the processing circuits 21, 31 do not need to reset the number of failures CNT to 0 (zero).
[0055] An ECU that transmits and receives data from a data center installed outside the vehicle may function as a master ECU. The processing circuits 21 and 31 are not limited to those having a CPU and a ROM and executing software processing. That is, the processing circuits 21 and 31 may have any one of the following configurations (a), (b), and (c).
[0056] (a) The processing circuitry 21, 31 includes one or more processors that execute various processes according to a computer program. The processor includes a CPU and memory such as RAM and ROM. The memory stores program codes or instructions configured to cause the CPU to execute processes. The memory, i.e., computer-readable media, includes any available media that can be accessed by a general-purpose or special-purpose computer.
[0057] (b) The processing circuits 21 and 31 each include one or more dedicated hardware circuits for executing various processes. Examples of the dedicated hardware circuits include application specific integrated circuits, i.e., ASIC and FPGA. ASIC is an abbreviation for "Application Specific Integrated Circuit" and "FPGA" is an abbreviation for "Field Programmable Gate Array."
[0058] (c) The processing circuits 21 and 31 each include a processor that executes some of the various processes in accordance with a computer program, and a dedicated hardware circuit that executes the remaining processes among the various processes. [Explanation of symbols]
[0059] 10...vehicle, 12...in-vehicle network, 13...power supply, 20...master ECU, 21...processing circuit, 30...slave ECU, 31...processing circuit.
Claims
1. An electronic control device that is mounted on a vehicle and is configured to be able to communicate with other electronic control devices via an in-vehicle network, A processing circuit is provided, The processing circuitry includes: counting the number of failures, which is the number of times that an encryption key for performing message authentication with the other electronic control device fails to be updated; disabling the encryption key update function when the number of failures exceeds an upper limit of the number of failures; When power supply from a power source of the vehicle to the electronic control device is stopped in a state in which the update function is disabled, and when power supply from the power source to the electronic control device is subsequently started, the update function is enabled. Electronic control unit.
2. The processing circuit executes resetting the number of failures to 0 (zero) when power supply from the power source to the electronic control device is stopped with the update function disabled and then power supply from the power source to the electronic control device is started. The electronic control device according to claim 1 .
3. The processing circuitry includes: transmitting data of the encryption key to the other electronic control devices to instruct the other electronic control devices to update the encryption key; If there is a device among the plurality of other electronic control devices that has failed in updating the encryption key, updating the number of failures managed by the device itself. The electronic control device according to claim 1 or 2.
4. When the plurality of other electronic control devices include both a device in which the encryption key has failed to be updated and a device in which the encryption key has been successfully updated, the processing circuit requests the device in which the encryption key has been successfully updated to update the number of failures managed by that device. The electronic control device according to claim 3.
5. An encryption key updating program executed by an electronic control device mounted on a vehicle, comprising: The electronic control unit is configured to be able to communicate with other electronic control units via an in-vehicle network, counting the number of failures, which is the number of times that an encryption key for performing message authentication with the other electronic control device fails to be updated; disabling the encryption key update function when the number of failures exceeds an upper limit of the number of failures; When power supply from a power source of the vehicle to the electronic control device is stopped with the update function disabled and when power supply from the power source to the electronic control device is started thereafter, the electronic control device is caused to enable the update function. Cryptographic key update program.
Citation Information
Patent Citations
Communication device and communication system
JP2018061118A
Distribution system, data security device, distribution method, and computer program
JP2018098760A
In-vehicle network system
JP2018121220A
