KR102148453B1 - Controller area network system and message authentication method - Google Patents

Controller area network system and message authentication method Download PDF

Info

Publication number
KR102148453B1
KR102148453B1 KR1020180096307A KR20180096307A KR102148453B1 KR 102148453 B1 KR102148453 B1 KR 102148453B1 KR 1020180096307 A KR1020180096307 A KR 1020180096307A KR 20180096307 A KR20180096307 A KR 20180096307A KR 102148453 B1 KR102148453 B1 KR 102148453B1
Authority
KR
South Korea
Prior art keywords
mac
generated
random number
update
message
Prior art date
Application number
KR1020180096307A
Other languages
Korean (ko)
Other versions
KR20200020515A (en
Inventor
신성주
백영미
정상수
Original Assignee
재단법인대구경북과학기술원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 재단법인대구경북과학기술원 filed Critical 재단법인대구경북과학기술원
Priority to KR1020180096307A priority Critical patent/KR102148453B1/en
Publication of KR20200020515A publication Critical patent/KR20200020515A/en
Application granted granted Critical
Publication of KR102148453B1 publication Critical patent/KR102148453B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3242Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40104Security; Encryption; Content protection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/84Vehicles

Abstract

CAN 시스템 및 메시지 인증 방법이 개시된다. CAN 시스템은 상호 간에 메시지를 송수신하는 복수의 ECU(Electronic Control Unit) 및 세션키 생성 난수를 생성하여 복수의 ECU로 전송하는 게이트웨이를 포함하며, 복수의 ECU는 수신한 세션키 생성 난수에 기초하여 세션키를 생성하고, 복수의 ECU 중 제1 ECU는 생성된 세션키와 MAC 생성 난수에 기초하여 제1 MAC를 생성하고, 생성된 제1 MAC와 MAC 생성 난수를 포함하는 메시지를 복수의 ECU 중 제2 ECU로 전송하며, 제2 ECU는 생성된 세션키와 수신된 MAC 생성 난수에 기초하여 제2 MAC를 생성하고, 수신된 제1 MAC와 생성된 제2 MAC의 동일성 여부를 판단하여 수신된 메시지를 인증한다.A CAN system and message authentication method are disclosed. The CAN system includes a plurality of ECUs (Electronic Control Units) that transmit and receive messages to and from each other, and a gateway that generates a session key generation random number and transmits it to a plurality of ECUs, and the plurality of ECUs is based on the received session key generation random number. A key is generated, and the first ECU among the plurality of ECUs generates a first MAC based on the generated session key and the MAC generated random number, and sends a message including the generated first MAC and the MAC generated random number among the plurality of ECUs. 2 Transmits to the ECU, and the second ECU generates a second MAC based on the generated session key and the received MAC-generated random number, and determines whether the received first MAC and the generated second MAC are identical to the received message. To authenticate.

Description

CAN 시스템 및 메시지 인증 방법{CONTROLLER AREA NETWORK SYSTEM AND MESSAGE AUTHENTICATION METHOD}CAN system and message authentication method {CONTROLLER AREA NETWORK SYSTEM AND MESSAGE AUTHENTICATION METHOD}

본 개시는 CAN 시스템 및 메시지 인증 방법에 관한 것으로, 더욱 상세하게는 ECU 간에 안전하게 메시지를 송수신하도록 메시지를 인증하는 CAN 시스템 및 메시지 인증 방법에 관한 것이다.The present disclosure relates to a CAN system and a message authentication method, and more particularly, to a CAN system and a message authentication method for authenticating a message to securely transmit and receive messages between ECUs.

현대의 차량에는 안전성과 효율성을 극대화하기 위해 기계부품과 유압시스템 외에 전장부품이 많이 포함되어 있다. 전장부품의 증가와 함께 전장부품을 제어하는 ECU(Electronic Control Unit)의 개수가 증가되고 있으며 ECU들을 연결하고 제어하기 위해 차량 내 통신을 이용한다. In order to maximize safety and efficiency, modern vehicles include many electronic parts in addition to mechanical parts and hydraulic systems. Along with the increase in electronic parts, the number of ECUs (Electronic Control Units) that control electronic parts is increasing, and in-vehicle communication is used to connect and control ECUs.

차량의 3대 부문(파워트레인, 섀시, 바디)에서 주로 사용되는 네트워크는 CAN(Controller Area Network), LIN(Local Interconnect Network), FlexRay가 있으며, 제조비용의 최소화, 실시간 처리, 자동화, 분산처리를 요구하는 차량에서 CAN이 광범위하게 사용되는 네트워크이다.Networks mainly used in the three major sectors of the vehicle (powertrain, chassis, and body) are CAN (Controller Area Network), LIN (Local Interconnect Network), and FlexRay, and minimize manufacturing costs, real-time processing, automation, and distributed processing. It is a network where CAN is widely used in demanding vehicles.

CAN은 다중통신망(Multi Master Network)이며 CSMA/CD&AMP(Carrier Sense Multiple Access/Collision Detection with Arbitration on Message Priority) 방식으로 메시지를 전송한다. CAN 노드(예, ECU)는 버스가 사용 중(idle, busy)인지 먼저 파악한 후 메시지를 전송한다. 여러 노드의 데이터들이 버스에 동시에 유입되어 전송 충돌이 발생할 경우, CAN은 식별자(Arbitration Field)(또는, 메시지 ID)값을 비교하여 전송 우선 순위를 결정하며, 우선 순위가 가장 높은 메시지를 가진 노드만이 CAN 버스 사용 권한을 획득한다. 이때, 메시지의 ID가 낮을수록 전송 우선 순위가 높다. 낮은 순위의 메시지를 가진 노드는 대기 상태로 전환되어 다음 버스 사이클에 재전송을 시도한다. 즉, 한 순간에 한 개의 노드만 CAN 버스에 접근 가능하며, 앞서 기술된 것처럼 식별자(Arbitration Field)를 기초로 우선 순위를 비교하여 가장 높은 우선 순위의 메시지만 계속 전송되고, 다른 노드들은 모두 대기(listening) 모드로 전이한다. CAN은 메시지 주소 방식을 사용하기 때문에 식별자(Arbitration Field)만으로 메시지를 구별할 수 있으며, 전송 노드의 식별 정보는 사용하지 않는다.CAN is a multi-master network and transmits messages in the CSMA/CD&AMP (Carrier Sense Multiple Access/Collision Detection with Arbitration on Message Priority) method. The CAN node (e.g., ECU) first determines whether the bus is busy (idle, busy) and then sends a message. When data from multiple nodes flows into the bus at the same time and a transmission conflict occurs, CAN determines the transmission priority by comparing the value of the identifier (Arbitration Field) (or message ID), and only the node with the highest priority message Acquire permission to use this CAN bus. In this case, the lower the ID of the message, the higher the transmission priority. A node with a low-priority message enters the standby state and tries to retransmit in the next bus cycle. In other words, only one node can access the CAN bus at a moment, and as described above, only the highest priority message is continuously transmitted by comparing the priority based on the identifier (Arbitration Field), and all other nodes are waiting ( transition to listening) mode. Because CAN uses a message address method, messages can be identified only by an identifier (Arbitration Field), and identification information of a transmitting node is not used.

과거의 폐쇄망 형태의 차량 내부 네트워크를 위해 설계된 CAN 프로토콜은 외부로부터의 해킹이나 악의적 제어조작에 대한 대응을 고려할 필요가 없었으므로 보안에 대한 대책이 마련되어 있지 않았다. 따라서, 개방형 네트워크로 변화하고 있는 현재 차량 내부 네트워크에서 외부 공격 위협성 증가에 따른 보안 기술은 미비한 상태이며 공격에 대한 취약점을 보완할 수 있는 방법은 표준 프로토콜에서 정의되어 있지 않다.In the past, the CAN protocol designed for a closed network type of in-vehicle network did not need to consider countermeasures against external hacking or malicious control operations, so there were no security measures. Therefore, in the current in-vehicle network, which is changing to an open network, security technology due to the increase in external attack threat is inadequate, and a method to supplement the vulnerability for an attack is not defined in the standard protocol.

CAN 프로토콜은 송신자 및 수신자 식별 정보가 없고 인증을 위한 필드가 별도로 존재하지 않으므로 메시지 위조 계열 공격에 매우 취약하다. 그리고, CAN 프로토콜은 보안성이 없는 브로트캐스트 통신 방식을 채택하였으므로 공격자가 네트워크 내 메시지에 대한 도청을 쉽게 할 수 있으며, 수신한 내용을 재송신하거나 변조하여 전송하는 replay와 masquerade 공격을 할 수 있다.The CAN protocol is very vulnerable to message forgery attacks because there is no sender and receiver identification information, and there is no separate field for authentication. In addition, because the CAN protocol adopts a broadcast communication method without security, an attacker can easily eavesdrop on messages in the network, and can perform replay and masquerade attacks that retransmit or modulate the received contents.

최근 CAN 프로토콜의 보안을 위해 암호화 기반의 인증 방법, 그룹 기반의 만장일치 인증 방법, MAC 기반의 인증 방법, 그룹 MAC 인증 방법 등이 제안되었다.Recently, for the security of the CAN protocol, an encryption-based authentication method, a group-based unanimous authentication method, a MAC-based authentication method, and a group MAC authentication method have been proposed.

암호화(개인키와 공개키를 이용) 기반의 인증 방법이 고려될 수 있으나 암호화 방식은 많은 연산량을 필요로 하고, 하드웨어와 CAN 프레임의 수정이 필요하므로 적용에 어려움이 있다. 그룹 기반의 만장일치 인증 방법은 그룹 내 멤버의 인증 확인을 위해 현재 CAN 프로토콜에 새로운 응용 계층을 구현해야 하는 문제점이 있다. MAC 기반의 인증 방법은 사용할 키를 미리 생성해두고 사용하므로 ECU 메모리 크기에 제한되고 인증 후에는 다시 키를 생성해야 하는 문제점이 있다. 그룹 MAC 인증 방법은 노드 수가 증가할 경우 그룹 MAC 인증의 장점을 얻기 어렵고 그룹의 수가 증가할 경우 키 관리가 어려워지는 문제점이 있다.An authentication method based on encryption (using a private key and a public key) may be considered, but the encryption method requires a large amount of computation and is difficult to apply because it requires modification of hardware and CAN frames. The group-based unanimous authentication method has a problem in that a new application layer must be implemented in the current CAN protocol to verify the authentication of members within the group. Since the MAC-based authentication method generates and uses the key to be used in advance, there is a problem that the ECU memory size is limited and the key must be generated again after authentication. In the group MAC authentication method, when the number of nodes increases, it is difficult to obtain the advantages of group MAC authentication, and when the number of groups increases, key management becomes difficult.

따라서, 현재 CAN 프로토콜의 변경없이 적용 가능하고 원활하게 동작할 수 있는 CAN 시스템의 메시지 인증 방법의 필요성이 존재한다.Accordingly, there is a need for a message authentication method of a CAN system that can be applied and smoothly operated without changing the current CAN protocol.

본 개시는 상술한 문제점을 해결하기 위한 것으로, 본 개시의 목적은 현재 CAN 프로토콜의 변경없이 적용할 수 있고 확장성이 크며, 공격자의 공격에 강인한 CAN 시스템 및 메시지 인증 방법을 제공하는 것이다.The present disclosure is to solve the above-described problems, and an object of the present disclosure is to provide a CAN system and a message authentication method that can be applied without changing the current CAN protocol, have high scalability, and are robust against attack by an attacker.

이상과 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따르면, CAN(Controller Area Network) 시스템은 상호 간에 메시지를 송수신하는 복수의 ECU(Electronic Control Unit) 및 세션키 생성 난수를 생성하여 상기 복수의 ECU로 전송하는 게이트웨이를 포함하며, 상기 복수의 ECU는 상기 수신한 세션키 생성 난수에 기초하여 세션키를 생성하고, 상기 복수의 ECU 중 제1 ECU는 상기 생성된 세션키와 MAC 생성 난수에 기초하여 제1 MAC(Message Authentication Code)를 생성하고, 상기 생성된 제1 MAC와 상기 MAC 생성 난수를 포함하는 메시지를 상기 복수의 ECU 중 제2 ECU로 전송하며, 상기 제2 ECU는 상기 생성된 세션키와 상기 수신된 MAC 생성 난수에 기초하여 제2 MAC를 생성하고, 상기 수신된 제1 MAC와 상기 생성된 제2 MAC의 동일성 여부를 판단하여 상기 수신된 메시지를 인증한다.According to an embodiment of the present disclosure for achieving the above object, a controller area network (CAN) system generates a plurality of electronic control units (ECUs) that transmit and receive messages to and from each other, and a random number for generating a session key to generate the plurality of It includes a gateway that transmits to the ECU, wherein the plurality of ECUs generate a session key based on the received session key generation random number, and the first ECU of the plurality of ECUs is based on the generated session key and MAC generated random number. Thus, a first MAC (Message Authentication Code) is generated, and a message including the generated first MAC and the MAC generated random number is transmitted to a second ECU among the plurality of ECUs, and the second ECU is the generated session. A second MAC is generated based on a key and the received MAC generated random number, and the received message is authenticated by determining whether the received first MAC and the generated second MAC are identical.

그리고, 상기 제1 ECU는 상기 세션키와 상기 MAC 생성 난수에 기초하여 메시지 전송키를 생성하고, 상기 생성된 메시지 전송키, 상기 MAC 생성 난수 및 데이터에 기초하여 제1 MAC를 생성하며, 상기 생성된 제1 MAC, 상기 MAC 생성 난수 및 상기 데이터를 상기 메시지의 데이터 필드에 포함시켜 상기 제2 ECU로 전송할 수 있다.And, the first ECU generates a message transmission key based on the session key and the MAC generated random number, generates a first MAC based on the generated message transmission key, the MAC generated random number and data, and the generation The first MAC, the MAC generated random number, and the data may be included in the data field of the message and transmitted to the second ECU.

또한, 상기 제2 ECU는 상기 세션키와 상기 수신된 메시지의 데이터 필드에 포함된 MAC 생성 난수에 기초하여 메시지 수신키를 생성하고, 상기 생성된 메시지 수신키, 상기 데이터 필드에 포함된 상기 MAC 생성 난수 및 상기 데이터에 기초하여 제2 MAC를 생성할 수 있다.Further, the second ECU generates a message reception key based on the session key and a MAC generated random number included in the data field of the received message, and generates the generated message reception key and the MAC included in the data field. A second MAC may be generated based on the random number and the data.

그리고, 상기 게이트웨이는 상기 세션키 생성 난수를 기 설정된 시간마다 갱신할 수 있다.In addition, the gateway may update the session key generation random number every preset time.

또한, 상기 게이트웨이는 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신할 수 있다.Also, the gateway may update the session key based on the updated session key generation random number and a hash function.

또한, 상기 게이트웨이는 상기 세션키와 세션 갱신 MAC 생성 난수에 기초하여 갱신 전송키를 생성하고, 상기 생성된 갱신 전송키, 상기 세션 갱신 MAC 생성 난수 및 갱신 데이터에 기초하여 제1 갱신 MAC를 생성하며, 상기 생성된 제1 갱신 MAC, 상기 갱신된 세션키 생성 난수, 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터를 갱신 메시지의 데이터 필드에 포함시켜 상기 복수의 ECU로 전송할 수 있다.In addition, the gateway generates an update transmission key based on the session key and a session update MAC generated random number, and generates a first update MAC based on the generated update transmission key, the session update MAC random number, and update data. , The generated first update MAC, the updated session key generation random number, the session update MAC generation random number, and the update data may be included in a data field of an update message and transmitted to the plurality of ECUs.

한편, 상기 복수의 ECU 각각은 상기 세션키와 상기 수신된 갱신 메시지의 데이터 필드에 포함된 세션 갱신 MAC 생성 난수에 기초하여 갱신 수신키를 생성하고, 상기 생성된 갱신 수신키, 상기 데이터 필드에 포함된 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터에 기초하여 제2 갱신 MAC를 생성하며, 상기 수신된 제1 갱신 MAC와 상기 생성된 제2 갱신 MAC의 동일성 여부를 판단하여 상기 수신된 갱신 메시지를 인증하고, 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신할 수 있다.Meanwhile, each of the plurality of ECUs generates an update reception key based on the session key and a random number of session update MAC generation included in the data field of the received update message, and the generated update reception key, included in the data field. Generates a second update MAC based on the generated random number of generated session update MAC and the update data, and authenticates the received update message by determining whether the received first update MAC and the generated second update MAC are identical And, the session key may be updated based on the updated session key generated random number and a hash function.

이상과 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따르면, CAM 시스템의 메시지 인증 방법은 게이트웨이가 세션키 생성 난수를 생성하여 복수의 ECU로 전송하는 단계, 상기 복수의 ECU가 상기 수신한 세션키 생성 난수에 기초하여 세션키를 생성하는 단계, 상기 복수의 ECU 중 제1 ECU가 상기 생성된 세션키와 MAC 생성 난수에 기초하여 제1 MAC를 생성하는 단계, 상기 제1 ECU가 상기 생성된 제1 MAC와 상기 MAC 생성 난수를 포함하는 메시지를 상기 복수의 ECU 중 제2 ECU로 전송하는 단계, 상기 제2 ECU가 상기 생성된 세션키와 상기 수신된 MAC 생성 난수에 기초하여 제2 MAC를 생성하는 단계 및 상기 제2 ECU가 상기 수신된 제1 MAC와 상기 생성된 제2 MAC의 동일성 여부를 판단하여 상기 수신된 메시지를 인증하는 단계를 포함한다.According to an embodiment of the present disclosure for achieving the above object, in the message authentication method of the CAM system, a gateway generates a session key generation random number and transmits it to a plurality of ECUs, and the received session by the plurality of ECUs. Generating a session key based on a key generation random number, generating, by a first ECU among the plurality of ECUs, a first MAC based on the generated session key and a MAC generated random number, and the first ECU Transmitting a message including a first MAC and the MAC-generated random number to a second ECU among the plurality of ECUs, wherein the second ECU generates a second MAC based on the generated session key and the received MAC-generated random number. Generating, and authenticating the received message by determining, by the second ECU, whether the received first MAC and the generated second MAC are identical.

그리고, 상기 제1 MAC를 생성하는 단계는 상기 세션키와 상기 MAC 생성 난수에 기초하여 메시지 전송키를 생성하고, 상기 생성된 메시지 전송키, 상기 MAC 생성 난수 및 데이터에 기초하여 제1 MAC를 생성하고, 상기 제2 ECU로 전송하는 단계는 상기 생성된 제1 MAC, 상기 MAC 생성 난수 및 상기 데이터를 상기 메시지의 데이터 필드에 포함시켜 상기 제2 ECU로 전송할 수 있다.And, in the step of generating the first MAC, a message transmission key is generated based on the session key and the MAC generated random number, and a first MAC is generated based on the generated message transmission key, the MAC generated random number, and data. And, in the step of transmitting to the second ECU, the generated first MAC, the MAC-generated random number, and the data may be included in a data field of the message and transmitted to the second ECU.

또한, 상기 제2 MAC를 생성하는 단계는 상기 세션키와 상기 수신된 메시지의 데이터 필드에 포함된 MAC 생성 난수에 기초하여 메시지 수신키를 생성하고, 상기 생성된 메시지 수신키, 상기 데이터 필드에 포함된 상기 MAC 생성 난수 및 상기 데이터에 기초하여 제2 MAC를 생성할 수 있다.In addition, generating the second MAC includes generating a message reception key based on the session key and a MAC generated random number included in the data field of the received message, and including the generated message reception key, in the data field. A second MAC may be generated based on the generated MAC random number and the data.

한편, CAM 시스템의 메시지 인증 방법은 상기 세션키를 갱신하는 단계를 더 포함하고, 상기 세션키를 갱신하는 단계는 상기 게이트웨이가 상기 세션키 생성 난수를 기 설정된 시간마다 갱신할 수 있다.Meanwhile, the message authentication method of the CAM system further includes updating the session key, and in the updating of the session key, the gateway may update the session key generation random number every preset time.

그리고, 상기 세션키를 갱신하는 단계는 상기 게이트웨이가 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신할 수 있다.In the updating of the session key, the gateway may update the session key based on the updated session key generation random number and a hash function.

또한, 상기 세션키를 갱신하는 단계는 상기 게이트웨이가 상기 세션키와 세션 갱신 MAC 생성 난수에 기초하여 갱신 전송키를 생성하고, 상기 생성된 갱신 전송키, 상기 세션 갱신 MAC 생성 난수 및 갱신 데이터에 기초하여 제1 갱신 MAC를 생성하며, 상기 생성된 제1 갱신 MAC, 상기 갱신된 세션키 생성 난수, 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터를 갱신 메시지의 데이터 필드에 포함시켜 상기 복수의 ECU로 전송할 수 있다.In addition, in the updating of the session key, the gateway generates an update transmission key based on the session key and a session update MAC generated random number, and based on the generated update transmission key, the session update MAC generated random number, and update data. A first update MAC is generated, and the generated first update MAC, the updated session key generation random number, the session update MAC generation random number, and the update data are included in a data field of an update message and transmitted to the plurality of ECUs. I can.

또한, 상기 세션키를 갱신하는 단계는 상기 복수의 ECU 각각이 상기 세션키와 상기 수신된 갱신 메시지의 데이터 필드에 포함된 세션 갱신 MAC 생성 난수에 기초하여 갱신 수신키를 생성하고, 상기 생성된 갱신 수신키, 상기 데이터 필드에 포함된 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터에 기초하여 제2 갱신 MAC를 생성하며, 상기 수신된 제1 갱신 MAC와 상기 생성된 제2 갱신 MAC의 동일성 여부를 판단하여 상기 수신된 갱신 메시지를 인증하고, 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신할 수 있다.In addition, in the updating of the session key, each of the plurality of ECUs generates an update reception key based on the session key and a session update MAC generated random number included in the data field of the received update message, and the generated update Generates a second update MAC based on a reception key, the session update MAC generation random number included in the data field, and the update data, and determines whether the received first update MAC and the generated second update MAC are identical Accordingly, the received update message may be authenticated, and the session key may be updated based on the updated session key generation random number and a hash function.

이상 설명한 바와 같이, CAN 시스템 및 메시지 인증 방법은 메시지를 전송할 때마다 현재 키와 난수에 기초하여 MAC을 생성하므로 높은 보안성을 가질 수 있다.As described above, the CAN system and the message authentication method generate a MAC based on a current key and a random number every time a message is transmitted, so that high security can be obtained.

그리고, CAN 시스템 및 메시지 인증 방법은 일정 기간마다 MAC 생성에 사용되는 키를 변경하기 때문에 공격자의 무작위 대입 공격에 대응할 수 있다.In addition, the CAN system and the message authentication method change the key used to generate the MAC every certain period, so it can respond to the attacker's random attack.

또한, CAN 시스템 및 메시지 인증 방법은 기존의 CAN protocol을 수정하지 않고 적용할 수 있다.In addition, the CAN system and message authentication method can be applied without modifying the existing CAN protocol.

또한, CAN 시스템 및 메시지 인증 방법은 CAN 시스템이 변경되더라도 알고리즘의 수정없이 적용할 수 있다.In addition, the CAN system and message authentication method can be applied without modification of the algorithm even if the CAN system is changed.

또한, CAN 시스템 및 메시지 인증 방법은 많은 자원이 필요하지 않고 빠른 시간 내에 메시지 인증이 가능하며 기존 장치와 호환될 수 있다.In addition, the CAN system and message authentication method do not require a lot of resources, can authenticate messages in a short time, and can be compatible with existing devices.

도 1은 본 개시의 일 실시 예에 따른 CAN 시스템을 나타내는 도면이다.
도 2는 본 개시의 일 실시 예에 따른 해시 체인을 이용한 키 생성 방법과 해시 풀을 설명하는 도면이다.
도 3은 본 개시의 일 실시 예에 따른 ECU 간 메시지를 전송하고 인증하는 과정을 설명하는 타이밍도이다.
도 4는 본 개시의 일 실시 예에 따른 세션키를 갱신하는 과정을 설명하는 타이밍도이다.
도 5는 본 개시의 일 실시 예에 따른 CAM 시스템의 메시지 인증 방법의 흐름도이다.
1 is a diagram illustrating a CAN system according to an embodiment of the present disclosure.
FIG. 2 is a diagram illustrating a key generation method and a hash pool using a hash chain according to an embodiment of the present disclosure.
3 is a timing diagram illustrating a process of transmitting and authenticating a message between ECUs according to an embodiment of the present disclosure.
4 is a timing diagram illustrating a process of updating a session key according to an embodiment of the present disclosure.
5 is a flowchart of a message authentication method of a CAM system according to an embodiment of the present disclosure.

이하에서는 첨부된 도면을 참조하여 다양한 실시 예를 보다 상세하게 설명한다. 본 명세서에 기재된 실시 예는 다양하게 변형될 수 있다. 특정한 실시 예가 도면에서 묘사되고 상세한 설명에서 자세하게 설명될 수 있다. 그러나, 첨부된 도면에 개시된 특정한 실시 예는 다양한 실시 예를 쉽게 이해하도록 하기 위한 것일 뿐이다. 따라서, 첨부된 도면에 개시된 특정 실시 예에 의해 기술적 사상이 제한되는 것은 아니며, 발명의 사상 및 기술 범위에 포함되는 모든 균등물 또는 대체물을 포함하는 것으로 이해되어야 한다.Hereinafter, various embodiments will be described in more detail with reference to the accompanying drawings. The embodiments described in this specification may be variously modified. Certain embodiments may be depicted in the drawings and described in detail in the detailed description. However, specific embodiments disclosed in the accompanying drawings are only intended to facilitate understanding of various embodiments. Accordingly, the technical idea is not limited by the specific embodiments disclosed in the accompanying drawings, and it should be understood to include all equivalents or substitutes included in the spirit and scope of the invention.

제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 이러한 구성요소들은 상술한 용어에 의해 한정되지는 않는다. 상술한 용어는 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. Terms including ordinal numbers such as first and second may be used to describe various elements, but these elements are not limited by the above-described terms. The above-described terms are used only for the purpose of distinguishing one component from other components.

본 명세서에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다. 어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.In the present specification, terms such as "comprises" or "have" are intended to designate the presence of features, numbers, steps, actions, components, parts, or combinations thereof described in the specification, but one or more other features. It is to be understood that the presence or addition of elements or numbers, steps, actions, components, parts, or combinations thereof, does not preclude in advance. When a component is referred to as being "connected" or "connected" to another component, it is understood that it may be directly connected or connected to the other component, but other components may exist in the middle. Should be. On the other hand, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that there is no other component in the middle.

한편, 본 명세서에서 사용되는 구성요소에 대한 "모듈" 또는 "부"는 적어도 하나의 기능 또는 동작을 수행한다. 그리고, "모듈" 또는 "부"는 하드웨어, 소프트웨어 또는 하드웨어와 소프트웨어의 조합에 의해 기능 또는 동작을 수행할 수 있다. 또한, 특정 하드웨어에서 수행되어야 하거나 적어도 하나의 제어부에서 수행되는 "모듈" 또는 "부"를 제외한 복수의 "모듈들" 또는 복수의 "부들"은 적어도 하나의 모듈로 통합될 수도 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.Meanwhile, a "module" or "unit" for a component used in the present specification performs at least one function or operation. And, the "module" or "unit" may perform a function or operation by hardware, software, or a combination of hardware and software. In addition, a plurality of "modules" or a plurality of "units" excluding "module" or "unit" that must be performed in specific hardware or performed by at least one control unit may be integrated into at least one module. Singular expressions include plural expressions unless the context clearly indicates otherwise.

그 밖에도, 본 발명을 설명함에 있어서, 관련된 공지 기능 혹은 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우, 그에 대한 상세한 설명은 축약하거나 생략한다. 한편, 각 실시 예는 독립적으로 구현되거나 동작될 수도 있지만, 각 실시 예는 조합되어 구현되거나 동작될 수도 있다.In addition, in describing the present invention, when it is determined that a detailed description of a related known function or configuration may unnecessarily obscure the subject matter of the present invention, the detailed description thereof will be abbreviated or omitted. Meanwhile, each embodiment may be implemented or operated independently, but each embodiment may be implemented or operated in combination.

도 1은 본 개시의 일 실시 예에 따른 CAN(Controller Area Network) 시스템을 나타내는 도면이다.1 is a diagram illustrating a controller area network (CAN) system according to an embodiment of the present disclosure.

도 1을 참조하면, CAN 시스템(100)은 게이트웨이(110) 및 하나 이상의 ECU(Electronic Control Unit)(120-1, 120-2, 120-3, 120-4, 120-5)를 포함한다. 각 ECU 하나 이상의 ECU(120-1, 120-2, 120-3, 120-4, 120-5)는 상호간에 메시지를 송수신한다. 예를 들어, 제1 ECU(120-1)는 브로드캐스팅 방식으로 메시지를 처리해야 할 ECU에 관한 정보 및 우선 순위에 관한 정보를 포함하는 메시지를 전송하면, 나머지 ECU(120-2, 120-3, 120-3, 120-4, 120-5)는 제1 ECU(120-1)로부터 전송된 메시지를 수신하고, 메시지에 포함된 정보에 기초하여 특정 ECU만 우선 순위에 따라 수신된 메시지를 처리한다. 또한, 제1 ECU(120-1)는 동일한 방식에 따라 다른 ECU로부터 수신된 메시지를 처리한다. 즉, 각 ECU(120-1, 120-2, 120-3, 120-4, 120-5)는 상황에 따라 송신자 및 수신자의 역할을 수행할 수 있다.Referring to FIG. 1, the CAN system 100 includes a gateway 110 and one or more Electronic Control Units (ECUs) 120-1, 120-2, 120-3, 120-4, and 120-5. Each ECU At least one ECU (120-1, 120-2, 120-3, 120-4, 120-5) transmits and receives messages to each other. For example, if the first ECU 120-1 transmits a message including information on the ECU to process the message and priority information in a broadcasting method, the remaining ECUs 120-2 and 120-3 , 120-3, 120-4, 120-5) receives the message transmitted from the first ECU 120-1, and processes the received message according to the priority of only a specific ECU based on the information included in the message. do. Also, the first ECU 120-1 processes messages received from other ECUs according to the same method. That is, each of the ECUs 120-1, 120-2, 120-3, 120-4, and 120-5 may perform the role of a sender and a receiver according to a situation.

