This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2014-266836, filed on Dec. 27, 2014, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a control of a communication among communication devices.
A network technique called a CAN (Controller Area Network) is sometimes used to transmit and receive data and control information between devices that are used in an in-vehicle network of an automobile, factory automation or the like. A system using a CAN includes a plurality of ECUs (Electronic Control Units). ECUs communicate with each other by transmitting and receiving a frame. In a CAN, a frame used for a communication includes identification information (ID) used to identify the frame. Moreover, each of the ECUs prestores the ID of a received frame. A frame is broadcast, and each of the ECUs receives a frame including an ID that is set to be received by an ECU. However, each of the ECUs ignores a frame including an ID that is set not to be received.
An association between an ID used in a frame and an ECU is not entirely standardized, and which ECU is set to receive which ID is not disclosed. However, an attacker can make an association between a transmitted frame and a process executed in a system by intercepting frames transmitted and received in a CAN, and by observing processes executed in the system using the CAN. The attacker can store frames transmitted in the past and the obtained association between frames and processes executed in the system. The attacker can transmit, to the network, a frame associated with a behavior desired to be invoked for the system using the CAN. Then, the frame transmitted from the attacker causes an automobile or an automation factory to execute an improper process. In the following description, such an attack is sometimes referred to as a “replay attack” or a “retransmission attack”.
An authentication method using a message authentication code (MAC) generated from data, an ID and a counter value corresponding to the ID is proposed to prevent a replay attack. Here, the counter value is a value obtained by counting the number of times that a message is transmitted for each ID of a frame in each ECU. A device at a transmission source transmits, to a device at a destination, a main message including data to be transmitted, and a MAC message for making a notification of a MAC generated by using the main message.
The device that has received the main message and the MAC message generates a MAC from the main message, and determines whether the main message has validity by judging whether the generated MAC and a MAC within the MAC message match.
Documents such as Japanese Laid-open Patent Publication No. 2013-98719 and the like are known.
When each device within a CAN system verifies a MAC each time the device has received a frame including data, all the devices within the system generate a counter value, calculate a MAC, and make a comparison between a MAC calculated from the frame and a MAC for which notification has been made. Accordingly, loads imposed on the devices on a reception side increase.
According to an aspect of the embodiments, a communication control apparatus includes a receiver and a processor. The receiver receives, from a first node, data including first identification information or second identification information. The processor generates a first authentication code by using first data when the receiver has received the first data including the first identification information. The receiver receives, from the first node, second data including the second identification information and a second authentication code that the first node has generated by using the first data. The processor decides whether to make a second node abort a processing of data reported using the first identification information, on the basis of a result of a comparison between the first authentication code and the second authentication code.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
The transmission node 40 uses a first ID when the transmission node 40 transmits data addressed to the reception node 60, and also uses a second ID that is not received by the reception node 60 when the transmission node 40 communicates with the communication control apparatus 10. The communication control apparatus 10 recognizes both the first ID and the second ID as reception targets. In the example illustrated in
In step S1, the transmission node 40 generates a data frame including data A, the notification of which is made to the reception node 60. The data frame is assumed to be identified on the basis of the first ID (=123).
In step S2, the transmission node 40 transmits the data frame generated in step S1. Since the data frame is broadcast, the frame reaches both the reception node 60 and the communication control apparatus 10. Because the reception node 60 recognizes the ID=123 as a reception target, the reception node 60 receives the data frame to obtain the data A. Since the communication control apparatus 10 also recognizes the ID=123 as a reception target, the communication control apparatus 10 receives the data frame to obtain the data A.
In step S3, the communication control apparatus 10 calculates a MAC from the data A.
As indicated by step S4, the transmission node 40 also calculates a MAC by using the transmitted data A.
In step S5, the transmission node 40 broadcasts data (data B) including the result of the MAC calculation by using the second ID (=777). Since the second ID is not set as a reception target in the reception node 60, the reception node 60 discards the frame including the data B without receiving the frame. In contrast, since the second ID is set as a reception target in the communication control apparatus 10, the communication control apparatus 10 receives the frame including the data B.
In step S6, the communication control apparatus 10 extracts, from the data B, the MAC 2 calculated in the transmission node 40. The communication control apparatus 10 makes a comparison between the MAC 1 calculated in step S3 and the extracted MAC 2. When the MAC 1 and the MAC 2 match, the communication control apparatus 10 determines that a replay attack has not occurred, and terminates the process (“YES” in step S6).
In contrast, when the MAC 1 and the MAC 2 do not match, the communication control apparatus 10 determines that the replay attack has occurred (“NO” in step S6, step S7). Accordingly, the communication control apparatus 10 issues, to the reception node 60, a request to abort the process of a frame using the ID=123 (step S8).
As described above, with the control method explained with reference to
The system where the communication control apparatus 10 generates a MAC and detects a replay attack also has an advantage such that a reception node 60 disabled to generate a MAC is available. A device included in a currently popular system does not include processing circuitry and the like for generating a MAC, or for detecting a reply attack. With the method according to the embodiment, the communication control device 10 can detect a replay attack as a replacement for an individual reception node 60. As a result, a device that receives data can prevent a replay attack without executing a process for making a comparison between MACs.
<Examples of a Device Configuration and a Frame Format>
The transmitter 12 transmits a frame to a different device within the CAN network as needed. The receiver 13 receives a frame including an ID set to be received by the communication control apparatus 10 among frames transmitted from different devices within the CAN network. The receiver 13 outputs the received data frame to the MAC generator 21. In the meantime, the receiver 13 outputs, to the comparator 22, a frame (notification frame) used to make a notification of the MAC generated in the transmission node 40. The counter 14 generates a counter value used to generate a MAC. The counter value is stored in the storage unit 30 as needed.
The MAC generator 21 generates a MAC by using data within the frame input from the receiver 13, and the counter value. A MAC generation method will be described later. The MAC generator 21 stores the generated MAC in the MAC table 31 in association with the ID within the frame. The comparator 22 determines whether a replay attack has occurred by making a comparison between the MAC within the frame input from the receiver 13 and MAC stored in the MAC table 31. When the MACs to be compared do not match, the comparator 22 determines that the replay attack has occurred.
The transmitter 42 transmits a frame input from the data frame generator 52 or the notification frame generator 53 to a different device within the CAN network. The receiver 43 receives a frame from a different device within the CAN network as needed. The counter 44 generates a counter value used to generate a MAC. The counter value is stored in the storage unit 45 as needed.
The data frame generator 52 generates a data frame including data for which the notification is made to the reception node 60. The MAC generator 51 calculates a MAC by using the data within the data frame. The notification frame generator 53 generates a notification frame for making a notification of the MAC calculated by the MAC generator 51. Note that an ID not to be received by the reception node 60 is set in the notification frame.
The CAN transceiver 101 executes, as needed, a process, such as an adjustment of a bus voltage or the like, by which the ECU 100 communicates with a different device within the CAN network. The CAN controller 102 extracts data by executing processes such as CRC (Cyclic Redundancy Check), bit stuffing and the like for the received frame. The CAN controller 102 outputs the data to the processor 104. The processor 104 is an arbitrary processing circuit. The processor executes a process by reading a program stored in the memory 105.
In the communication control apparatus 10, the transmitter/receiver 11 is implemented by the CAN transceiver 101 and the CAN controller 102. The processor 104 operates as the counter 14 and the controller 20. The memory 105 operates as the storage unit 30.
In the transmission node 40, the CAN transceiver 101 and the CAN controller 102 implement the transmitter/receiver 41. The processor 104 operates as the counter 44 and the frame processing unit 50. The memory 105 operates as the storage unit 45.
The frame having general specifications includes an SOF (Start of Frame), an arbitration field, a control field, a data field, a CRC field, an ACK field and an EOF (End of Frame). The arbitration field includes an ID and an RTR (Remote Transmission Request). Here, the ID is identification information used to identify a frame. The control field includes an IDE (Identifier Extension), a reserved bit and a DLC (Data Length Code). The CRC field includes a CRC sequence and a CRC delimiter. The ACK field includes an ACK slot and an ACK delimiter. Bit lengths of the information elements included in the fields are those represented in the bottom row of F11. For example, the length of the ID is 11 bits, and the length of the data field is a variable length ranging from 0 to 64 bits.
Also the frame (F12) used in the extended specifications includes an SOF, an arbitration field, a control field, a data field, a CRC field, an ACK field and an EOF. The arbitration field having the extended specifications includes an ID base, an SRR (Substitute Remote Request Bit), an IDE, an ID extension and an RTR. In the extended specifications, a bit string obtained by concatenating a bit string stored as the ID extension to a bit string stored as the ID base represents identification information (ID) of a frame. Also, in the format having the extended specifications, fields from the control field to the EOF are similar to those of the general specifications. Moreover, bit lengths of the information elements included in the fields are those described in the bottom row of F12. Accordingly, in the extended format, a bit string of 29 bits in which 11 bits of the ID base is concatenated to 18 bits of the ID extension is used as identification information of a transmission source. Examples of processes executed in the embodiments are described below by taking, as an example, a case where a frame using the format indicated by F11 of
The communication control apparatus 10, the reception node 60 and the transmission node 40 are interconnected by a bus 71, and a frame transmitted from any of the devices may be broadcast. Each of the devices receives a frame including an ID set as a reception target, and discards other frames. The communication control apparatus 10 and the reception node 60 are connected by a connection wire 72 for transmitting a signal intended to make, to the reception node 60, a notification that a replay attack has been detected.
It is assumed that the transmission node 40 and the communication control apparatus 10 hold a common key prior to the start of a communication. Here, a method by which the communication control apparatus 10 and the transmission node 40 obtain the common key may be any of the arbitrary known methods. The transmission node 40 and the communication control apparatus 10 set an initial value of the counter value so that the counter value used to generate a MAC can become common. Here, the counter value is used to generate a MAC, and a different value is used for each frame. Moreover, the counter value itself is not transmitted and received between any of the devices.
Additionally, in step S13, the communication control apparatus 10 generates the initial value of the counter 14 by encrypting the random number with a common key. The communication control apparatus 10 stores the initial value obtained in step S13 in association with an ID that the transmission node 40 uses to communicate with the reception node 60 (step S14).
In the meantime, the transmission node 40 receives the frame (ID=777) that has been transmitted from the communication control apparatus 10 in step S12, and obtains the random number from the data field of the received frame. Moreover, the transmission node 40 generates the initial value of the counter 44 by encrypting the obtained random number with the common key (step S15). The transmission node 40 sets the initial value obtained in step S15 as the initial value of the counter 44 (step S16).
To generate a MAC, a sequence obtained by concatenating data within the data field of a frame for which a MAC is to be calculated, a counter value and an ID (CAN ID) of the frame for which the MAC is to be calculated is used. Here, the counter value is a value processed by the counter 14 or the counter 44 so that a different value can be used each time a MAC is calculated. In the example illustrated in
The MAC generator 51 within the transmission node 40 obtains a counter value (the value of the counter 44) to be used when a data frame is transmitted to the reception node (step S21). The data frame generator 52 generates a data frame having the ID=123 by incorporating data, the notification of which is to be made to the reception node 60, into the data field (step S22). The data frame generator 52 outputs the generated data frame to the transmitter 42. The transmitter 42 broadcasts the data frame (step S23). Since the ID=123 that is received by both the reception node 60 and the communication control apparatus 10 is used for the data frame, the frame is received by both the reception node 60 and the communication control apparatus 10.
Because the ID of the received frame is set as the value (ID=123) for transmitting and receiving a data frame, the receiver 13 of the communication control apparatus 10 outputs the received frame to the MAC generator 21. The MAC generator 21 calculates a MAC (MAC 1) by using the value of the data field within the input frame, and the counter value within the MAC table 31 (step S24). The MAC calculation method is that described with reference to
In the meantime, the MAC generator 51 within the transmission node 40 calculates a MAC (MAC2) by using the value of the data field within the transmitted frame, the counter value, and the ID within the transmitted frame after the data frame has been transmitted (step S26). Also the MAC calculation performed in the MAC generator 51 is that described with reference to
The MAC generator 51 outputs the generated MAC to the notification frame generator 53. The notification frame generator 53 generates a notification frame for making a notification of an input MAC. At this time, an ID recognized as a reception target that is received by the communication control apparatus 10 and not received by the reception node 60 is set in the notification frame. The example illustrated in
Since the ID of the received frame is the ID (=777) that indicates the notification frame, the receiver 13 of the communication control apparatus 10 outputs the notification frame to the comparator 22. When the notification frame has been input, the comparator 22 obtains an already calculated MAC 1 from the MAC table 31. Moreover, the comparator 22 extracts the MAC (MAC 2) included in the data field of the input notification frame. The comparator 22 determines whether the MAC 1 and the MAC 2 match (step S29). When the MAC 1 and the MAC 2 match, the comparator 22 determines that a replay attack has not been detected, and terminates the process (“YES” in step S29).
In contrast, when the MAC 1 and the MAC 2 do not match, the comparator 22 determines that the replay attack has been detected (step S30). The comparator 22 transmits a signal for issuing a request to abort the process of a frame having the ID=123 to the reception node 60 via the connection wire 72 (step S31). The form of the signal is assumed to be an arbitrary one that enables the reception node 60 to recognize that the request to abort the process of a frame having the ID=123 has been issued.
When the ID of the received frame is not the ID for making a notification of a MAC, the receiver 13 outputs the received frame to the MAC generator 21 (“NO” in step S42). The MAC generator 21 extracts the ID and data from the received frame (step S43). When the extracted ID is a value for which a MAC is to be verified, the MAC generator 21 obtains the counter value (step S44). The MAC generator 21 generates a MAC by using the ID, the data and the counter value (step S45). The MAC generator 21 stores the calculated MAC (MAC 1) in association with the ID of the received frame (step S46). Next, the counter 14 increments the counter value (step S47).
When the ID of the received frame is the ID for making a notification of a MAC, the receiver 13 outputs the received frame to the comparator 22 (“YES” in step S42). The comparator 22 extracts, from the input frame, the MAC (MAC 2) calculated by the transmission node 40 (step S48). The comparator 22 obtains the MAC (MAC 1) stored in the MAC table 31, and makes a comparison between the MAC 1 and the MAC 2 (steps S49 and S50). When the MAC 1 and the MAC 2 match, the comparator 22 terminates the process (“YES” in step S50). When the MAC 1 and the MAC 2 do not match, the comparator 22 determines that an attack has been detected (“NO” in step S50, step S51). Thereafter, the comparator 22 issues a request to abort the process of the frame identified on the basis of the ID with which the attack has been detected, to the reception node 60 via the connection wire 72.
As described above, in the first embodiment, a replay attack can be detected in the communication control apparatus 10 even though the reception node 60 does not execute the process for a MAC. Moreover, the reception node 60 can abort the process of a frame transmitted by a replay attack on the basis of a notification made from the communication control apparatus 10. Accordingly, a replay attack can be detected and the system can be protected from a replay attack without increasing a processing load imposed on the transmission node 40. Moreover, since the process for a MAC is not executed in the reception node 60, an existing ECU is made available as the reception node 60 by laying the connection wire 72 between the communication control apparatus 10 and the reception node 60.
In a MAC used in the first embodiment, the counter value is processed by the counter 14 or the counter 44 so that a different value can be used each time a MAC is calculated. Namely, even if a frame that was transmitted in the past is retransmitted, the counter value used when the MAC generator 21 calculates a MAC by using received data will be changed by the counter 14 from that used when the retransmitted frame has been initially transmitted. Accordingly, a counter value used to calculate a MAC will be different even if a notification frame of a MAC that was transmitted for the retransmitted frame is retransmitted. Therefore, the comparator 22 can detect a replay attack.
Note that the communication control apparatus 10 may include notification means, such as a screen or the like, for making a notification to a user. In this case, the communication control apparatus 10 may make, to the user, a notification that an attack is being made by using the notification means such as a screen or the like without utilizing the connection wire 72 when the replay attack has been detected.
It is assumed that the communication control apparatus 10, the transmission node 40, and the reception node 60 are interconnected by a bus so that the devices can transmit and receive a frame. Upon detection of a replay attack with the procedures described in the first embodiment, the communication control apparatus 10 makes, to the management device 75, a notification that the replay attack has occurred. An operator of the management device 75 is assumed to execute a process for preventing a replay attack when the notification that the replay attack has been detected is made to the management device 75. When a notification instruction or the like is issued from the management device 75 to the reception node 60, the management device 75 and the reception node 60 may be connected.
In another modification example, the communication control apparatus 10 and the reception node 60 possess a common key used to encrypt the abortion instruction, and a counter value used to encrypt the abortion instruction. In this case, the communication control apparatus 10 can make a notification of the abortion instruction to the reception node 60 via the bus 71. In the following description, the request to abort the process of a frame including an ID identical to that within a frame from which a replay attack has been detected is referred to as an “abortion instruction”. Moreover, a common counter value used to encrypt the abortion instruction is referred to as an “abortion counter value” in order to facilitate a distinction from the counter value handled by the counter 14 and the counter 44. As an initial value of the abortion counter, a value common to the communication control apparatus 10 and the reception node 60 is set in the communication control apparatus 10 and the reception node 60 with a process similar to that described with reference to
When a replay attack has been detected, the comparator 22 encrypts a sequence obtained by concatenating an abortion counter value to the abortion instruction with the use of a common key for encrypting the abortion instruction. The comparator 22 generates a frame that includes the abortion instruction after being encrypted in the data field, and sets an ID to that for transmitting the abortion instruction. Here, the ID for transmitting the abortion instruction is assumed to be a value that is received by the reception node 60 and not received by the transmission node 40. The communication control apparatus 10 broadcasts the frame including the encrypted abortion instruction. Then, the frame including the encrypted abortion instruction is received by the reception node 60 without being received by the transmission node 40.
The reception node 60 obtains a sequence in which the abortion counter value is concatenated to the abortion instruction, by decrypting the value within the data field of the received frame with a common key for decrypting the abortion instruction. When the abortion counter value within the obtained sequence and a value stored in the reception node 60 match, the reception node 60 determines that the abortion instruction has been issued from the communication control apparatus 10, and aborts the process of the frame. In this case, the reception node 60 is assumed to abort the process of all the frames when the node has properly received one abortion instruction.
The process of a MAC is not executed in the reception node 60 even when the first embodiment is modified in this way, whereby a process for detecting a replay attack, and a process for protecting the system from a replay attack can be executed without increasing the load imposed on the reception node 60 so much.
The first embodiment has referred to the case where the ID of one type is used for data frames. However, it is possible for a plurality of IDs to be used to transmit and receive data frames. Accordingly, the second embodiment refers to a case where a plurality of IDs are used to transmit and receive a data frame.
A frame F21 illustrated in
Note that a frame indicated by the frame F21 is used also when the communication control apparatus 10 sets the initial value of the counter together with the transmission node 40a or the transmission node 40b. When the initial value of the counter is set, a detection target ID and a random number for generating the initial value are transmitted from the communication control apparatus 10. When the detection target ID within the frame received from the communication control apparatus 10 is an ID used for the transmission process, each of the transmission nodes 40 obtains the random number associated with the detection target ID, and encrypts the random number with a common key exchanged in advance with the communication control apparatus 10. Each of the transmission nodes 40 sets the obtained value as the initial value of the counter. A setting of the initial value of the counter value in the communication control apparatus 10 is similar to that described with reference to
The second embodiment assumes that the communication control apparatus 10 stores an ID to be received by the reception node 60 connected to a connection wire 72 for each of connection wires 72 that connect the communication control apparatus 10 and each corresponding reception node 60. The following description assumes that the communication control apparatus stores information such that a connection destination (reception node 60a) via the connection wire 72a receives the ID=123, and a connection destination (reception node 60b) via the connection wire 72b receives the ID=234.
The timings at which frames having the respective IDs are transmitted are not particularly adjusted. Accordingly, a transmission using a different ID is sometimes performed between a transmission of a data frame having either of the IDs and that of a frame for making a notification of a MAC used to evaluate the validity of data within a data frame. A process executed in a case where the transmission node 40b has transmitted a data frame including the data B before the transmission node 40a transmits a notification frame is described with reference to
In the following description, a letter of the alphabet assigned to an operating transmission node 40 is sometimes appended to a reference numeral of the node in order to easily identify the operating device. For example, a MAC generator 51a is a MAC generator 51 included in the transmission node 40a.
As indicated by step S61, the communication control apparatus 10 stores a counter value for each ID. The MAC table 31 held by the communication control apparatus 10 in the second embodiment includes a plurality of entries for each transmitted or received ID. For the sake of convenience, entries of the counter value and the ID in the MAC table 31 are extracted and represented in step S61. Hereafter, it is assumed that the counter value of the ID=123 and the counter value of the ID 234 are respectively Cx and Cy at a point in time of step S61.
In step S62, the MAC generator 51a within the transmission node 40a obtains the counter value. The communication control apparatus 10 and the transmission node 40a make their counter values of the ID=123 match in advance with the procedures described with reference to
The data frame generator 52a generates a data frame having the ID=123 by incorporating the data A into the data field (step S63). The data frame generator 52a broadcasts the data frame via the transmitter 42a (step S64). Since the ID included in the data frame is 123, the data frame is received by both the reception node 60a and the communication control apparatus 10.
Since the ID of the received frame is set to 123, the receiver 13 of the communication control apparatus 10 outputs the received frame to the MAC generator 21 in step S65. The MAC generator 21 calculates a MAC (MAC 1) by using the counter value Cx associated with the ID=123 and the data A with the process described with reference to
In the meantime, the MAC generator 51a within the transmission node 40a calculates a MAC (MAC 2) by using the data A, the counter value Cx and the ID within the transmitted frame after the frame including the data A has been transmitted (step S67). Thereafter, the counter 44a increments the counter value associated with the ID=123 in preparation for the next MAC calculation (step S68).
In step S69, the MAC generator 51b within the transmission node 40b obtains the counter value Cy used to calculate a MAC corresponding to the frame using the ID=234. Note that both the communication control apparatus 10 and the transmission node 40b make the counter value of the ID=234 match in advance with the procedures described with reference to
The data frame generator 52b generates a data frame having the ID=234 by incorporating the data B into the data field (step S70). The data frame generator 52b broadcasts the data frame via the transmitter 42b (step S71). Since the ID included in the data frame is 234, the data frame is received by the reception node 60b and the communication control apparatus 10.
Since the ID of the received frame is 234, the receiver 13 of the communication control apparatus 10 outputs the received frame to the MAC generator 21 in step S72. The MAC generator 21 calculates a MAC (MAC 3) by using the counter value Cy associated with the ID=234, and the data B. The MAC generator 21 records the MAC 3 in the MAC table 31 in association with the ID (=234) of the received frame. In step S73, the counter increments the counter value in preparation for a MAC calculation using the data transmitted by using the ID=234.
In the meantime, the MAC generator 51b within the transmission node 40b calculates a MAC (MAC 4) by using the data B, the counter value Cy and the ID=234 after the frame including the data B has been transmitted (step S74). Thereafter, the counter 44b increments the counter value associated with the ID=234 (step S75).
In step S76, the notification frame generator 53a of the transmission node 40a generates a notification frame for making a notification of the MAC 2, and broadcasts the notification frame via the transmitter 42a. Here, the MAC 2 is adjusted to 53 bits as earlier described with reference to the frame F21 illustrated in
The receiver 13 of the communication control apparatus 10 outputs, to the comparator 22, the notification frame received in step S76. The comparator 22 obtains, from the MAC table 31, a MAC associated with the detection target ID within the notification frame. Here, since the detection target ID is 123, the comparator 22 obtains the MAC 1. Moreover, the comparator 22 extracts the MAC 2 from the data within the notification frame. The comparator 22 determines whether the MAC 1 and the MAC 2 match (step S77). When the MAC 1 and the MAC 2 match, the comparator 22 determines that a replay attack has not been detected (“YES” in step S77). In contrast, when the MAC 1 and the MAC 2 do not match, the comparator 22 determines that the replay attack against the ID=123 has been detected (“NO” in step S77, step S78). The comparator 22 transmits a signal for issuing a request to abort the process of a frame having the ID=123 to the reception node 60a via the connection wire 72a (step S79).
In step S80, the notification frame generator 53b of the transmission node 40b generates a notification frame for making a notification of the detection target ID=234 and the MAC 4, and broadcasts the generated notification frame via the transmitter 42b. Also in the transmission node 40b, the ID is set to 777 in the notification frame. Therefore, the notification frame is received by the communication control apparatus 10, and not received by the reception node 60a and the reception node 60b.
The comparator 22 of the communication control apparatus 10 obtains the notification frame via the receiver 13. The comparator 22 obtains, from the MAC table 31, the MAC 3 associated with the detection target ID (=234) within the notification frame. The comparator 22 makes a comparison between the MAC 3 and the MAC 4 reported by the notification frame (step S81). When the MAC 3 and the MAC 4 match, the comparator 22 determines that a replay attack against the ID=234 has not been detected (“YES” in step S81). In contrast, when the MAC 3 and the MAC 4 do not match, the comparator 22 determines that the replay attack against the ID=234 has been detected (“NO” in step S81, step S82). The comparator 22 transmits a signal for issuing a request to abort the process of a frame having the ID=234 to the reception node 60b via the connection wire 72b (step S83).
As described above, in the second embodiment, a replay attack can be detected while preventing a load imposed on the reception node 60 from being increased even though a plurality of IDs are used to transmit and receive a data frame.
Similarly to the first embodiment, the process executed after a replay attack has been detected may be changed to that executed via the management device 75 in accordance with the type of a device included in the network.
A third embodiment refers to a case where the transmission node 40 transmits an authentication code generated by using MACs obtained from a plurality of transmitted data frames after the transmission node 40 has transmitted the data frames. The communication control apparatus 10 used in the third embodiment stores an authentication code table 32 (
Assume that an authentication code is generated by using frames F31 to F33 (not illustrated). A plain text P1 is a bit string obtained by concatenating data within the frame F31, a counter value used when the frame F31 is transmitted, and an ID used to identify the frame F31. Similarly, a plain text P2 is a bit string obtained by concatenating data within the frame F32, a counter value, and an ID. Moreover, a plain text P3 is a bit string obtained by concatenating data within the frame F33, a counter value and an ID. The plain texts P1 to P3 are encrypted, and MACs 31 to 33 are respectively obtained from the encrypted texts. A process for generating the MACs respectively from the plain texts is similar to that described with reference to
Thereafter, an authentication code is obtained by performing a computation for the MACs. In the example illustrated in
Values associated with the ID=123 are as follows in the authentication code table 32 held by the communication control apparatus 10 when the process of step S111 is started.
detection target ID=123
authentication code X=0
counter value=C1
variable n=0
It is also assumed that the authentication code Y stored in the transmission node 40 and the number of frames used to generate the authentication code are initialized to 0. It is assumed that the notification frame generator 53 manages the authentication code Y and the number of frames used to calculate the authentication code Y in the transmission node 40.
The MAC generator 51 within the transmission node 40 obtains a counter value when a data frame is transmitted (step S111). After the data frame generator 52 has generated a data frame including the data A, the data frame generator 52 broadcasts the generated data frame via the transmitter 42 (step S112). The data frame is received by both the reception node 60 and the communication control apparatus 10.
When the MAC generator 21 of the communication control apparatus 10 has obtained the data frame via the receiver 13, the generator calculates a MAC (MAC 1) (step S113). The MAC generator 21 updates the authentication code (authentication code X) within the authentication code table 32 by using the MAC 1 (step S114). With the process of step S114, the initial value of the authentication code is replaced with the MAC 1 in the authentication code table 32. Moreover, the MAC generator increments the variable n associated with the ID=123. Additionally, the counter 14 increments the counter value (step S115). Accordingly, the following information items are recorded in the authentication code table 32 at a point in time when the process of step S115 has been terminated.
detection target ID=123
authentication code=MAC 1
counter value=C2
variable n=1
In the meantime, also in the transmission node 40, the MAC generator 51 generates a MAC (MAC 2) after the data frame including the data A has been transmitted (step S116). The notification frame generator 53 updates the authentication code Y by using the MAC 2 (step S117). At this time, the notification frame generator 53 stores the information that one data frame is used to generate the authentication code Y. The counter 44 increments the counter value used to calculate a MAC in the transmission node 40 (step S118).
Next, the transmission node 40 broadcasts a data frame including the data B (step S119). The process of step S119 is similar to that of step S112. Also the data frame including the data B is received by both the reception node 60 and the communication control apparatus 10.
The MAC generator 21 of the communication control apparatus 10 obtains the data frame including the data B via the receiver 13, and calculates a MAC (MAC 3) (step S120). The MAC generator 21 updates the authentication code X within the authentication code table 32 by using the MAC 3 (step S121). With the process of step S121, the authentication code X becomes a value obtained by performing an XOR for the MAC 1 and the MAC 3. Moreover, the MAC generator 21 increments the variable n associated with the ID=123. Additionally, the counter 14 increments the counter value (step S122).
In the meantime, also in the transmission node 40, the MAC generator 51 generates a MAC (MAC 4) by using the data frame including the data B (step S123). The notification frame generator 53 updates the authentication code Y by using the MAC 4 (step S124). The counter 44 increments the counter value used to calculate a MAC in the transmission node 40 (step S125).
Incidentally, the authentication code Y after being updated is generated by using the two data frames because of the update of the authentication code Y. Accordingly, the notification frame generator 53 generates a notification frame that includes the authentication code Y in the data field, and broadcasts the notification frame after the notification frame generator 53 has set the ID of the notification frame to 777 (step S126). The notification frame is received by the communication control apparatus 10 without being received by the reception node 60.
The comparator 22 of the communication control apparatus 10 obtains the notification frame via the receiver 13. The comparator 22 makes a comparison between the authentication code Y reported by the notification frame and the authentication code X recorded in the MAC table 31 (step S127). When the authentication code Y and the authentication code X match, the comparator 22 determines that a replay attack against the ID=123 has not been detected, and terminates the process (“YES” in step S127). In contrast, when the authentication code Y and the authentication code X do not match, the comparator 22 determines that the replay attack against the ID=123 has been detected (“NO” in step S127, step S128). The comparator 22 transmits a signal for issuing a request to abort the process of a frame having the ID=123 to the reception node 60 via the connection wire 72 (step S129).
The example in the case where only the authentication code is included in the data field of the notification frame has been described with reference to
The comparator 22 sets the variable n to 0, and also sets, to 0, the authentication code X within the authentication code table 32 (step S141). Here, the process of step S141 is executed when the communication control apparatus 10 starts to operate, and is also executed each time a comparison process of the comparator 22 is terminated. The receiver 13 waits until it receives a frame (“NO” in step S142). Upon receipt of a frame, the receiver 13 determines whether the ID of the received frame is an ID for making a notification of an authentication code (“YES” in step S142, step S143).
When the ID of the received frame is not the ID for making a notification of an authentication code, the receiver 13 outputs the received frame to the MAC generator 21 (“NO” in step S143). The MAC generator 21 extracts the ID and data from the received frame (step S144). The MAC generator 21 obtains a counter value (step S145). The MAC generator 21 generates a MAC by using the ID, the data and the counter value (step S146). The MAC generator 21 updates the authentication code associated with the ID (detection target ID) of the received frame by using the MAC (step S147). The MAC generator 21 increments the variable n (step S148). Next, the counter 14 increments the counter value (step S149). Thereafter, the process returns to step S142.
When the ID of the received frame is that for making a notification of an authentication code, the receiver 13 outputs the received frame to the comparator 22 (“YES” in step S143). The comparator 22 extracts the detection target ID, and the authentication code (authentication code Y) calculated by the transmission node 40 (step S150). The comparator 22 determines whether the value of the variable n within the entry associated with the detection target ID in the authentication code table 32 and the constant k match (step S151). When the value of the variable n and the constant k do not match, there is a possibility that a frame not transmitted by the transmission node 40 has been transmitted from an attacker by using the detection target ID (“NO” in step S151). Accordingly, the comparator 22 determines that the attack against the detection target ID has been detected (step S154).
When the value of the variable n and the constant k match, the comparator 22 obtains the authentication code (authentication code X) that is stored in the authentication code table 32 in association with the detection target ID (“YES” in step S151, step S152). Moreover, the comparator 22 makes a comparison between the authentication code X and the authentication code Y (step S153). When the authentication code X and the authentication code Y match, the comparator 22 determines that the attack against the detection target ID has not been detected, and terminates the process (“YES” in step S153). When the authentication code X and the authentication code Y do not match, the comparator 22 determines that the attack has been detected (“NO” in step S153, step S154). Thereafter, the comparator 22 issues a request to abort the process of the frame identified on the basis of the ID with which the attack has been detected, to the reception node 60 via the connection wire 72.
According to the third embodiment, one notification frame is transmitted every time k data frames are transmitted from the transmission node 40. Namely, the number of frames to be processed for determining the validity of the k data frames is k+1. In contrast, in the first and the second embodiments, one notification frame is transmitted for one data frame. Therefore, 2 k frames are processed to determine the legality of k data frames. Accordingly, the processing load imposed on the communication control apparatus 10 is lighter than that of the first and the second embodiments, thereby increasing the processing speed.
With embodiments including the above described first to third embodiments, a replay attack can be detected while lightening a load imposed on a device that receives a frame.
<Others>
Embodiments are not limited to the above described ones, and can be variously modified. For instance, the MAC table 31, the authentication code table 32 and the frame format are merely examples, and can be changed in accordance with an implementation.
Additionally, in the third embodiment, a combination of counter values used when each authentication code is calculated differs for each authentication code. Then a counter value does not always differ for each MAC. Accordingly, the communication control apparatus 10 and the transmission node 40 may use the same counter value when a MAC is calculated from k data frames that are evaluated on the basis of one authentication code. In this case, the transmission node 40 increments the counter value each time the node transmits a notification frame. Also, the communication control apparatus 10 increments the counter value after the apparatus performs a determination using an authentication code.
The above description has been provided by taking, as the example, the case where a frame having general specifications of a CAN is transmitted and received. The above described embodiments are also applicable in a case where a frame having extended specifications of the CAN, or a frame used in a CAN FD (CAN with Flexible Data-Rate) is transmitted and received.
Additionally, in the second and the third embodiments also, the process executed when the communication control apparatus 10 has detected a replay attack may be modified as earlier stated in the modification example of the first embodiment. Additionally, the process executed after a replay attack is detected may be determined by a user depending on the system.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2014-266836 | Dec 2014 | JP | national |