게이트웨이(110)는 CAN 시스템(100)을 외부의 다른 시스템 또는 네트워크와 연결하고 세션을 관리하며 MAC(Message Authentication Code) 생성시 사용되는 키를 변경하기 위한 갱신 메시지를 각 ECU로 전달한다. 세션은 메시지 인증을 위한 MAC를 생성할 때 사용될 해시 풀(hash pool)의 세션키의 시작점을 변경한 시점부터 다음 변경 시점까지의 시간 간격을 의미한다. 각 세션마다 MAC 생성에 사용되는 세션키의 시작점은 다르다. 만일, CAN 시스템(100)이 세션을 적용되지 않고 해시 풀의 특정 시점에 사용할 키의 시작 순서를 고정한 후 체인 세션키를 지속적으로 사용하는 경우, CAN 시스템(100)은 고정된 길이의 MAC로 인해 전수공격(brute forcing attacks)에 취약할 수 밖에 없다. 따라서, 해시 충돌없는 키를 가지는 해시 풀 내에서 세션키의 시작점을 주기적으로 변경할 수 있도록 세션이 설정됨으로써 CAN 시스템(100)은 전수공격에도 강인할 수 있다.The gateway 110 connects the CAN system 100 with other external systems or networks, manages a session, and transmits an update message to each ECU for changing a key used when generating a message authentication code (MAC). The session refers to the time interval from the time point when the start point of the session key of the hash pool to be used when generating the MAC for message authentication is changed to the next time point. The starting point of the session key used for MAC generation is different for each session. If the CAN system 100 does not apply the session and continuously uses the chain session key after fixing the starting order of the key to be used at a specific point in the hash pool, the CAN system 100 It is bound to be vulnerable to brute forcing attacks. Accordingly, the CAN system 100 can be robust against a total attack by setting up a session so that the starting point of the session key can be periodically changed in the hash pool having the key without hash collision.

게이트웨이(110)는 갱신 메시지를 모든 ECU(120-1, 120-2, 120-3, 120-4, 120-5)로 전송한다. 게이트웨이(110)는 키를 직접적으로 메시지에 포함시켜 전송하는 것이 아니라 각 ECU(120-1, 120-2, 120-3, 120-4, 120-5)가 세션키를 선택할 수 있는 난수(세션키 생성 난수)를 포함시켜 메시지를 전송한다. 즉, 게이트웨이(110)는 메시지 인증을 위한 세션키 생성 난수(rg(j))를 생성하여 각 ECU(120-1, 120-2, 120-3, 120-4, 120-5)로 전송한다.The gateway 110 transmits an update message to all ECUs 120-1, 120-2, 120-3, 120-4, and 120-5. The gateway 110 does not directly include the key in the message and transmits it, but rather a random number for each ECU (120-1, 120-2, 120-3, 120-4, 120-5) to select a session key (session The message is transmitted by including the key generation random number). That is, the gateway 110 generates a session key generation random number (r g (j)) for message authentication and transmits it to each ECU (120-1, 120-2, 120-3, 120-4, 120-5). do.

그리고, 복수의 ECU(120-1, 120-2, 120-3, 120-4, 120-5) 각각은 게이트웨이(110)로부터 수신한 세션키 생성 난수(rg(j))에 기초하여 세션키(Kj)를 생성한다. 이후, 복수의 ECU(120-1, 120-2, 120-3, 120-4, 120-5) 중 송신자 ECU는 생성된 세션키(Kj)와 MAC 생성 난수(re(Mk))에 기초하여 MAC를 생성하고, 생성된 MAC와 MAC 생성 난수(re(Mk))를 포함하는 메시지를 수신자 ECU로 전송한다. 상술한 바와 같이, CAN 시스템(100)의 송신자 ECU는 브로드캐스팅 방식으로 모든 ECU로 메시지를 전송하지만 메시지를 수신한 복수의 ECU 중 전송된 메시지와 관련된 특정 ECU만이 수신된 메시지를 처리한다. 결론적으로, 송신자 ECU는 수신자 ECU로 메시지를 전송한다.And, each of the plurality of ECUs (120-1, 120-2, 120-3, 120-4, 120-5) is based on the session key generated random number (r g (j)) received from the gateway 110 Generate the key (K j ). Thereafter, among a plurality of ECUs (120-1, 120-2, 120-3, 120-4, 120-5), the sender ECU is the generated session key (K j ) and the MAC generated random number (r e (M k )). A MAC is generated on the basis of, and a message including the generated MAC and the MAC generated random number (r e (M k )) is transmitted to the recipient ECU. As described above, the sender ECU of the CAN system 100 transmits a message to all ECUs in a broadcasting method, but only a specific ECU related to the transmitted message among the plurality of ECUs that received the message processes the received message. In conclusion, the sender ECU sends the message to the receiver ECU.

수신자 ECU는 생성된 세션키(Kj)와 수신된 MAC 생성 난수(re(Mk))에 기초하여 MAC를 생성한다. 그리고, 수신자 ECU는 수신된 MAC와 생성된 MAC의 동일성 여부를 판단하고, 동일한 경우 메시지를 인증한다.The receiver ECU generates a MAC based on the generated session key (K j ) and the received MAC generated random number (r e (M k )). Then, the recipient ECU determines whether the received MAC and the generated MAC are identical, and if they are the same, authenticates the message.

수신자 ECU가 메시지를 인증하는 구체적인 과정과 게이트웨이가 키를 갱신하는 과정은 후술한다.A detailed process by which the recipient ECU authenticates the message and a process by which the gateway updates the key will be described later.

도 2는 본 개시의 일 실시 예에 따른 해시 체인을 이용한 키 생성 방법과 해시 풀을 설명하는 도면이다.FIG. 2 is a diagram illustrating a key generation method and a hash pool using a hash chain according to an embodiment of the present disclosure.

해시 풀은 MAC 생성시에 사용되는 세션키들의 집합을 의미한다. 해시 풀은 동일한 해시 체인(또는, 해시 함수)으로 생성되는 것으로 키를 메모리에 저장하는 것이 아니라 해시 함수를 n번 연속 수행하여 생성되는 키들의 집합을 의미한다. 즉, 제1 ECU와 해시 체인의 i번째 세션키와 제2 ECU의 해시 체인의 i번째 세션키는 동일하다. 따라서, 모든 ECU는 하나의 가상 해시 풀을 가지도 있는 것과 같다.The hash pool refers to a set of session keys used in MAC generation. A hash pool is created with the same hash chain (or hash function), and refers to a set of keys generated by executing a hash function n consecutive times rather than storing a key in memory. That is, the i-th session key of the first ECU and the hash chain and the i-th session key of the hash chain of the second ECU are the same. So, it's like every ECU has one virtual hash pool.

해시 풀의 해시 체인의 키 사용 방향은 단방향 해시 함수의 사용 방향과 다르다. 즉, 본 개시의 해시 체인의 키 사용 방향은 생성 방향과 동일하다. 인증에 주로 사용되는 단방향 해시 체인키로 구성된 해시 풀이 사용되는 경우, 충분한 시간이 지나면 해시 충돌에 의해 일정량의 해시 키가 반복되며, 제한된 메모리를 가진 ECU에 충돌없는 해시 키를 충분히 가지는 해시 풀을 물리적으로 저장하는 것은 한계가 있다.The key usage direction of the hash chain of the hash pool is different from that of the one-way hash function. That is, the key usage direction of the hash chain of the present disclosure is the same as the generation direction. When a hash pool consisting of a one-way hash chain key, which is mainly used for authentication, is used, a certain amount of hash keys are repeated due to hash collisions after sufficient time, and an ECU with limited memory has a hash pool that has sufficient hash keys without collision. There is a limit to storing.

본 개시의 CAN 시스템은 단방향 해시 체인을 적용하지 않고, 해시 충돌없는 키를 가지는 해시 풀 내에서 MAC 생성 키를 결정하기 위해 게이트웨이의 난수를 이용함으로써 키 시작점의 노출 문제를 해결할 수 있다.The CAN system of the present disclosure can solve the problem of exposing a key start point by using a random number of a gateway to determine a MAC generation key in a hash pool having a hash collision-free key without applying a one-way hash chain.

게이트웨이는 세션키 생성 난수(rg(j))를 각 ECU로 전송하고, 각 ECU는 수신된 세션키 생성 난수(rg(j))를 기초로 생성한 동일한 세션키(Kj)를 사용한다. 생성한 세션키(Kj)는 현재 세션 j에서만 유효하며, 세션 변경시(세션 j에서 세션 j+1로 변경) 각 ECU는 게이트웨이로부터 새로 수신한 갱신된 세션키 생성 난수(rg(j+1))에 기초하여 해시 체인 함수를 수행할 수 있다. 게이트웨이는 기 설정된 시간마다 세션키 생성 난수를 갱신할 수 있다. 따라서, 각 ECU는 새로운 세션에서 MAC 생성을 위해 새로운 해시 풀의 세션키(

Figure 112018081613923-pat00001
)를 선택할 수 있다.The gateway transmits a session key generation random number (r g (j)) to each ECU, and each ECU uses the same session key (K j ) generated based on the received session key generation random number (r g (j)). do. The generated session key (K j ) is valid only in the current session j, and when the session is changed (changed from session j to session j+1), each ECU generates an updated session key newly received from the gateway (r g (j+ 1)) can perform the hash chain function. The gateway may update the session key generation random number every preset time. Therefore, each ECU has a new hash pool session key (
Figure 112018081613923-pat00001
) Can be selected.

아래에서는 송신자 ECU에서 수신자 ECU로 메시지를 보낼 때 메시지를 인증하는 과정에 대해 구체적으로 설명한다.Below, the process of authenticating a message when sending a message from the sender ECU to the receiver ECU will be described in detail.

도 3은 본 개시의 일 실시 예에 따른 ECU 간 메시지를 전송하고 인증하는 과정을 설명하는 타이밍도이다.3 is a timing diagram illustrating a process of transmitting and authenticating a message between ECUs according to an embodiment of the present disclosure.

도 3을 참조하면, 제1 ECU(120-1)와 제2 ECU(120-2)가 도시되어 있다. 제1 ECU(120-1)는 송신자 ECU이고, 제2 ECU(120-2)는 수신자 ECU일 수 있다.Referring to FIG. 3, a first ECU 120-1 and a second ECU 120-2 are shown. The first ECU 120-1 may be a sender ECU, and the second ECU 120-2 may be a receiver ECU.

제1 ECU(120-1)는 제1 메시지(M1)를 전송하기 위해 MAC 생성 난수(r1(M1))를 생성한다(S310). 제1 ECU(120-1)는 현재 세션키(Kj), MAC 생성 난수(r1(M1))에 기초하여 메시지 전송키(

Figure 112018081613923-pat00002
)를 생성한다(S320). 메시지 전송키(
Figure 112018081613923-pat00003
)는 현재 세션키(Kj)에서 MAC 생성 난수(r1(M1))의 크기 만큼 해시 함수를 사용하여 생성될 수 있다. 메시지 전송키(
Figure 112018081613923-pat00004
)는 송신하려는 단일 메시지에서만 유효하다. 제1 ECU(120-1)는 제1 MAC를 생성한다(S330). 제1 MAC는 데이터, MAC 생성 난수(r1(M1)) 및 메시지 전송키(
Figure 112018081613923-pat00005
)에 해시 함수를 사용하여 생성될 수 있다. 제1 ECU(120-1)는 메시지의 데이터 필드에 데이터, MAC 생성 난수(r1(M1)) 및 제1 MAC를 포함시켜 제1 메시지(M1)를 제2 ECU(120-2)로 전송한다(S340).The first ECU 120-1 generates a MAC-generated random number (r 1 (M 1 )) to transmit the first message (M 1 ) (S310). The first ECU 120-1 is based on the current session key (K j ) and the MAC generated random number (r 1 (M 1 )).
Figure 112018081613923-pat00002
) Is generated (S320). Message transmission key (
Figure 112018081613923-pat00003
) Can be generated using a hash function as much as the size of the MAC generated random number (r 1 (M 1 )) in the current session key (K j ). Message transmission key (
Figure 112018081613923-pat00004
) Is only valid for a single message to be sent. The first ECU 120-1 generates a first MAC (S330). The first MAC is data, a MAC generated random number (r 1 (M 1 )) and a message transmission key (
Figure 112018081613923-pat00005
) Can be created using a hash function. The first ECU 120-1 includes data, a MAC-generated random number (r 1 (M 1 )) and a first MAC in the data field of the message, and sends the first message M 1 to the second ECU 120-2. It is transmitted to (S340).

제2 ECU(120-2)는 제1 ECU(120-1)로부터 제1 메시지(M1)를 수신한다. 제2 ECU(120-2)는 제1 메시지(M1)에 포함된 MAC 생성 난수(r1(M1))에 기초하여 메시지 수신키(

Figure 112018081613923-pat00006
)를 생성한다(S350). 메시지 수신키(
Figure 112018081613923-pat00007
)는 현재 세션키(Kj)에서 수신된 MAC 생성 난수(r1(M1))의 크기 만큼 해시 함수를 사용하여 생성될 수 있다. 제2 ECU(120-2)는 제2 MAC를 생성한다(S360). 제2 MAC는 데이터, 수신된 MAC 생성 난수(r1(M1)) 및 생성된 메시지 수신키(
Figure 112018081613923-pat00008
)에 해시 함수를 사용하여 생성될 수 있다. 제2 ECU(120-2)는 MAC를 인증한다(S370). 제2 ECU(120-2)는 수신된 제1 MAC와 생성된 제2 MAC를 비교하여 동일한지 여부를 판단한다. 제2 ECU(120-2)는 제1 MAC와 제2 MAC가 동일하면 수신된 제1 메시지를 처리하고, 동일하지 않으면 수신된 제1 메시지를 버린다. 상술한 과정을 통해 CAN 시스템은 송수신되는 메시지를 인증할 수 있다.The second ECU 120-2 receives the first message M 1 from the first ECU 120-1. The second ECU 120-2 is based on the MAC generated random number (r 1 (M 1 )) included in the first message (M 1 ), the message receiving key (
Figure 112018081613923-pat00006
) Is generated (S350). Message receiving key (
Figure 112018081613923-pat00007
) Can be generated using a hash function as much as the size of the MAC generated random number (r 1 (M 1 )) received from the current session key (K j ). The second ECU 120-2 generates a second MAC (S360). The second MAC is data, the received MAC generated random number (r 1 (M 1 )) and the generated message reception key (
Figure 112018081613923-pat00008
) Can be created using a hash function. The second ECU 120-2 authenticates the MAC (S370). The second ECU 120-2 compares the received first MAC with the generated second MAC and determines whether they are the same. If the first MAC and the second MAC are the same, the second ECU 120-2 processes the received first message, and if not, discards the received first message. Through the above-described process, the CAN system can authenticate the transmitted/received message.

한편, CAN 시스템은 보안을 위해 기 설정된 시간마다 현재 세션키(Kj)를 갱신할 수 있다. 아래에서는 CAN 시스템이 세션키를 갱신하는 과정을 설명한다.Meanwhile, the CAN system may update the current session key (K j ) every preset time for security. The following describes the process of updating the session key by the CAN system.

도 4는 본 개시의 일 실시 예에 따른 세션키를 갱신하는 과정을 설명하는 타이밍도이다.4 is a timing diagram illustrating a process of updating a session key according to an embodiment of the present disclosure.

도 4를 참조하면, 게이트웨이(110), 제1 ECU(120-1), 제2 ECU(120-2) 및 제3 ECU(120-3)가 도시되어 있다. 게이트웨이(110)는 일정 간격으로 세션을 변경하기 위해 갱신된 세션키 생성 난수(rg(j+1))를 생성할 수 있다(S405). 게이트웨이(110)는 세션 갱신 메시지(M2)를 전송하기 위해 세션 갱신 MAC 생성 난수(rg(M2))를 생성할 수 있다(S410). 게이트웨이(110)는 현재 세션키(Kj), 세션 갱신 MAC 생성 난수(rg(M2))에 기초하여 갱신 전송키(

Figure 112018081613923-pat00009
)를 생성할 수 있다(S415). 갱신 전송키(
Figure 112018081613923-pat00010
)는 현재 세션키(Kj)에서 세션 갱신 MAC 생성 난수(rg(M2))의 크기 만큼 해시 함수를 사용하여 생성될 수 있다. 게이트웨이(110)는 제1 갱신 MAC를 생성한다(S420). 제1 갱신 MAC은 갱신 데이터, 세션 갱신 MAC 생성 난수(rg(M2)) 및 갱신 전송키(
Figure 112018081613923-pat00011
)에 해시 함수를 사용하여 생성될 수 있다. 게이트웨이(110)는 메시지의 데이터 필드에 갱신 데이터, 세션 갱신 MAC 생성 난수(rg(M2)), 갱신된 세션키 생성 난수(rg(j+1)) 및 제1 갱신 MAC를 포함시켜 세션 갱신 메시지(M2)를 제1 내지 제3 ECU(120-1, 120-2, 120-3)로 전송할 수 있다(S425). 즉, 게이트웨이(110)는 갱신된 세션키 생성 난수(rg(j+1))를 포함하는 세션 갱신 메시지(M2)를 모든 ECU에 브로드캐스트할 수 있다. 그리고, 게이트웨이(110)는 갱신된 세션키 생성 난수(rg(j+1))에 해시 함수를 사용하여 새로운 세션키(Kj+1)를 생성하고, 현재 세션키(Kj)를 새로운 세션키(Kj+1)로 변경할 수 있다(S430).4, a gateway 110, a first ECU 120-1, a second ECU 120-2, and a third ECU 120-3 are illustrated. The gateway 110 may generate an updated session key generation random number (r g (j+1)) to change the session at regular intervals (S405). The gateway 110 may generate a session update MAC generation random number (r g (M 2 )) to transmit the session update message (M 2 ) (S410). The gateway 110 is based on the current session key (K j ) and the session update MAC generated random number (r g (M 2 )).
Figure 112018081613923-pat00009
) Can be generated (S415). Update transfer key (
Figure 112018081613923-pat00010
) Can be generated using a hash function as much as the size of the session update MAC random number (r g (M 2 )) in the current session key (K j ). The gateway 110 generates a first update MAC (S420). The first update MAC is the update data, the session update MAC generation random number (r g (M 2 )), and the update transmission key (
Figure 112018081613923-pat00011
) Can be created using a hash function. The gateway 110 includes update data, a session update MAC random number (r g (M 2 )), an updated session key generation random number (r g (j+1)), and a first update MAC in the data field of the message. The session update message M 2 may be transmitted to the first to third ECUs 120-1, 120-2 and 120-3 (S425 ). That is, the gateway 110 may broadcast a session update message M 2 including the updated session key generation random number r g (j+1) to all ECUs. In addition, the gateway 110 generates a new session key (K j+1 ) using a hash function on the updated session key generation random number (r g (j+1)), and creates a new session key (K j ). It can be changed with the session key (K j+1 ) (S430).

제1 내지 제3 ECU(120-1, 120-2, 120-3)는 게이트웨이(110)로부터 세션 갱신 메시지(M2)를 수신할 수 있다. 복수의 ECU(120-1, 120-2, 120-3) 각각은 동일한 방식으로 세션 갱신 메시지(M2)를 인증하고, 세션키를 변경할 수 있다. 아래에서는 대표적으로 제1 ECU(120-1)를 중심으로 설명한다.The first to third ECUs 120-1, 120-2, and 120-3 may receive a session update message M 2 from the gateway 110. Each of the plurality of ECUs 120-1, 120-2, and 120-3 may authenticate the session update message M 2 and change the session key in the same manner. Hereinafter, a representative description will be given centering on the first ECU 120-1.

제1 ECU(120-1)는 세션 갱신 메시지(M2)에 포함된 세션 갱신 MAC 생성 난수(rg(M2))에 기초하여 갱신 수신키(

Figure 112018081613923-pat00012
)를 생성할 수 있다(S435). 갱신 수신키(
Figure 112018081613923-pat00013
)는 현재 세션키(Kj)에서 수신된 세션 갱신 MAC 생성 난수(rg(M2))의 크기 만큼 해시 함수를 사용하여 생성될 수 있다. 제1 ECU(120-1)는 제2 갱신 MAC를 생성할 수 있다(S440). 제2 갱신 MAC는 갱신 데이터, 수신된 세션 갱신 MAC 생성 난수(rg(M2)) 및 생성된 갱신 수신키(
Figure 112018081613923-pat00014
)에 해시 함수를 사용하여 생성될 수 있다. 제1 ECU(120-1)는 MAC를 인증할 수 있다(S445). 제1 ECU(120-1)는 수신된 제1 갱신 MAC와 생성된 제2 갱신 MAC를 비교하여 동일한지 여부를 판단할 수 있다. 제1 ECU(120-1)는 제1 갱신 MAC와 제2 갱신 MAC가 동일하면 수신된 세션 갱신 메시지(M2)를 처리하고, 동일하지 않으면 수신된 세션 갱신 메시지(M2)를 버릴 수 있다. 세션 갱신 메시지(M2)가 인증되면 제1 ECU(120-1)는 세션변경 절차를 수행할 수 있다. 제1 ECU(120-1)는 수신한 세션키 생성 난수(rg(j+1))의 크기 만큼 해시 함수를 사용하여 새로운 세션키(Kj+1)를 생성하고, 현재 세션키(Kj)를 새로운 세션키(Kj+1)로 변경할 수 있다(S450).The first ECU 120-1 is based on the session update MAC generation random number (r g (M 2 )) included in the session update message (M 2 ).
Figure 112018081613923-pat00012
) Can be generated (S435). Update receiving key (
Figure 112018081613923-pat00013
) May be generated using a hash function as much as the size of the session update MAC generation random number (r g (M 2 )) received from the current session key (K j ). The first ECU 120-1 may generate a second update MAC (S440). The second update MAC is the update data, the received session update MAC generated random number (r g (M 2 )) and the generated update receiving key (
Figure 112018081613923-pat00014
) Can be created using a hash function. The first ECU 120-1 may authenticate the MAC (S445). The first ECU 120-1 may compare the received first update MAC and the generated second update MAC to determine whether they are the same. The first ECU 120-1 may process the received session update message M 2 if the first update MAC and the second update MAC are the same, and discard the received session update message M 2 if they are not the same. . When the session update message M 2 is authenticated, the first ECU 120-1 may perform a session change procedure. The first ECU 120-1 generates a new session key (K j+1 ) using a hash function as much as the size of the received session key generation random number (r g (j+1)), and the current session key (K j ) can be changed to a new session key (K j+1 ) (S450).

지금까지 CAN 시스템의 메시지 인증 방법의 실시 예를 설명하였다. 아래에서는 메시지 인증 방법의 흐름도를 설명한다.So far, an embodiment of the message authentication method of the CAN system has been described. The flow chart of the message authentication method is described below.

도 5는 본 개시의 일 실시 예에 따른 CAM 시스템의 메시지 인증 방법의 흐름도이다.5 is a flowchart of a message authentication method of a CAM system according to an embodiment of the present disclosure.

게이트웨이는 세션키 생성 난수(rg(j))를 생성하여 복수의 ECU로 전송한다(S510). 복수의 ECU는 수신한 세션키 생성 난수(rg(j))에 기초하여 세션키(Kj)를 생성한다(S520). 생성된 세션키(Kj)는 현재 세션(세션 j)에서만 유효하다.The gateway generates a session key generation random number (r g (j)) and transmits it to a plurality of ECUs (S510). The plurality of ECUs generate a session key (K j ) based on the received session key generation random number (r g (j)) (S520). The generated session key (K j ) is valid only in the current session (session j).

복수의 ECU 중 제1 ECU(송신자 ECU)는 생성된 세션키(Kj)와 MAC 생성 난수(re(Mk))에 기초하여 제1 MAC를 생성한다(S530). 제1 ECU는 세션키(Kj)와 MAC 생성 난수(re(Mk))에 기초하여 메시지 전송키(

Figure 112018081613923-pat00015
)를 생성하고, 메시지 전송키(
Figure 112018081613923-pat00016
), MAC 생성 난수(re(Mk)) 및 데이터에 기초하여 제1 MAC를 생성한다.Among the plurality of ECUs, the first ECU (sender ECU) generates a first MAC based on the generated session key K j and the MAC generated random number r e (M k ) (S530). The first ECU is based on a session key (K j ) and a MAC generated random number (r e (M k )).
Figure 112018081613923-pat00015
), and the message transmission key (
Figure 112018081613923-pat00016
), a MAC generated random number (r e (M k )), and a first MAC based on data.

제1 ECU는 생성된 제1 MAC와 MAC 생성 난수(re(Mk))를 포함하는 메시지(Mk)를 복수의 ECU 중 제2 ECU(수신자 ECU)로 전송한다(S540). 제1 ECU는 제1 MAC, MAC 생성 난수(re(Mk)) 및 데이터를 메시지(Mk)의 데이터 필드에 포함시켜 제2 ECU로 전송한다.The first ECU transmits a message (M k ) including the generated first MAC and a MAC generated random number (r e (M k )) to a second ECU (recipient ECU) among the plurality of ECUs (S540). The first ECU includes the first MAC, the MAC-generated random number r e (M k ), and data in the data field of the message M k and transmits it to the second ECU.

제2 ECU는 생성된 세션키(Kj)와 수신된 MAC 생성 난수(re(Mk))에 기초하여 제2 MAC를 생성한다(S550). 제2 ECU는 세션키(Kj)와 수신된 메시지(Mk)의 데이터 필드에 포함된 MAC 생성 난수(re(Mk))에 기초하여 메시지 수신키(

Figure 112018081613923-pat00017
)를 생성하고, 메시지 수신키(
Figure 112018081613923-pat00018
), MAC 생성 난수(re(Mk)) 및 데이터에 기초하여 제2 MAC를 생성한다.The second ECU generates a second MAC based on the generated session key (K j ) and the received MAC generated random number (r e (M k )) (S550). The second ECU is based on the session key (K j ) and the MAC-generated random number (r e (M k )) included in the data field of the received message (M k ).
Figure 112018081613923-pat00017
), and a message receiving key (
Figure 112018081613923-pat00018
), a second MAC is generated based on the MAC generated random number (r e (M k )) and data.

제2 ECU는 수신된 제1 MAC와 생성된 제2 MAC의 동일성 여부를 판단하여 수신된 메시지를 인증한다(S560). 제2 ECU(120-2)는 제1 MAC와 제2 MAC를 비교하여 동일한지 여부를 판단한다. 제2 ECU(120-2)는 제1 MAC와 제2 MAC가 동일하면 수신된 메시지를 처리하고, 동일하지 않으면 수신된 메시지를 버린다. 상술한 과정을 통해 CAN 시스템은 송수신되는 메시지를 인증할 수 있다.The second ECU authenticates the received message by determining whether the received first MAC and the generated second MAC are identical (S560). The second ECU 120-2 compares the first MAC and the second MAC to determine whether they are the same. If the first MAC and the second MAC are the same, the second ECU 120-2 processes the received message, and if not, discards the received message. Through the above-described process, the CAN system can authenticate the transmitted/received message.

상술한 다양한 실시 예에 따른 CAN 시스템의 메시지 인증 방법은 컴퓨터 프로그램 제품으로 제공될 수도 있다. 컴퓨터 프로그램 제품은 S/W 프로그램 자체 또는 S/W 프로그램이 저장된 비일시적 판독 가능 매체(non-transitory computer readable medium)를 포함할 수 있다.The message authentication method of the CAN system according to the various embodiments described above may be provided as a computer program product. The computer program product may include the S/W program itself or a non-transitory computer readable medium in which the S/W program is stored.

비일시적 판독 가능 매체란 레지스터, 캐쉬, 메모리 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 구체적으로는, 상술한 다양한 어플리케이션 또는 프로그램들은 CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리카드, ROM 등과 같은 비일시적 판독 가능 매체에 저장되어 제공될 수 있다. The non-transitory readable medium refers to a medium that stores data semi-permanently and can be read by a device, not a medium that stores data for a short moment, such as a register, cache, or memory. Specifically, the above-described various applications or programs may be provided by being stored in a non-transitory readable medium such as a CD, DVD, hard disk, Blu-ray disk, USB, memory card, and ROM.

또한, 이상에서는 본 발명의 바람직한 실시 예에 대하여 도시하고 설명하였지만, 본 발명은 상술한 특정의 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 발명의 기술적 사상이나 전망으로부터 개별적으로 이해되어져서는 안될 것이다.In addition, although the preferred embodiments of the present invention have been illustrated and described above, the present invention is not limited to the specific embodiments described above, and the technical field to which the present invention belongs without departing from the gist of the present invention claimed in the claims. In addition, various modifications are possible by those of ordinary skill in the art, and these modifications should not be individually understood from the technical spirit or prospect of the present invention.

100: CAN 시스템 110: 게이트웨이
120-1, 120-2, 120-3, 120-4, 120-5: ECU
100: CAN system 110: Gateway
120-1, 120-2, 120-3, 120-4, 120-5: ECU

Claims (14)

상호 간에 메시지를 송수신하는 복수의 ECU(Electronic Control Unit); 및
세션키 생성 난수를 생성하여 상기 복수의 ECU로 전송하는 게이트웨이;를 포함하며,
상기 복수의 ECU는,
상기 수신한 세션키 생성 난수에 기초하여 세션키를 생성하고,
상기 복수의 ECU 중 제1 ECU는,
상기 생성된 세션키와 MAC 생성 난수에 기초하여 제1 MAC(Message Authentication Code)를 생성하고, 상기 생성된 제1 MAC와 상기 MAC 생성 난수를 포함하는 메시지를 상기 복수의 ECU 중 제2 ECU로 전송하며,
상기 제2 ECU는,
상기 생성된 세션키와 상기 수신된 MAC 생성 난수에 기초하여 제2 MAC를 생성하고, 상기 수신된 제1 MAC와 상기 생성된 제2 MAC의 동일성 여부를 판단하여 상기 수신된 메시지를 인증하고,
상기 게이트웨이는,
상기 세션키 생성 난수를 기 설정된 시간마다 갱신하고, 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신하며, 상기 세션키와 세션 갱신 MAC 생성 난수에 기초하여 갱신 전송키를 생성하고, 상기 생성된 갱신 전송키, 상기 세션 갱신 MAC 생성 난수 및 갱신 데이터에 기초하여 제1 갱신 MAC를 생성하며, 상기 생성된 제1 갱신 MAC, 상기 갱신된 세션키 생성 난수, 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터를 갱신 메시지의 데이터 필드에 포함시켜 상기 복수의 ECU로 전송하는, CAN(Controller Area Network) 시스템.
A plurality of electronic control units (ECUs) for transmitting and receiving messages to and from each other; And
Includes; a gateway for generating a session key generation random number and transmitting it to the plurality of ECUs,
The plurality of ECUs,
Generate a session key based on the received session key generation random number,
The first ECU among the plurality of ECUs,
Generates a first MAC (Message Authentication Code) based on the generated session key and the MAC generated random number, and transmits a message including the generated first MAC and the MAC generated random number to a second ECU among the plurality of ECUs And
The second ECU,
A second MAC is generated based on the generated session key and the received MAC generated random number, and the received message is authenticated by determining whether the received first MAC and the generated second MAC are identical,
The gateway,
Updates the session key generation random number every preset time, updates the session key based on the updated session key generation random number and hash function, and generates an update transmission key based on the session key and session update MAC generation random number And generates a first update MAC based on the generated update transmission key, the session update MAC generation random number, and update data, and the generated first update MAC, the updated session key generation random number, and the session update MAC generation A controller area network (CAN) system that includes a random number and the update data in a data field of an update message and transmits it to the plurality of ECUs.
제1항에 있어서,
상기 제1 ECU는,
상기 세션키와 상기 MAC 생성 난수에 기초하여 메시지 전송키를 생성하고, 상기 생성된 메시지 전송키, 상기 MAC 생성 난수 및 데이터에 기초하여 제1 MAC를 생성하며, 상기 생성된 제1 MAC, 상기 MAC 생성 난수 및 상기 데이터를 상기 메시지의 데이터 필드에 포함시켜 상기 제2 ECU로 전송하는 CAN 시스템.
The method of claim 1,
The first ECU,
Generates a message transmission key based on the session key and the MAC generated random number, generates a first MAC based on the generated message transmission key, the MAC generated random number, and data, the generated first MAC, the MAC A CAN system that includes the generated random number and the data in a data field of the message and transmits it to the second ECU.
제2항에 있어서,
상기 제2 ECU는,
상기 세션키와 상기 수신된 메시지의 데이터 필드에 포함된 MAC 생성 난수에 기초하여 메시지 수신키를 생성하고, 상기 생성된 메시지 수신키, 상기 데이터 필드에 포함된 상기 MAC 생성 난수 및 상기 데이터에 기초하여 제2 MAC를 생성하는 CAN 시스템.
The method of claim 2,
The second ECU,
A message reception key is generated based on the session key and a MAC generated random number included in the data field of the received message, and based on the generated message reception key, the MAC generated random number included in the data field, and the data CAN system to generate a second MAC.
삭제delete 삭제delete 삭제delete 제1항에 있어서,
상기 복수의 ECU 각각은,
상기 세션키와 상기 수신된 갱신 메시지의 데이터 필드에 포함된 세션 갱신 MAC 생성 난수에 기초하여 갱신 수신키를 생성하고, 상기 생성된 갱신 수신키, 상기 데이터 필드에 포함된 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터에 기초하여 제2 갱신 MAC를 생성하며, 상기 수신된 제1 갱신 MAC와 상기 생성된 제2 갱신 MAC의 동일성 여부를 판단하여 상기 수신된 갱신 메시지를 인증하고, 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신하는 CAN 시스템.
The method of claim 1,
Each of the plurality of ECUs,
An update reception key is generated based on the session key and a session update MAC generation random number included in the data field of the received update message, and the generated update reception key, the session update MAC generation random number included in the data field, and Generate a second update MAC based on the update data, determine whether the received first update MAC and the generated second update MAC are identical to authenticate the received update message, and generate the updated session key CAN system for updating the session key based on a random number and a hash function.
게이트웨이가 세션키 생성 난수를 생성하여 복수의 ECU로 전송하는 단계;
상기 복수의 ECU가 상기 수신한 세션키 생성 난수에 기초하여 세션키를 생성하는 단계;
상기 복수의 ECU 중 제1 ECU가 상기 생성된 세션키와 MAC 생성 난수에 기초하여 제1 MAC를 생성하는 단계;
상기 제1 ECU가 상기 생성된 제1 MAC와 상기 MAC 생성 난수를 포함하는 메시지를 상기 복수의 ECU 중 제2 ECU로 전송하는 단계;
상기 제2 ECU가 상기 생성된 세션키와 상기 수신된 MAC 생성 난수에 기초하여 제2 MAC를 생성하는 단계;
상기 제2 ECU가 상기 수신된 제1 MAC와 상기 생성된 제2 MAC의 동일성 여부를 판단하여 상기 수신된 메시지를 인증하는 단계;
상기 세션키를 갱신하는 단계;를 더 포함하고,
상기 세션키를 갱신하는 단계는,
상기 게이트웨이가 상기 세션키 생성 난수를 기 설정된 시간마다 갱신하고, 상기 게이트웨이가 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신하며, 상기 게이트웨이가 상기 세션키와 세션 갱신 MAC 생성 난수에 기초하여 갱신 전송키를 생성하고, 상기 생성된 갱신 전송키, 상기 세션 갱신 MAC 생성 난수 및 갱신 데이터에 기초하여 제1 갱신 MAC를 생성하며, 상기 생성된 제1 갱신 MAC, 상기 갱신된 세션키 생성 난수, 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터를 갱신 메시지의 데이터 필드에 포함시켜 상기 복수의 ECU로 전송하는, CAM 시스템의 메시지 인증 방법.
Generating, by the gateway, a random number for generating a session key and transmitting it to a plurality of ECUs;
Generating, by the plurality of ECUs, a session key based on the received session key generation random number;
Generating, by a first ECU among the plurality of ECUs, a first MAC based on the generated session key and a MAC generated random number;
Transmitting, by the first ECU, a message including the generated first MAC and the MAC-generated random number to a second ECU among the plurality of ECUs;
Generating, by the second ECU, a second MAC based on the generated session key and the received MAC generated random number;
Authenticating the received message by determining, by the second ECU, whether the received first MAC and the generated second MAC are identical;
Updating the session key; further comprising,
The step of updating the session key,
The gateway updates the session key generation random number every preset time, the gateway updates the session key based on the updated session key generation random number and hash function, and the gateway generates the session key and session update MAC Generates an update transport key based on a random number, generates a first update MAC based on the generated update transport key, the session update MAC generated random number, and update data, the generated first update MAC, the updated session A message authentication method of a CAM system, including a key generation random number, the session update MAC generation random number, and the update data in a data field of an update message and transmitting them to the plurality of ECUs.
제8항에 있어서,
상기 제1 MAC를 생성하는 단계는,
상기 세션키와 상기 MAC 생성 난수에 기초하여 메시지 전송키를 생성하고, 상기 생성된 메시지 전송키, 상기 MAC 생성 난수 및 데이터에 기초하여 제1 MAC를 생성하고,
상기 제2 ECU로 전송하는 단계는,
상기 생성된 제1 MAC, 상기 MAC 생성 난수 및 상기 데이터를 상기 메시지의 데이터 필드에 포함시켜 상기 제2 ECU로 전송하는 CAM 시스템의 메시지 인증 방법.
The method of claim 8,
The step of generating the first MAC,
Generate a message transmission key based on the session key and the MAC generated random number, generate a first MAC based on the generated message transmission key, the MAC generated random number and data,
The step of transmitting to the second ECU,
A message authentication method of a CAM system for including the generated first MAC, the MAC generated random number, and the data in a data field of the message and transmitting the data to the second ECU.
제9항에 있어서,
상기 제2 MAC를 생성하는 단계는,
상기 세션키와 상기 수신된 메시지의 데이터 필드에 포함된 MAC 생성 난수에 기초하여 메시지 수신키를 생성하고, 상기 생성된 메시지 수신키, 상기 데이터 필드에 포함된 상기 MAC 생성 난수 및 상기 데이터에 기초하여 제2 MAC를 생성하는 CAM 시스템의 메시지 인증 방법.
The method of claim 9,
The step of generating the second MAC,
A message reception key is generated based on the session key and a MAC generated random number included in the data field of the received message, and based on the generated message reception key, the MAC generated random number included in the data field, and the data Message authentication method of a CAM system that generates a second MAC.
삭제delete 삭제delete 삭제delete 제8항에 있어서,
상기 세션키를 갱신하는 단계는,
상기 복수의 ECU 각각이 상기 세션키와 상기 수신된 갱신 메시지의 데이터 필드에 포함된 세션 갱신 MAC 생성 난수에 기초하여 갱신 수신키를 생성하고, 상기 생성된 갱신 수신키, 상기 데이터 필드에 포함된 상기 세션 갱신 MAC 생성 난수 및 상기 갱신 데이터에 기초하여 제2 갱신 MAC를 생성하며, 상기 수신된 제1 갱신 MAC와 상기 생성된 제2 갱신 MAC의 동일성 여부를 판단하여 상기 수신된 갱신 메시지를 인증하고, 상기 갱신된 세션키 생성 난수 및 해시 함수에 기초하여 상기 세션키를 갱신하는 CAM 시스템의 메시지 인증 방법.
The method of claim 8,
The step of updating the session key,
Each of the plurality of ECUs generates an update reception key based on the session key and a random number of session update MAC generations included in the data field of the received update message, and the generated update reception key, the update reception key included in the data field. A second update MAC is generated based on the session update MAC generated random number and the update data, and the received update message is authenticated by determining whether the received first update MAC and the generated second update MAC are identical, A message authentication method of a CAM system for updating the session key based on the updated session key generation random number and a hash function.
KR1020180096307A 2018-08-17 2018-08-17 Controller area network system and message authentication method KR102148453B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180096307A KR102148453B1 (en) 2018-08-17 2018-08-17 Controller area network system and message authentication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180096307A KR102148453B1 (en) 2018-08-17 2018-08-17 Controller area network system and message authentication method

Publications (2)

Publication Number Publication Date
KR20200020515A KR20200020515A (en) 2020-02-26
KR102148453B1 true KR102148453B1 (en) 2020-08-27

Family

ID=69637973

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180096307A KR102148453B1 (en) 2018-08-17 2018-08-17 Controller area network system and message authentication method

Country Status (1)

Country Link
KR (1) KR102148453B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953384B (en) * 2020-07-17 2021-07-16 杭州铭盛威科技有限公司 Communication address sending method and device, electric energy meter and storage medium
JP7380530B2 (en) * 2020-11-13 2023-11-15 トヨタ自動車株式会社 Vehicle communication system, communication method and communication program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101481403B1 (en) 2013-08-26 2015-01-21 고려대학교 산학협력단 Data certification and acquisition method for vehicle
WO2016075865A1 (en) 2014-11-12 2016-05-19 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Update management method, update management device, and control program
KR101740957B1 (en) * 2016-01-15 2017-05-30 고려대학교 산학협력단 Data certification and acquisition method for vehicle
JP2017174111A (en) 2016-03-23 2017-09-28 株式会社東芝 On-vehicle gateway device, accumulation control method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101481403B1 (en) 2013-08-26 2015-01-21 고려대학교 산학협력단 Data certification and acquisition method for vehicle
WO2016075865A1 (en) 2014-11-12 2016-05-19 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Update management method, update management device, and control program
KR101740957B1 (en) * 2016-01-15 2017-05-30 고려대학교 산학협력단 Data certification and acquisition method for vehicle
JP2017174111A (en) 2016-03-23 2017-09-28 株式会社東芝 On-vehicle gateway device, accumulation control method, and program

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A. Menezes 외 2명, Handbook of Applied Cryptography, Chapter.1, CRC Press (1996.)*
A. Menezes 외 2명, Handbook of Applied Cryptography, Chapter.10, CRC Press (1996.)*
A. Menezes 외 2명, Handbook of Applied Cryptography, Chapter.12, CRC Press (1996.)*

Also Published As

Publication number Publication date
KR20200020515A (en) 2020-02-26

Similar Documents

Publication Publication Date Title
US10708248B2 (en) Vehicle and method for controlling same
Schweppe et al. Car2x communication: securing the last meter-a cost-effective approach for ensuring trust in car2x applications using in-vehicle symmetric cryptography
Lin et al. Cyber-security for the controller area network (CAN) communication protocol
Van Herrewege et al. CANAuth-a simple, backward compatible broadcast authentication protocol for CAN bus
US20200226252A1 (en) Anti-Spoofing Defense System for a Can Bus
EP3537741B1 (en) Machine-to-machine node erase procedure
US11843697B2 (en) Communication device and method using message history-based security key by means of blockchain
Hafeez et al. Comparative study of can-bus and flexray protocols for in-vehicle communication
Kang et al. An attack-resilient source authentication protocol in controller area network
KR102364656B1 (en) Apparatus and method for generating and operating dynamic can id based on hmac
KR101882694B1 (en) Method and system for transceiving can message including mac
Püllen et al. Using implicit certification to efficiently establish authenticated group keys for in-vehicle networks
KR102148453B1 (en) Controller area network system and message authentication method
CN107836095A (en) Method for producing secret or key in a network
US11388156B2 (en) Proof-of-work concept for a vehicle
Murvay et al. Accommodating time-triggered authentication to FlexRay demands
Carsten et al. A system to recognize intruders in controller area network (can)
US10841085B2 (en) Method for generating a secret or a key in a network
CN113300847A (en) Authentication without pre-knowledge of credentials
CN108141359A (en) For generating common secret method and apparatus
Kang A practical and lightweight source authentication protocol using one-way hash chain in can
KR102398764B1 (en) Method and apparatus of securing message in network for vehicle
WO2020246989A1 (en) Cryptographic key management for end-to-end communication security
Xia et al. A secure design for practical identity-anonymized can application
CN114826602B (en) Security-aware time-sensitive network scheduling method, system, device and medium

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right