KR20170123211A - Data communication method for vehicle, Electronic Control Unit and system thereof - Google Patents

Data communication method for vehicle, Electronic Control Unit and system thereof Download PDF

Info

Publication number
KR20170123211A
KR20170123211A KR1020160106139A KR20160106139A KR20170123211A KR 20170123211 A KR20170123211 A KR 20170123211A KR 1020160106139 A KR1020160106139 A KR 1020160106139A KR 20160106139 A KR20160106139 A KR 20160106139A KR 20170123211 A KR20170123211 A KR 20170123211A
Authority
KR
South Korea
Prior art keywords
vehicle
counter value
control unit
vehicle data
value
Prior art date
Application number
KR1020160106139A
Other languages
Korean (ko)
Other versions
KR102287775B1 (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
Priority claimed from KR1020160052488A external-priority patent/KR101651648B1/en
Application filed by 인포뱅크 주식회사 filed Critical 인포뱅크 주식회사
Priority to KR1020160106139A priority Critical patent/KR102287775B1/en
Publication of KR20170123211A publication Critical patent/KR20170123211A/en
Application granted granted Critical
Publication of KR102287775B1 publication Critical patent/KR102287775B1/en

Links

Images

Classifications

    • 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
    • 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/40006Architecture of a communication node
    • H04L12/40013Details regarding a bus controller
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present invention relates to a data communication method for a vehicle, an electronic control device for a vehicle using the same, and a system thereof. Provided is a communication method for transmitting and receiving data for a vehicle between control units in a vehicle including a plurality of control units includes the steps of: receiving data for a vehicle; receiving a message authentication value; and decoding the received data for a vehicle using a counter value shared with the control unit of a transmission side after the received message authentication value is authenticated. The counter value is valid for a predetermined time section corresponding to the counter value. Accordingly, the present invention can enhance security and improve communication efficiency at the same time.

Description

차량용 데이터 통신 방법 및 그를 이용하는 차량용 전자 제어 장치 및 시스템{Data communication method for vehicle, Electronic Control Unit and system thereof}BACKGROUND OF THE INVENTION 1. Field of the Invention [0001] The present invention relates to a vehicular data communication method and a vehicle electronic control apparatus and system using the same,

본 발명은 차량 내 전자 제어 장치인 ECU(Electronic Control Unit) 간의 통신 방법에 관한 것이다.The present invention relates to a communication method between ECUs (Electronic Control Units) which is an in-vehicle electronic control unit.

최근의 차량 기술은 차량 본연의 기능 외에도 안전성, 사용자의 편의성, 타 분야의 기기와의 통신을 통한 다양한 서비스의 제공 등에 초점을 맞추어 개발되고 있다.In addition to the functions of the vehicle itself, recent vehicle technology has been developed focusing on safety, user convenience, and various services through communication with other devices.

그에 따라, 차량 내부에 탑재되는 전자 제어 장치인 ECU(Electronic Control Unit)들의 개수가 급격히 증가 되고 있으며, 상기 ECU들 간의 통신은 CAN(Controller Area Networks)을 통해 이루어진다.Accordingly, the number of electronic control units (ECUs), which are electronic control units mounted inside the vehicle, is rapidly increasing, and communication between the ECUs is performed through CAN (Controller Area Networks).

최근 차량에서 다양한 서비스를 제공하기 위한 시도가 이뤄짐에 따라, 차량 제어를 위한 데이터는 물론 운전자의 개인정보와 같은 중요한 데이터가 CAN을 통해 송수신 될 수 있다.As attempts have been made to provide various services in recent vehicles, important data such as driver's personal information as well as vehicle control data can be transmitted and received via CAN.

또한, 차량 내부에 사용되는 네트워크는 CAN 이외에도 LIN(Local Interconnect Network), FlexRay, MOST(Media Oriented Systems Transport)가 있고, 타 네트워크 간의 통신 프로토콜의 연동을 위해 게이트웨이(gateway)ECU가 사용된다.In addition to CAN, the network used in the vehicle includes LIN (Local Interconnect Network), FlexRay, and MOST (Media Oriented Systems Transport), and a gateway ECU is used for interworking communication protocols between other networks.

이 중에서도 CAN은 그 물리적인 특징 때문에, 외부 전자파나 노이즈에 강한 장점을 갖고 있으며, 이런 특성 때문에 차량 내부 통신 네트워크 중에 가장 큰 비중을 갖고 있다.Among these, CAN has strong advantages for external electromagnetic waves and noise because of its physical characteristics, and because of this characteristic, CAN has the largest weight in communication network inside the vehicle.

그러나, 보안적인 측면에서 CAN은 몇 가지 취약점을 갖고 있으며, 특히 서드파티(Third-Party) 업체에서 OBD-2(On Board Diagnostics)단자를 통해 CAN과 통신하여 차량을 자가 진단하거나 CAN의 데이터를 가공하여 사용자 편의를 제공하는 상품을 제공하고 있어, 해당 서비스 모델에서는 CAN의 특성을 악용한 공격자가 차량을 제어할 수 있는 취약점이 존재할 수 있다.However, from a security point of view, CAN has several weaknesses, especially third party vendors that can communicate with CAN via the OBD-2 (On Board Diagnostics) terminal to self-diagnose the vehicle, Therefore, there may be a vulnerability that an attacker who exploits the characteristics of CAN can control the vehicle in the corresponding service model.

본 발명은 차량 내 전자 제어 장치인 ECU들 간의 통신에 있어 보안을 강화하는 동시에 통신 효율을 향상시킬 수 있도록 하는 차량용 데이터 통신 방법 및 그를 이용하는 차량용 전자 제어 장치를 제공하는 것을 목적으로 한다.An object of the present invention is to provide a vehicular data communication method capable of enhancing security and enhancing communication efficiency in communication between ECUs as electronic control devices in a vehicle and an electronic control device for a vehicle using the same.

복수의 제어부들이 구비된 차량 내에서 제어부들 간의 차량용 데이터를 송수신하는 통신 방법에 있어서, 차량용 데이터를 수신하는 단계; 메시지 인증값을 수신하는 단계; 및 상기 수신된 메시지 인증값에 대한 인증을 수행한 후, 송신 측 제어부와 공유하는 카운터(counter) 값을 이용하여 상기 수신된 차량용 데이터를 복호화하는 단계를 포함하고, 상기 카운터 값은 상기 카운터 값에 대응되는 미리 결정된 시간 구간 동안 유효하며, 상기 시간 구간은 상기 카운터 값 생성 시점부터 미리 설정된 일정 시간 경과 시점까지의 타임 윈도우(time window)에 대응된다.A communication method for transmitting and receiving vehicle data between controllers in a vehicle having a plurality of controllers, the method comprising: receiving vehicle data; Receiving a message authentication value; And decrypting the received vehicle data using a counter value shared by the transmitting-side control unit after performing authentication on the received message authentication value, wherein the counter value is set to the counter value And the time interval corresponds to a time window from a time point when the counter value is generated to a predetermined time elapsed beforehand.

본 발명의 일실시예에 따른 차량용 제어 장치는 상기 차량용 데이터 통신 방법을 수행하며, 상기 차량용 데이터 통신 방법은 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체로 구현될 수 있다.The vehicle control apparatus according to an embodiment of the present invention carries out the data communication method for the vehicle, and the vehicle data communication method may be implemented by a computer-readable recording medium having recorded thereon a program for execution in a computer.

복수의 제어부들이 구비된 차량 내에서 제어부들 간의 차량용 데이터를 송수신하기 위한 통신 시스템에 있어서, 카운터 값과 암호화키를 이용하여 차량용 데이터를 암호화하고, 상기 암호화된 차량용 데이터와 인증키를 이용하여 메시지 인증값을 생성하여, 상기 암호화된 차량용 데이터와 상기 생성된 메시지 인증값을 브로드캐스팅하는 제1 제어부; 및 차량용 데이터와 메시지 인증값을 수신하고, 상기 인증키를 이용하여 상기 수신된 메시지 인증값에 대한 인증을 수행한 후 상기 카운터 값과 상기 암호화키를 이용하여 상기 수신된 차량용 데이터를 복호화하는 제2 제어부를 포함하고, 상기 카운터 값은 상기 제1 제어부와 상기 제2 제어부간 공유되는 미리 결정된 시간 구간 동안 유효하며, 상기 시간 구간은 상기 카운터 값 생성 시점부터 미리 설정된 일정 시간 경과 시점 또는 일정 시간 전후 시점까지의 하나 이상의 타임 윈도우(time window)에 대응되는 것을 특징으로 한다.A communication system for transmitting and receiving vehicle data between controllers in a vehicle provided with a plurality of controllers, the communication system comprising: a controller for encrypting vehicle data using a counter value and an encryption key, A first controller for generating the encrypted vehicle data and the generated message authentication value; And a controller for receiving the vehicle data and the message authentication value, performing authentication on the received message authentication value using the authentication key, and decrypting the received vehicle data using the counter value and the encryption key. Wherein the counter value is valid for a predetermined time interval that is shared between the first control unit and the second control unit, and the time interval is a predetermined time elapsed from the generation of the counter value, To at least one time window of up to < RTI ID = 0.0 > a. ≪ / RTI >

본 발명의 일실시예에 따르면, CAN(Controller Area Network) 프로토콜 등을 이용하여 차량용 데이터를 차량 내 제어 장치들 간에 송수신함에 있어 해커와 같은 외부로부터의 악의적인 메시지 발송 등을 방지하기 위한 카운터 값을 적용할 수 있으며, 상기 카운터 값은 상기 카운터 값에 대응되는 미리 결정된 시간 구간 동안 유효하도록 제어함으로써, 차량용 데이터 통신에서 발생하는 외부 침입에 효과적으로 대응하여 안정적인 차량 내 통신이 수행되도록 할 수 있다.According to an embodiment of the present invention, in transmitting and receiving vehicle data between in-vehicle control devices using a CAN (Controller Area Network) protocol or the like, a counter value for preventing malicious message transmission from the outside such as a hacker And the counter value is controlled to be valid for a predetermined time period corresponding to the counter value, thereby enabling reliable in-vehicle communication to be performed in response to an external intrusion occurring in the vehicle data communication.

도 1은 본 발명의 일실시예에 따른 차량용 데이터 통신 시스템의 간략한 구성을 나타내는 블록도이다.
도 2 및 도 3은 본 발명의 실시 예에 따른 타임 윈도우을 적용하여, 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법에 대한 일 예를 개략적으로 나타내는 도면이다.
도 4는 본 발명의 실시 예에 따른 시간 구간 및 타임 윈도우를 설명하기 위한 도면이다.
도 5는 본 발명의 실시 예에 따른 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법에 대한 일 예를 나타내는 타이밍도이다.
도 6은 본 발명의 일실시예에 따른 차량용 데이터 통신 시스템에서 외부 장치로부터 메시지가 수신되는 상황에 대한 일예를 설명하기 위한 도면이다.
도 7 내지 도 8은 본 발명의 실시 예에 따른 차량용 데이터 통신 방법을 나타내는 흐름도이다.
1 is a block diagram showing a simplified configuration of a vehicular data communication system according to an embodiment of the present invention.
2 and 3 are views schematically showing an example of a method for transmitting and receiving vehicle data between in-vehicle controllers by applying a time window according to an embodiment of the present invention.
4 is a view for explaining a time interval and a time window according to an embodiment of the present invention.
5 is a timing diagram illustrating an example of a method for transmitting and receiving vehicle data between in-vehicle controllers according to an embodiment of the present invention.
6 is a view for explaining an example of a situation in which a message is received from an external device in a vehicular data communication system according to an embodiment of the present invention.
7 to 8 are flowcharts showing a data communication method for a vehicle according to an embodiment of the present invention.

이하, 첨부한 도면을 참조하여 본 발명의 실시예에 따른 차량용 데이터 통신 방법 및 그를 이용하는 차량용 전자 제어 장치 및 시스템에 대해 상세히 설명하고자 한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a vehicle data communication method according to an embodiment of the present invention and a vehicle electronic control apparatus and system using the same will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일실시예에 따른 차량용 데이터 통신 시스템의 간략한 구성을 블록도로 도시한 것으로, 도시된 시스템은 차량 내에 구비되는 복수의 제어 장치들(100, 200)을 포함하여 구성될 수 있다.1 is a block diagram illustrating a simplified configuration of a data communication system for a vehicle according to an embodiment of the present invention. The system shown in FIG. 1 may include a plurality of control devices 100 and 200 provided in a vehicle .

도 1을 참조하면, 제1 제어 장치(100)는 차량용 데이터를 전송할 수 있으며, 상기 전송되는 차량용 데이터는 보안을 위해 암호화될 수 있다. 또한, 제1 제어 장치(100)는 차량용 데이터와 함께 상기 차량용 데이터를 인증하기 위한 메시지 인증값을 전송할 수 있다.Referring to FIG. 1, the first control device 100 can transmit vehicle data, and the transmitted vehicle data can be encrypted for security. Further, the first control device 100 may transmit the message authentication value for authenticating the vehicle data together with the vehicle data.

한편, 제2 제어 장치(200)는 상기 제1 제어 장치(100)로부터 전송되는 차량용 데이터와 메시지 인증값을 수신하며, 상기 수신된 메시지 인증값에 대한 인증을 수행하여 인증에 성공하는 경우 상기 수신된 차량용 데이터를 복호화하여 획득할 수 있다.On the other hand, the second control device 200 receives the vehicle data and the message authentication value transmitted from the first control device 100, authenticates the received message authentication value, and when the authentication is successful, Can be decoded and acquired.

상기와 같이 차량 내에 구비되는 복수의 제어 장치들(100, 200)은 전자제어장치인 ECU(Electronic Control Unit)일 수 있으며, 상기 ECU들은 차량의 내부에서 사용되는 포로토콜을 이용하여 상호간 통신을 수행한다.As described above, the plurality of control devices 100 and 200 provided in the vehicle may be an ECU (Electronic Control Unit) which is an electronic control device, and the ECUs communicate with each other using a protocol used in the vehicle do.

차량 내 ECU들 간의 통신을 위해 사용되는 프로토콜으로, CAN(Controller Area Network), LIN(Local Interconnect Network), FlexRay, MOST(Media Oriented Systems Transport) 등이 있으며, 본 발명에 있어서 차량용 데이터는 상기한 프로토콜들 중 어느 하나를 이용하여 생성된 메시지를 의미할 수 있다.A Controller Area Network (CAN), a Local Interconnect Network (LIN), a FlexRay, a Media Oriented Systems Transport (MOST), and the like. In the present invention, Or a message generated using any one of the above.

상기한 차량 내 통신용 프로토콜들 중 CAN 프로토콜은 한 쌍의 꼬임선으로 구성됨에 따라 물리적인 특징으로 인하여 외부 전자파나 노이즈에 강한 장점을 가지며, 브로드캐스트 통신 방식을 사용하여 차량 환경에 적합한 특징을 갖는다.Of the in-vehicle communication protocols, the CAN protocol is composed of a pair of twisted-pair wires. Therefore, the CAN protocol is advantageous against external electromagnetic waves and noise due to its physical characteristics, and is suitable for a vehicle environment using a broadcast communication method.

다만, CAN 프로토콜을 이용한 통신 방식은 브로드캐스트 통신을 사용하기 때문에, 외부에서 네트워크를 도청하기가 용이하고, 송수신되는 메시지를 인증할 수 있는 체계가 없다.However, since the communication method using the CAN protocol uses broadcast communication, it is easy to eavesdrop the network from the outside, and there is no system for authenticating the transmitted and received messages.

또한, CAN 프로토콜은 송수신되는 메시지를 암호화하지 않기 때문에, 상기 메시지가 송수신과정에서 위조 또는 변조되는 것을 방지하기 어려우며, 외부 공격자가 도청하여 획득한 메시지를 그대로 ECU로 재전송하는 메시지 재전송 공격 또한 방지하기 어렵다.In addition, since the CAN protocol does not encrypt the transmitted and received messages, it is difficult to prevent the messages from being falsified or altered during transmission and reception, and it is also difficult to prevent message retransmission attacks that retransmit the messages obtained by eavesdropping by an external attacker to the ECU .

본 발명의 일실시예에 따르면, 도 1을 참조하여 설명한 바와 같이, 송신 측 ECU인 제1 제어 장치(100)가 차량용 데이터를 암호화하여 브로드캐스팅하고, 상기 브로드캐스팅되는 차량용 데이터를 인증하기 위한 메시지 인증값을 전송함으로써, CAN 프로토콜을 이용한 통신시 도청, 위조 또는 변조의 위험성을 감소시킬 수 있다.According to an embodiment of the present invention, as described with reference to Fig. 1, the first control device 100, which is the transmitting-side ECU, encrypts and broadcasts the vehicle data, and transmits a message for authenticating the broadcast vehicle data By transmitting the authentication value, it is possible to reduce the risk of eavesdropping, falsification or modulation in communication using the CAN protocol.

또한, 본 발명의 실시 예에 따르면, 송신측 제1 제어 장치(100)는 수신측 제2 제어 장치(200)로 전송할 상기 차량용 데이터를 암호화함에 있어서, 수신 측 제2 제어 장치(200)와 공유하는 카운터(counter) 값을 이용하여 암호화를 수행할 수 있다.In addition, according to the embodiment of the present invention, the transmission-side first control device 100 is configured to encrypt the vehicle data to be transmitted to the reception-side second control device 200, The encryption can be performed using a counter value.

또한, 각 제1 제어 장치(100)와 제2 제어 장치(200)는 시간 흐름에 따라 상기 카운터 값을 실시간으로 가변할 수 있으며, 상호 공유되는 타임 윈도우(time window)에 대응되도록 설정 및 관리할 수 있다. 타임 윈도우 적용에 따라, 상기 카운터 값으로 암호화된 데이터는, 상기 카운터 값에 대응되는 미리 결정된 시간 구간 동안만 유효하게 복호화될 수 있다.In addition, each of the first controller 100 and the second controller 200 can vary the counter value in real time in accordance with time, and can set and manage the counter value to correspond to a mutually shared time window . According to the time window application, the data encrypted with the counter value can be effectively decrypted only for a predetermined time period corresponding to the counter value.

이에 따라, 수신측 제2 제어 장치(200)는 상기 수신된 메시지 인증값에 대한 인증을 수행한 후, 송신 측 제어부와 타임 윈도우를 기반으로 공유하는 카운터(counter) 값을 이용하여 상기 수신된 차량용 데이터를 복호화할 수 있다.The second controller 200 on the receiving side performs authentication on the received message authentication value and then transmits the received message authentication value to the receiving side controller 200 using the counter value shared based on the time window with the transmitting side controller Data can be decoded.

도 2 및 도 3은 본 발명의 실시 예에 따른 타임 윈도우을 적용하여, 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법에 대한 일 예를 개략적으로 나타내는 도면이며, 도 4는 본 발명의 실시 예에 따른 시간 구간 및 타임 윈도우를 설명하기 위한 도면이다.FIGS. 2 and 3 are views schematically showing an example of a method for transmitting and receiving vehicle data between in-vehicle controllers by applying a time window according to an embodiment of the present invention. And time windows and time windows according to the present invention.

먼저, 도 2를 참조하면, 도 2는 차량 내 제어부들간 차량용 데이터를 송수신하기 위한 방법을 간략히 도시한 타이밍도이다.2 is a timing diagram schematically illustrating a method for transmitting and receiving vehicle data between in-vehicle controllers.

도 2에 도시된 바와 같이, 제1 제어 장치(100)의 송신측 제어부(220)와 제2 제어 장치(200)의 수신측 제어부(230)는 키 교환 모듈을 통해 초기 카운터 키를 공유할 수 있으며, 이후, 각각의 미리 설정된 카운터 키(x, x+1, x+2, ...)를 통신 흐름에 따라 가변하면서 암호화된 차량용 데이터(C)와 메시지 인증 값(MAC)를 송수신할 수 있다. 따라서, 차량용 데이터 또는 메시지 인증값은 카운터 값에 의해 매 송수신마다 가변 암호화될 수 있다.2, the transmission-side control unit 220 of the first control device 100 and the reception-side control unit 230 of the second control device 200 can share the initial counter key through the key exchange module (C) and a message authentication value (MAC) while varying each preset counter key (x, x + 1, x + 2, ...) have. Therefore, the vehicle data or message authentication value can be variably encrypted for each transmission and reception by the counter value.

다만, 도 2에 도시된 바와 같이, x+1로 카운터 값이 적용된 데이터의 송신이 통신 장애나 오류 등으로 실패하는 경우 송신측 제어부(220)와 수신측 제어부(230)간 카운터 값이 정상적으로 공유되지 못하는 문제가 발생하게 된다. 2, when the transmission of the data to which the counter value is applied at x + 1 fails due to a communication error, error, or the like, the counter value between the transmission-side control unit 220 and the reception-side control unit 230 is normally shared A problem that can not be solved occurs.

이 경우, 송신측 제어부(220)에서는 송신을 실패하였더라도 다음 카운터 값 x+2를 이용하여 수신측 제어부(230)로 다음 데이터를 송신하게 되나, 수신측 제어부(230)에서는 이전 데이터가 수신되지 않았기 때문에 기존 카운터 값인 x+1로 복호화를 시도하게 되며, 카운터 값이 상이함에 따라 수신측 제어부(230)의 복호화는 실패하게 된다.In this case, even if the transmission fails, the transmitting-side control unit 220 transmits the next data to the receiving-side control unit 230 using the next counter value x + 2. However, in the receiving-side control unit 230, Therefore, decoding is attempted with the existing counter value x + 1, and decoding of the receiving side controller 230 fails due to the difference of the counter value.

이에 따라 카운터 키를 이용한 보안 통신은 가능하게 되나, 장애 등으로 인해 이와 같은 상황이 지속적으로 반복 발생하게 되어 결과적으로 송신측 제어부(220)와 수신측 제어부(230)간 인증에 따른 최초 키 교환이 다시 처음부터 수행되어야 할 수 있다.Accordingly, such a situation is repeatedly generated due to a failure or the like. As a result, the first key exchange in accordance with the authentication between the transmission-side control unit 220 and the reception-side control unit 230 is performed It may need to be done again from the beginning.

도 3은 본 발명의 실시 예에 따른 타임 윈도우를 적용하여, 이와 같은 도 2의 실시 예의 보안성은 유지하면서 안전성 및 속도를 개선하기 위한 것으로, 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법에 대한 일 예를 개략적으로 나타낸다.FIG. 3 is a view for improving the safety and speed while maintaining the security of the embodiment of FIG. 2 by applying the time window according to the embodiment of the present invention. The method for transmitting and receiving data for vehicles between in- An example is schematically shown.

도 3을 참조하면, 제1 제어 장치(100)의 송신측 제어부(220)와 제2 제어 장치(200)의 수신측 제어부(230)는 키 교환 모듈을 통해 초기 카운터 키를 공유할 수 있으며, 이후, 각각의 미리 설정된 카운터 키(x, x+1, x+2, ...)를 타임 윈도우(time window) 기반으로 시간 및 통신 흐름에 따라 가변하면서 암호화된 차량용 데이터(C)와 메시지 인증 값(MAC)를 송수신할 수 있다. 다만, 본 발명의 실시 예에서 키 교환 모듈은 필수적인 것은 아니어서, 제1 제어 장치(100)와 제2 제어 장치(200)들이 직접 연결되어 핸드 쉐이킹(hand shaking) 방식에 의한 카운터 키 및 타임 윈도우 초기화를 수행할 수도 있다.3, the transmitting-side control unit 220 of the first control device 100 and the receiving-side control unit 230 of the second control device 200 may share the initial counter key through the key exchange module, Thereafter, each of the preset counter keys (x, x + 1, x + 2, ...) is changed in accordance with time and communication flow based on a time window, Value (MAC). However, the key exchange module is not essential in the embodiment of the present invention, so that the first control device 100 and the second control devices 200 are directly connected to each other, so that the counter key and the time window Initialization may also be performed.

따라서, 차량용 데이터 또는 메시지 인증값은 타임 윈도우에 대응되는 카운터 값에 의해 송수신 시점마다 선택적으로 가변 암호화될 수 있다. Therefore, the vehicle data or message authentication value can be selectively variable-encrypted at each transmission / reception time by the counter value corresponding to the time window.

도 3에 도시된 바와 같이, 송신측 제어부(220)와 수신측 제어부(230)에서 최초 타임 윈도우와, 이에 대응되는 카운터 키가 공유될 수 있다. 그리고, 수신측 제어부(230)는 타임 윈도우가 동일한 시간 구간에서는, 기존 데이터 복호화에 이용된 카운터 x와 동일한 카운터 x를 이용한 복호화를 처리할 수 있다.As shown in FIG. 3, the first time window and the counter key corresponding to the first time window can be shared by the transmitting-side control unit 220 and the receiving-side control unit 230. Then, the receiving side control unit 230 can process the decryption using the same counter x as the counter x used in the existing data decryption in the same time period of the time window.

따라서, 도 3에 도시된 바와 같이, x로 카운터 값이 적용된 데이터의 송신이 통신 장애나 오류 등으로 실패하는 경우라도, 타임 윈도우에 의한 시간 구간 이내인 경우에는 송신측 제어부(220)와 수신측 제어부(230)간 카운터 값이 정상적으로 공유될 수 있게 된다.Therefore, as shown in FIG. 3, even if the transmission of the data to which the counter value is applied by x fails due to a communication error, error, or the like, the transmission side control unit 220 and the reception side The counter value between the control units 230 can be normally shared.

이에 따라, 수신측 제어부(230)는 송신측 제어부(220)와 공유되는 타임 윈도우의 변화여부에 따라 카운터 값을 결정하고, 이에 따라 송신측 제어부(220)로부터 수신된 암호화 데이터를 복호화할 수 있으며, 전송 실패나 장애가 발생하더라도, 카운터 값의 동기화는 유지되도록 하여 안정성을 도모할 수 있다.Accordingly, the receiving-side control unit 230 can determine the counter value according to whether the time window shared with the transmitting-side control unit 220 is changed or not, and thus can decrypt the encrypted data received from the transmitting-side control unit 220 , Even if a transmission failure or a failure occurs, the synchronization of the counter value can be maintained and stability can be achieved.

도 4는 본 발명의 실시 예에 따른 시간 구간 및 타임 윈도우를 설명하기 위한 도면이다.4 is a view for explaining a time interval and a time window according to an embodiment of the present invention.

도 4를 참조하면, 타임라인은 각각의 카운터 값(x, x+1, x+2, ...)에 대응되도록 시간적으로 분할될 수 있으며, 각 분할된 시간 구간은 복수의 타임 윈도우(time window)중 어느 하나를 형성할 수 있다.4, the timeline may be temporally divided to correspond to each counter value (x, x + 1, x + 2, ...), and each divided time section may be divided into a plurality of time windows window may be formed.

또한, 각 타임 윈도우에 의해 분할된 시간 구간들은 카운터 값의 생성 또는 변경 시점에 대응될 수 있다. 이에 따라, 카운터 값은 타임 윈도우의 변경에 따라, 상기 시간 구간의 가변에 동기화되어 함께 가변될 수 있다.In addition, the time intervals divided by each time window may correspond to the time of generation or change of the counter value. Accordingly, the counter value can be changed in synchronization with the variation of the time interval according to the change of the time window.

예를 들어, 각각의 시간 구간은 상기 카운터 값 생성 시점부터 미리 설정된 일정 시간 경과 시점까지의 타임 윈도우(time window)에 대응될 수 있다.For example, each time interval may correspond to a time window from a time point at which the counter value is generated to a predetermined time elapsed at a predetermined time.

또한, 송신측 제어부(220)와 수신측 제어부(230)는 각각 시간 경과에 따라 타임 윈도우가 변경되어 현재 시점이 제1 시간 구간에서 제2 시간 구간으로 진입한 경우, 상기 카운터 값을 증가시킬 수 있다.In addition, the transmission-side control unit 220 and the reception-side control unit 230 may increase the counter value when the time window is changed over time and the current time enters the second time interval in the first time interval have.

그리고, 수신측 제어부(230)는 현재 타임 윈도우에 대응되는 카운터 키를 이용한 복호화를 처리할 수 있다.Then, the receiving side controller 230 can process the decryption using the counter key corresponding to the current time window.

다만, 데이터가 전송되는 시간 동안 시간 경과에 따라 타임 윈도우가 변경됨으로써 카운터 키의 동기화가 실패할 수도 있다. 따라서, 본 발명의 실시 예에 따른 수신측 제어부(230)는 상기 복호화가 실패하는 경우, 다음 타임 윈도우에 대응하는 시간 구간 또는 이전 타임 윈도우에 대응하는 시간 구간의 카운터 키를 이용하여 복호화를 시도할 수 있다. 따라서, 적어도 미리 설정된 최소 전송시간 구간 내에서는 카운터 키 동기화가 매우 안정적으로 달성될 수 있다.However, the time window may be changed over time during the data transmission, so that the synchronization of the counter key may fail. Therefore, if the decryption fails, the receiving side controller 230 attempts to decode the decoded data using the counter key of the time interval corresponding to the next time window or the previous time window . Therefore, counter key synchronization can be achieved very stably at least within a preset minimum transmission time interval.

도 5는 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법에 대한 일예를 타이밍도로 도시한 것이다.5 is a timing diagram illustrating an example of a method for transmitting and receiving vehicle data between in-vehicle controllers.

도 5를 참조하면, 본 발명의 다른 일 실시 예에 따르면, 키 교환 모듈이나 핸드 쉐이킹(hand shaking) 방식 이외에도 게이트웨이 제어부(240)가 별도 존재하여 암호화 키를 저장 및 관리하는 시스템에, 타임 윈도우 기반 카운터 키 공유 프로세스가 적용될 수 있다.Referring to FIG. 5, according to another embodiment of the present invention, in addition to a key exchange module or a hand shaking method, a gateway control unit 240 is separately provided to store and manage an encryption key, Counter key sharing process can be applied.

예를 들어, 게이트웨이 제어부(240)가 공인된 인증기관으로부터 발급받은 자신의 고유 인증서 및 해당 네트워크에 포함되는 제어부들과 공유하기 위한 대칭키를 저장하고 있으며, 차량 내에 구비되는 제어부들(220, 230)도 게이트웨이 제어부(240)가 저장한 대칭키와 동일한 대칭키를 각각 저장하고 있을 수 있다.For example, the gateway control unit 240 stores its own certificate issued from an authorized certification authority and a symmetric key for sharing with the control units included in the network, and the control units 220 and 230 May also store the same symmetric key as the symmetric key stored by the gateway control unit 240, respectively.

여기서, 상기 게이트웨이 제어부(240)는 차량 내에 구비된 게이트웨이 ECU를 의미하며, 제어부들(220, 230)은 차량 내에 구비된 ECU들을 각각 의미할 수 있다.Here, the gateway control unit 240 means a gateway ECU provided in the vehicle, and the controllers 220 and 230 may mean ECUs installed in the vehicle.

또한, 도 2에는 송신 측 제어부(220)와 수신 측 제어부(230)만이 도시되어 있으나, 차량 내에는 도 2에 도시된 제어부들(220, 230) 이외에 더 많은 제어부들이 구비되어 있으며, 게이트웨이 제어부(240) 또는 어느 하나의 제어부로부터 브로드캐스팅되는 메시지는 차량 내에 구비된 모든 제어부들에 의해 수신될 수 있다.Although only the transmitting side control unit 220 and the receiving side control unit 230 are shown in FIG. 2, in the vehicle, more control units are provided in addition to the control units 220 and 230 shown in FIG. 2, and a gateway control unit 240 or a message broadcast from any one of the controllers may be received by all the controllers provided in the vehicle.

차량 내에 구비되는 제어부들(220, 230)은 차량용 데이터의 암호화 및 복호화에 사용될 카운터 값과 타임 윈도우를 초기화하여 서로 공유할 수 있다(S200 단계).The control units 220 and 230 provided in the vehicle can initialize the counter values and the time window to be used for encrypting and decrypting the vehicle data and can share the same with each other in step S200.

예를 들어, 각 제어부들(220, 230)은 타임 윈도우에 대한 시간 구간의 분할 정보 및 스타트 정보와 초기 카운터 값을 AES CTR 모드를 이용해 암호화하여 브로드캐스팅할 수 있으며, 상호 수신하여 동기화하여 저장하며, 시간 흐름에 따라 가변되도록 설정할 수 있다.For example, each of the controllers 220 and 230 may encode division information of the time interval for the time window, the start information and the initial counter value using the AES CTR mode, , And can be set to be variable according to the time flow.

그리고, 게이트웨이 제어부(240)는 인증키 및 암호화키 생성을 위해 사용될 랜덤값을 생성한다(S201 단계).Then, the gateway control unit 240 generates a random value to be used for generating the authentication key and the encryption key (step S201).

그 후, 게이트웨이 제어부(240)는 대칭키를 이용하여 상기 생성된 랜덤값을 암호화하고(S202 단계), 상기 암호화된 랜덤값을 차량 내에 구비된 모든 제어부들(220, 230) 네트워크 내 연결된 모든 제어부들(220, 230)로 전송한다(S203 단계).Thereafter, the gateway control unit 240 encrypts the generated random value using the symmetric key (step S202), and transmits the encrypted random value to all controllers (220, 230) (220, 230) (step S203).

대칭키로 암호화된 랜덤값을 수신한 제어부들(220, 230)은 각각 미리 저장하고 있는 대칭키를 이용해 상기 암호화된 랜덤값을 복호화하고(S204 단계), 복호화된 랜덤값을 이용하여 암호화키와 인증키를 생성한다(S205 단계). The control units 220 and 230 receiving the random value encrypted with the symmetric key decrypt the encrypted random value using the symmetric key stored in advance (step S204), and decrypt the encrypted key and the authentication key using the decrypted random value Key (step S205).

그 후, 차량용 데이터를 전송하고자 하는 송신 측 제어부(220)는 다른 제어부들과 타임 윈도우 기반으로 공유하고 있는 카운터 값과 상기 S205 단계에서 생성한 암호화키를 이용하여 차량용 데이터를 암호화하고(S206 단계), 상기 S205 단계에서 생성한 인증키를 이용하여 메시지 인증값을 생성한다(S207 단계).After that, the transmitting-side control unit 220, which is to transmit the vehicle data, encrypts the vehicle data using the counter value shared with other control units on the time window basis and the encryption key generated in step S205 (step S206) , And generates a message authentication value using the authentication key generated in step S205 (step S207).

예를 들어, 송신 측 제어부(220)는 상기 S200 단계에서 초기화한 카운터 값을 암호화키로 암호화한 후 전송하고자 하는 차량용 데이터와 배타적 연산(Xor)을 수행하여 암호화 메시지를 얻을 수 있다.For example, the transmitting-side control unit 220 can obtain the encrypted message by encrypting the counter value initialized in step S200 with the encryption key, and performing an exclusive operation (Xor) with the vehicle data to be transmitted.

또한, 송신 측 제어부(220)는 인증키를 이용하여 상기 암호화 메시지를 포함하는 128bit 크기의 메시지 인증값을 생성하여, 이중 상위 64bit를 인증값을 전송할 네트워크 패킷에 삽입할 수 있다.In addition, the transmitting-side control unit 220 may generate a 128-bit message authentication value including the encryption message using the authentication key, and insert the upper 64 bits into the network packet to transmit the authentication value.

그 후, 송신 측 제어부(220)는 상기와 암호화된 차량용 데이터와 메시지 인증값을 브로드캐스팅하여 수신 측 제어부(230)로 전송한다(S208 단계).Then, the transmitting-side control unit 220 broadcasts the encrypted vehicle data and the message authentication value, and transmits the same to the receiving-side control unit 230 in step S208.

한편, 송신 측 제어부(220)는 상기와 같이 차량용 데이터의 암호화와 메시지 인증값의 생성이 완료되어 전송되는 것과는 독립적으로, 시간 흐름에 따라 타임 윈도우가 다음 시간 구간으로 변경되는 경우, 자신의 카운터 값을 1 만큼 증가시킬 수 있다.On the other hand, when the time window is changed to the next time interval according to time, independently of the transmission and transmission of the encrypted vehicle data and the generation of the message authentication value as described above, Can be increased by one.

수신 측 제어부(230)는 상기 송신 측 제어부(220)로부터 전송되는 암호화된 차량용 데이터와 메시지 인증값을 수신하여 먼저 메시지 인증값에 대한 인증을 수행하고(S209 단계), 인증에 성공하는 경우 제어부들(220, 230) 사이에서 타임 윈도우 기반으로 공유된 암호화키와 카운터 값을 이용하여 차량용 데이터를 복호화한다(S210 단계).The receiving-side control unit 230 receives the encrypted vehicle data and the message authentication value transmitted from the transmitting-side control unit 220 and performs authentication on the message authentication value (S209). If the authentication is successful, The vehicle data is decrypted using the encryption key and the counter value shared between the mobile terminals 220 and 230 based on the time window in step S210.

예를 들어, 수신 측 제어부(230)는 송신 측 제어부(220)로부터 브로드캐스팅되어 수신된 네트워크 패킷 내에서 ID 필드를 확인한 후, 인증키를 사용하여 상기 네트워크 패킷 내 포함된 메시지 인증값을 인증할 수 있다.For example, the receiving-side control unit 230 checks the ID field in the received network packet broadcasted from the transmitting-side control unit 220, and then authenticates the message authentication value included in the network packet using the authentication key .

상기 메시지 인증값에 대한 인증이 완료되면, 수신 측 제어부(230)는 타임 윈도우에 따른 현재 시점의 카운터 값을 확인하고, 상기 수신한 네트워크 패킷 내 암호화 메시지를 암호화키와 상기 카운터 값을 이용해 복호화하여 차량용 데이터를 획득할 수 있다.When the authentication of the message authentication value is completed, the receiving side controller 230 checks the current value of the counter value according to the time window, decrypts the received encryption message in the network packet using the encryption key and the counter value Vehicle data can be obtained.

상기와 같이, 차량용 데이터를 획득한 수신 측 제어부(230)는 타임 윈도우 가변 여부에 따라 카운터 값을 1 만큼 증가시키며, 그에 따라 송신 측 제어부(220)와 수신 측 제어부(230) 사이의 카운터 값이 타임 윈도우 기반 실시간으로 일치되어 유지될 수 있다.As described above, the reception-side control unit 230, which has acquired the vehicle data, increases the counter value by one according to whether the time window is variable, and accordingly, the counter value between the transmission-side control unit 220 and the reception- Time window based real time.

도 5를 참조하여 설명한 차량 내 제어부들 간의 차량용 데이터를 송수신하기 위한 방법은 본 발명에 따른 차량용 데이터 통신 방법을 설명하기 위한 일예에 불과하며, 본 발명은 이에 한정되지 아니한다.The method for transmitting and receiving the vehicle data between the in-vehicle control units described with reference to FIG. 5 is only one example for explaining the vehicle data communication method according to the present invention, and the present invention is not limited thereto.

예를 들어, 게이트웨이 제어부(240)가 랜덤값과 비밀값을 생성하여 차량 내에 구비된 제어부들(220, 230)로 전송하고, 제어부들(220, 230)은 비밀값을 이용하여 제1 세션키와 제2 세션키를 생성할 수 있다.For example, the gateway control unit 240 generates a random value and a secret value and transmits the random value and the secret value to the control units 220 and 230 provided in the vehicle, and the control units 220 and 230 use the secret value, And a second session key.

한편, 제어부들(220, 230)은 상기 생성한 제1 세션키와 제2 세션키를 이용해 암호문 및 제1 메시지 인증코드(Message Authentication Code)를 생성하여 게이트웨이 제어부(240)로 송신하며, 게이트웨이 제어부(240)는 상기 수신된 암호문과 제1 메시지 인증코드로부터 해당 제어부의 제1 세션키와 제2 세션키 생성을 확인할 수 있다.The controller 220 and 230 generate a ciphertext and a first message authentication code using the generated first session key and the second session key and transmit the generated ciphertext and a first message authentication code to the gateway control unit 240, The control unit 240 can confirm the generation of the first session key and the second session key of the corresponding control unit from the received ciphertext and the first message authentication code.

그 후, 송신 측 제어부(220)가 암호화된 차량용 데이터와 제2 메시지 인증코드를 생성하고, 전송할 네트워크 패킷 내에 상기 암호화된 차량용 데이터와 제2 메시지인증코드를 포함시켜 수신 측 제어부(230)로 전송할 수 있다.Thereafter, the transmitting-side control unit 220 generates the encrypted vehicle data and the second message authentication code, and transmits the encrypted vehicle data and the second message authentication code to the transmission-side control unit 230 in the network packet to be transmitted .

수신 측 제어부(230)는 상기 수신되는 네트워크 패킷 내에 포함된 제2 메시지 인증코드를 인증한 후, 암호화된 차량용 데이터를 복호화하여 차량용 데이터를 획득할 수 있다.The receiving side controller 230 may authenticate the second message authentication code included in the received network packet, and decrypt the encrypted vehicle data to obtain the vehicle data.

도 6을 참조하면, 상기한 바와 같은 본 발명의 일실시예에 따른 차량용 데이터 통신 시스템에서 외부 장치로부터 메시지가 수신되는 상황이 발생할 수 있다.Referring to FIG. 6, a message may be received from an external device in the vehicular data communication system according to an embodiment of the present invention.

예를 들어, 송신 측 제어부(220)가 암호화된 차량용 데이터를 전송한 후, 메시지 인증값을 전송하기 전, 그 사이에 외부 장치(300)로부터 악성 메시지가 CAN 프로토콜 등에 따른 차량용 데이터의 형태로 전송되어 수신 측 제어부(230)에 수신될 수 있다.For example, a malicious message may be transmitted from the external device 300 in the form of vehicle data according to the CAN protocol or the like before the transmission control unit 220 transmits the encrypted vehicle data and before the message authentication value is transmitted And can be received by the receiving side controller 230.

이 경우, 수신 측 제어부(230)가 도 1 내지 도 2를 참조하여 설명한 바와 같은 방법으로 메시지 인증값에 대한 인증 후 그 이전에 수신된 차량용 데이터를 복호화함에 있어, 타임 윈도우, 카운터 값 또는 암호화키가 일치하지 않음에 따라 복호화에 실패할 수 있다.In this case, when the receiving-side control unit 230 decrypts the vehicle data received before the authentication of the message authentication value by the method as described with reference to Figs. 1 and 2, the time window, the counter value, The decoding may fail due to the mismatch.

한편, 수신 측 제어부(230)가 암호화된 차량용 데이터에 대한 타임 윈도우가 경과됨에 따라 카운터 값을 1 만큼 증가시킬 수 있지만, 타임 윈도우가 경과되지 않는 경우 카운터 값을 증가시키지 않으며, 그에 따라 송신 측 제어부(220)가 암호화된 차량용 데이터와 메시지 인증값을 전송한 후 1 만큼 증가시킨 카운터 값과 수신 측 제어부(230)가 가지고 있는 카운터 값이 동기화될 수 있다.On the other hand, the receiving side controller 230 can increase the counter value by one as the time window for the encrypted vehicle data has elapsed. However, if the time window does not elapse, the counter value is not increased, The counter value of the receiver control unit 230 may be synchronized with the counter value which is increased by 1 after transmitting the encrypted vehicle data and the message authentication value.

이에 따라, 상기와 같이 송신 측 제어부(220)와 수신 측 제어부(230) 사이 공유하는 카운터 값은 타임 윈도우 기반으로 동일 또는 유사하게 유지되어 일정 시간 구간동안 유효한 통신이 가능하게 된다. 이에 따라, 복호화 실패 이후에도 송수신되는 차량용 데이터를 수신 측 제어부(230)가 복호화할 수 있게 된다.Accordingly, the counter values shared between the transmission-side control unit 220 and the reception-side control unit 230 are kept the same or similar based on the time window, so that effective communication is possible for a predetermined time period. Accordingly, the receiving-side control unit 230 can decode the vehicle data transmitted and received even after the decoding failure.

즉, 해커(hacker)가 생성한 다수의 CAN 메시지들이 연속적으로 브로드캐스팅되어 암호화된 차량용 데이터와 메시지 인증값 사이에 수신 측 제어부(230)로 수신되는 경우, 상기한 바와 같은 타임 윈도우 및 카운터 값은 외부 장치(300)와 공유되지 않으므로, 복호화되지 않아 폐기 처리될 수 있다.That is, when a plurality of CAN messages generated by a hacker are continuously broadcasted and received by the receiving-side control unit 230 between the encrypted vehicle data and the message authentication value, the time window and the counter value as described above It can not be decrypted and can be discarded because it is not shared with the external device 300.

좀 더 구체적으로, 암호화된 차량용 데이터와 메시지 인증값이 동일한 CAN ID로 전송될 때, 상기 암호화된 차량용 데이터의 전송 시점과 비슷한 시점에 해커 등에 의해 외부 장치(300)로부터 전송되는 침입 메시지가 그와 동일한 CAN ID를 가지는 경우, 수신 측 제어부(230)에서 도 1 내지 도 2를 참조하여 설명한 바와 같은 방법으로 메시지를 인증하여 확인하면 복호화 실패로 인해 침입 메시지와 송신 측 제어부(220)로부터 전송된 메시지가 함께 버려지게 된다. 또한, 상기한 바와 같은 카운터 값의 동기화는 유지되므로 정상적인 타임 윈도우 기반 카운터 값을 이용한 통신은 가능하게 된다.More specifically, when the encrypted vehicle data and the message authentication value are transmitted in the same CAN ID, an intrusion message transmitted from the external device 300 by a hacker or the like at a time similar to the transmission time of the encrypted vehicle data is transmitted In the case of having the same CAN ID, if the message is authenticated and confirmed by the receiving side control unit 230 as described with reference to FIGS. 1 and 2, the intrusion message due to decryption failure and the message transmitted from the transmission side control unit 220 Are abandoned together. In addition, since the synchronization of the counter values as described above is maintained, communication using a normal time window based counter value becomes possible.

또한, 암호화된 차량용 데이터와 메시지 인증값이 다른 CAN ID로 전송될 때에도, 상기 암호화된 차량용 데이터의 전송 시점과 비슷한 시점에 해커 등에 의한 악의적인 암호화된 메시지와 메시지 인증값이 전송되는 경우에도 카운터 값이 상이함에 의해 보안은 유지될 수 있으며, 수신 측 제어부(230)에서 모든 암호화된 메시지와 메시지 인증값들을 비교하는 등의 추가적인 작업들을 줄일 수 있다.Even when the encrypted vehicle data and the message authentication value are transmitted with a different CAN ID, even if a malicious encrypted message and a message authentication value due to a hacker or the like are transmitted at a time similar to the transmission time of the encrypted vehicle data, The security can be maintained and the additional operations such as comparing all the encrypted messages with the message authentication values in the receiving side control unit 230 can be reduced.

그리고, 송신 측 제어부(220)에서 전송한 메시지를 수신 측 제어부(230)에서 순간적인 하드웨어 문제 등으로 인해 수신하지 못하는 경우에, 상기한 바와 같은 카운터 값의 불일치가 발생하여 발생되는 문제점들은 타임 윈도우 기반으로 개선할 수 있다.When a message transmitted from the transmission-side control unit 220 is not received due to an instantaneous hardware problem or the like in the reception-side control unit 230, the problems caused by the inconsistency of the counter value as described above, .

본 발명의 일실시예에 따르면, CAN(Controller Area Network) 프로토콜 등을 이용하여 차량용 데이터를 차량 내 제어 장치들 간에 송수신함에 있어 해커와 같은 외부로부터의 악의적인 메시지 발송 등으로 인한 차량용 데이터를 카운터 값을 이용하여 보호할 수 있으며, 상기 카운터 값은 각 제어부간 공유되는 타임 윈도우에 의해, 미리 결정된 시간 구간 동안 유효하게 될 수 있다. 이는 해킹과 통신 장애를 구분하게 함으로써, 카운터 값에 의한 보안은 유지하면서도 통신 장애에 의한 정상 통신시 카운터 값의 불일치를 방지할 수 있게 된다.According to an embodiment of the present invention, in transmitting and receiving vehicle data between in-vehicle control devices using a CAN (Controller Area Network) protocol or the like, vehicle data due to malicious message transmission from the outside such as a hacker is transmitted to a counter value And the counter value may be valid for a predetermined time interval by a time window shared between the respective controllers. This distinguishes between hacking and communication disturbances, so that it is possible to prevent discrepancies in counter values during normal communication due to communication failure while maintaining security by counter value.

따라서, 차량용 데이터 통신에서 발생하는 외부 침입에 효과적으로 대응하여 안정적인 차량 내 통신이 수행되며, 통신 장애가 발생하더라도 통신 채널이 효과적으로 유지되도록 할 수 있다.Accordingly, stable in-vehicle communication is effectively performed in response to an external intrusion occurring in the vehicle data communication, and the communication channel can be effectively maintained even if a communication failure occurs.

도 7 내지 도 8은 본 발명의 실시 예에 따른 차량용 데이터 통신 방법을 나타내는 흐름도로서, 도 5에서 도시된 통신 방법 중 도 1 내지 도 4를 참조하여 설명한 것과 동일한 것에 대한 설명은 이하 생략하기로 한다.7 to 8 are flowcharts showing a data communication method for a vehicle according to an embodiment of the present invention. A description of the same communication methods as those described with reference to Figs. 1 to 4 of the communication method shown in Fig. 5 will be omitted below .

도 7을 참조하면, 송신측 제어부(220)는 전송할 차량용 데이터와 메시지 인증값을 생성한다(S300 단계).Referring to FIG. 7, the transmitting-side control unit 220 generates vehicle data and a message authentication value to be transmitted (S300).

그리고, 송신측 제어부(220)는 현재 시점이 일정 시간 범위(타임 윈도우) 이내인지 판단하고(S310 단계), 판단 결과에 따라(예를 들어, 현재 시간 구간이 다음 타임 윈도우로 변경된 경우) 카운터 값을 증가시킨다(S320 단계).In step S310, the transmission-side controller 220 determines whether the current time is within a predetermined time range (step S310). If the current time interval is changed to the next time window, (Step S320).

이후, 송신측 제어부(220)는 카운터 값을 이용하여 상기 차량용 데이터를 암호화하여 전송한다(S330 단계).Thereafter, the transmission-side control unit 220 encrypts and transmits the vehicle data using the counter value (step S330).

한편, 도 8을 참조하면, 수신 측 제어부(230)는 송신 측 제어부(220)로부터 전송되는 차량용 데이터와 메시지 인증값을 수신한다(S400 단계).8, the receiving-side control unit 230 receives the vehicle data and the message authentication value transmitted from the transmitting-side control unit 220 (step S400).

그리고, 수신측 제어부(230)는 현재 시점이 일정 시간 범위(타임 윈도우) 이내인지 판단하고(S410 단계), 판단 결과에 따라(예를 들어, 현재 시간 구간이 다음 타임 윈도우로 변경된 경우) 카운터 값을 증가시킨다(S420 단계).The receiving side controller 230 determines whether the current time is within a predetermined time range (S410). If the current time interval is changed to the next time window, (Step S420).

그 후, 수신 측 제어부(230)는 상기 수신된 메시지 인증값에 대한 인증을 수행하여 인증이 성공하는 경우(S430 단계), 송신 측 제어부(220)와 상기 타임 윈도우 기반으로 공유되는 카운터(counter) 값을 이용하여 상기 수신된 차량용 데이터를 복호화한다(S440 단계).If the authentication is successful (step S430), the receiving-side controller 230 authenticates the received message authentication value and transmits a counter, which is shared based on the time window, to the transmitting- And decodes the received vehicle data by using the value (step S440).

상기한 바와 같이, 차량용 데이터는 CAN 프로토콜을 사용하여 브로드캐스팅되는 메시지일 수 있으며, 그를 위해 제어부들(220, 230)은 게이트웨이 제어부(240)로부터 수신된 랜덤값을 이용하여 상기 차량용 데이터를 암호화/복호화하기 위한 암호화키와 메시지 인증값을 인증하기 위한 인증키를 생성할 수 있다.As described above, the vehicle data may be a message broadcast using the CAN protocol, and for this purpose, the controllers 220 and 230 may encrypt / decrypt the vehicle data using the random values received from the gateway control unit 240. For example, It is possible to generate an encryption key for decryption and an authentication key for authenticating the message authentication value.

또한, 상기 차량용 데이터는 제어부들(220, 230) 사이에서 타임 윈도우 기반으로 공유되는 카운터 값과 암호화키를 이용해 생성된 암호화 메시지일 수 있으며, 상기 암호화 메시지는 인증키를 이용하여 일정 크기의 메시지 인증값으로 생성될 수 있다.Also, the vehicle data may be an encrypted message generated using a counter value and an encryption key that are shared between the controllers 220 and 230 based on a time window, and the encrypted message may be a message authentication Lt; / RTI >

한편, 상기 S400 단계에서 수신되는 차량용 데이터는 도 5를 참조하여 설명한 바와 같이 해커 등에 의해 악의적으로 침입된 메시지일 수도 있으며, 그러한 경우 상기 수신된 차량용 데이터에 대한 복호화가 실패하더라도, 제어부들(220, 230) 사이에서 카운터 값의 동기화는 유지될 수 있다.Meanwhile, the vehicle data received in the step S400 may be a malicious invasion message by a hacker or the like as described with reference to FIG. 5. In such a case, even if decoding of the received vehicle data fails, the controllers 220, 230 can be maintained.

상기 암호화된 차량용 데이터에 대한 복호화가 성공하는 경우(S450 단계), 수신 측 제어부(230)는 차량용 데이터를 획득하여 처리한다(S460 단계).If the decryption of the encrypted vehicle data is successful (step S450), the receiving side controller 230 acquires and processes the vehicle data (step S460).

그와 달리, 상기 암호화된 차량용 데이터에 대한 복호화가 실패하는 경우에는(S450 단계), 수신 측 제어부(230)는 상기 차량용 데이터와 메시지 인증 값을 폐기한다(S470 단계).Otherwise, if the decryption of the encrypted vehicle data fails (S450), the receiving-side controller 230 discards the vehicle data and the message authentication value (S470).

이 경우, 송신 측 제어부(220)는 이후 암호화 또는 복호화에 사용할 카운터 값을 다시 타임 윈도우 기반으로 재설정하여, 카운터 값 안정적으로 유지되도록 동기화할 수 있다.In this case, the transmission-side control unit 220 may reset the counter value to be used for encryption or decryption again based on the time window, and synchronize the counter value to be stably maintained.

도 8을 참조하면, 송신 측 제어부(220)가 주기적으로 암호화된 차량용 데이터를 CAN 메시지로 브로드캐스팅하는 상황에서, 중간에 외부의 해킹 시도로 인해 악의적인 CAN 메시지가 침입되어 수신 측 제어부(230)로 수신되는 경우, 수신 측 제어부(230)는 상기 메시지를 폐기하고, 이후 복호화에 사용할 카운터 값을 타임 윈도우 기반으로 재설정할 수 있다.Referring to FIG. 8, in a situation where the transmitting-side control unit 220 broadcasts periodically encrypted car data with a CAN message, a malicious CAN message is invoked due to an external hacking attempt in the middle, The receiving side control unit 230 may discard the message and reset the counter value to be used in the decoding based on the time window.

상기한 바와 같이 수신 측 제어부(230)가 이후 복호화에 사용할 카운터 값을 재설정함으로써, 카운터 값의 외부에 대한 보안성을 유지하면서, 제어부들(220, 230) 사이에서 카운터 값의 불일치가 발생하지 않도록 할 수 있다.As described above, by resetting the counter value to be decoded by the receiving side controller 230, it is possible to prevent the counter value from being inconsistent between the controllers 220 and 230 while maintaining security against the outside of the counter value can do.

상술한 본 발명에 따른 차량용 데이터 통신 방법은 컴퓨터에서 실행되기 위한 프로그램으로 제작되어 컴퓨터가 읽을 수 있는 기록 매체에 저장될 수 있으며, 컴퓨터가 읽을 수 있는 기록 매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피디스크, 광 데이터 저장장치 등이 있다.The vehicle data communication method according to the present invention may be implemented as a program for execution in a computer and stored in a computer-readable recording medium. Examples of the computer-readable recording medium include a ROM, a RAM, a CD-ROM , A magnetic tape, a floppy disk, and an optical data storage device.

컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다. 그리고, 상기 방법을 구현하기 위한 기능적인(function) 프로그램, 코드 및 코드 세그먼트들은 본 발명이 속하는 기술분야의 프로그래머들에 의해 용이하게 추론될 수 있다.The computer readable recording medium may be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner. And, functional programs, codes and code segments for implementing the above method can be easily inferred by programmers of the technical field to which the present invention belongs.

또한, 이상에서는 본 발명의 바람직한 실시예에 대하여 도시하고 설명하였지만, 본 발명은 상술한 특정의 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형 실시가 가능한 것은 물론이고, 이러한 변형 실시들은 본 발명의 기술적 사상이나 전망으로부터 개별적으로 이해되어서는 안될 것이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary, It should be understood that various modifications may be made by those skilled in the art without departing from the spirit and scope of the present invention.

Claims (14)

복수의 제어부들이 구비된 차량 내에서 제어부들 간의 차량용 데이터를 송수신하는 통신 방법에 있어서,
차량용 데이터를 수신하는 단계;
메시지 인증값을 수신하는 단계; 및
상기 수신된 메시지 인증값에 대한 인증을 수행한 후, 송신 측 제어부와 공유하는 카운터(counter) 값을 이용하여 상기 수신된 차량용 데이터를 복호화하는 단계를 포함하고,
상기 카운터 값은 상기 카운터 값에 대응되는 미리 결정된 시간 구간 동안 유효하며, 상기 시간 구간은 상기 카운터 값 생성 시점부터 미리 설정된 일정 시간 경과 시점까지의 타임 윈도우(time window)에 대응되는 차량용 데이터 통신 방법.
A communication method for transmitting and receiving vehicle data between control units in a vehicle having a plurality of control units,
Receiving vehicle data;
Receiving a message authentication value; And
And decrypting the received vehicle data using a counter value shared by the transmitting-side control unit after performing the authentication on the received message authentication value,
Wherein the counter value is valid for a predetermined time interval corresponding to the counter value, and the time interval corresponds to a time window from a time point when the counter value is generated to a predetermined predetermined time elapsed time point.
제1항에 있어서,
상기 시간 구간은 상기 카운터 값에 대응되도록 시간적으로 분할된 복수의 타임 윈도우(time window)중 어느 하나인 차량용 데이터 통신 방법.
The method according to claim 1,
Wherein the time interval is any one of a plurality of time windows divided in time so as to correspond to the counter value.
제1항에 있어서,
상기 카운터 값은 상기 시간 구간의 가변에 동기화되어 함께 가변되는 것을 특징으로 하는 차량용 데이터 통신 방법.
The method according to claim 1,
Wherein the counter value is changed in synchronization with the variable of the time interval.
제1항에 있어서,
상기 복호화하는 단계는,
상기 송신 측 제어부로부터 수신된 상기 카운터 값이 수신 시점의 상기 시간 구간에 대응하여 가변되도록 설정된 수신측 카운터 값과 일치하는 경우, 상기 차량용 데이터를 복호화하는 단계를 포함하는
차량용 데이터 통신 방법.
The method according to claim 1,
Wherein the step of decrypting comprises:
And decrypting the vehicle data when the counter value received from the transmission-side control unit coincides with the reception-side counter value set to be variable in accordance with the time interval at the reception time
A method for communicating data for a vehicle.
제5항에 있어서,
상기 복호화하는 단계는,
상기 복호화가 실패하는 경우, 다음 시간 구간 또는 이전 시간 구간의 카운터 키를 이용하여 복호화를 시도하는 단계를 더 포함하는
차량용 데이터 통신 방법.
6. The method of claim 5,
Wherein the step of decrypting comprises:
If the decryption fails, attempting to decrypt using the counter key of the next time interval or the previous time interval
A method for communicating data for a vehicle.
제1항에 있어서, 상기 차량용 데이터는
CAN(Controller Area Network) 프로토콜을 사용하여 브로드캐스팅(boradcasting) 되는 메시지인 차량용 데이터 통신 방법.
2. The method according to claim 1, wherein the vehicle data
A method of data communication in a vehicle, the message being boradcasted using a CAN (Controller Area Network) protocol.
제1항에 있어서,
게이트웨이 제어부로부터 수신된 랜덤값을 이용하여, 차량용 데이터를 암호화/복호화하기 위한 암호화키와 메시지 인증값을 인증하기 위한 인증키를 생성하는 단계를 더 포함하는 차량용 데이터 통신 방법.
The method according to claim 1,
Further comprising generating an encryption key for encrypting / decrypting the vehicle data and an authentication key for authenticating the message authentication value using the random value received from the gateway control unit.
제8항에 있어서, 상기 차량용 데이터는
상기 암호화키로 암호화된 카운터 값과 배타적 연산(Xor) 수행하여 생성된 것인 차량용 데이터 통신 방법.
9. The method according to claim 8, wherein the vehicle data
And performing an exclusive operation (Xor) with the counter value encrypted with the encryption key.
제8항에 있어서, 상기 메시지 인증값은
상기 인증키를 이용해 일정 크기의 코드로 생성되는 차량용 데이터 통신 방법.
9. The method of claim 8,
And generating a code of a predetermined size using the authentication key.
제1항에 있어서, 상기 차량용 데이터는
상기 차량 내에 구비된 복수의 제어부들 이외의 외부 장치로부터 브로드캐스팅된 것인 차량용 데이터 통신 방법.
2. The method according to claim 1, wherein the vehicle data
Wherein the data is broadcast from an external device other than a plurality of control units provided in the vehicle.
제1항에 있어서,
시간 경과에 따라 현재 시점이 제1 시간 구간에서 제2 시간 구간으로 진입한 경우, 상기 카운터 값을 증가시키는 단계를 더 포함하는 차량용 데이터 통신 방법.
The method according to claim 1,
Further comprising the step of increasing the counter value when the current time has entered the second time interval from the first time interval according to the passage of time.
제1항에 있어서,
상기 수신하는 단계는, AES CTR 모드를 이용해 암호화되어 브로드캐스팅되는 초기 카운터 값과, 타임 윈도우 동기화를 위한 정보를 수신하는 단계를 더 포함하는 차량용 데이터 통신 방법.
The method according to claim 1,
Wherein the receiving further comprises receiving an initial counter value encrypted and broadcast using the AES CTR mode and information for time window synchronization.
제1항 내지 제12항 중 어느 한 항의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 기록 매체.A recording medium on which a program for causing a computer to execute the method of any one of claims 1 to 12 is recorded. 복수의 제어부들이 구비된 차량 내에서 제어부들 간의 차량용 데이터를 송수신하기 위한 통신 시스템에 있어서,
카운터 값과 암호화키를 이용하여 차량용 데이터를 암호화하고, 상기 암호화된 차량용 데이터와 인증키를 이용하여 메시지 인증값을 생성하여, 상기 암호화된 차량용 데이터와 상기 생성된 메시지 인증값을 브로드캐스팅하는 제1 제어부; 및
차량용 데이터와 메시지 인증값을 수신하고, 상기 인증키를 이용하여 상기 수신된 메시지 인증값에 대한 인증을 수행한 후 상기 카운터 값과 상기 암호화키를 이용하여 상기 수신된 차량용 데이터를 복호화하는 제2 제어부를 포함하고,
상기 카운터 값은 상기 제1 제어부와 상기 제2 제어부간 공유되는 미리 결정된 시간 구간 동안 유효하며, 상기 시간 구간은 상기 카운터 값 생성 시점부터 미리 설정된 일정 시간 경과 시점 또는 일정 시간 전후 시점까지의 하나 이상의 타임 윈도우(time window)에 대응되는 것을 특징으로 하는
차량용 통신 시스템.
A communication system for transmitting and receiving vehicle data between controllers in a vehicle having a plurality of controllers,
A method for encrypting vehicle data using a counter value and an encryption key, generating a message authentication value using the encrypted vehicle data and the authentication key, broadcasting the encrypted vehicle data and the generated message authentication value, A control unit; And
A second control unit for receiving the vehicle data and the message authentication value, performing authentication on the received message authentication value using the authentication key, and decrypting the received vehicle data using the counter value and the encryption key, Lt; / RTI >
The counter value is valid for a predetermined time interval that is shared between the first control unit and the second control unit, and the time interval is one or more times Characterized in that it corresponds to a time window
Vehicle communication system.
KR1020160106139A 2016-04-28 2016-08-22 Data communication method for vehicle, Electronic Control Unit and system thereof KR102287775B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160106139A KR102287775B1 (en) 2016-04-28 2016-08-22 Data communication method for vehicle, Electronic Control Unit and system thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020160052488A KR101651648B1 (en) 2016-04-28 2016-04-28 Data communication method for vehicle, Electronic Control Unit and system thereof
KR1020160106139A KR102287775B1 (en) 2016-04-28 2016-08-22 Data communication method for vehicle, Electronic Control Unit and system thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020160052488A Division KR101651648B1 (en) 2016-04-28 2016-04-28 Data communication method for vehicle, Electronic Control Unit and system thereof

Publications (2)

Publication Number Publication Date
KR20170123211A true KR20170123211A (en) 2017-11-07
KR102287775B1 KR102287775B1 (en) 2021-08-09

Family

ID=60385110

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160106139A KR102287775B1 (en) 2016-04-28 2016-08-22 Data communication method for vehicle, Electronic Control Unit and system thereof

Country Status (1)

Country Link
KR (1) KR102287775B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130083619A (en) * 2012-01-13 2013-07-23 고려대학교 산학협력단 Data certification and acquisition method for vehicle
KR20140121845A (en) * 2012-01-13 2014-10-16 펄스 펑션 에프6 리미티드 Telematics system with 3d inertial sensors
KR101481403B1 (en) * 2013-08-26 2015-01-21 고려대학교 산학협력단 Data certification and acquisition method for vehicle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130083619A (en) * 2012-01-13 2013-07-23 고려대학교 산학협력단 Data certification and acquisition method for vehicle
KR20140121845A (en) * 2012-01-13 2014-10-16 펄스 펑션 에프6 리미티드 Telematics system with 3d inertial sensors
KR101481403B1 (en) * 2013-08-26 2015-01-21 고려대학교 산학협력단 Data certification and acquisition method for vehicle

Also Published As

Publication number Publication date
KR102287775B1 (en) 2021-08-09

Similar Documents

Publication Publication Date Title
US10812969B2 (en) System and method for configuring a wireless device for wireless network access
KR101651648B1 (en) Data communication method for vehicle, Electronic Control Unit and system thereof
KR101675332B1 (en) Data commincaiton method for vehicle, Electronic Control Unit and system thereof
KR101508497B1 (en) Data certification and acquisition method for vehicle
KR100896365B1 (en) Method and apparatus for authentication of mobile device
US8788802B2 (en) Constrained cryptographic keys
CN107690642B (en) Method and system for transmitting data
CN105828332B (en) improved method of wireless local area network authentication mechanism
KR101549034B1 (en) Method for guarantying the confidentiality and integrity of a data in Controller Area Networks
RU2008146960A (en) METHOD AND SYSTEM OF PROVIDING PROTECTED COMMUNICATION USING A CELLULAR NETWORK FOR MANY PERSONALIZED COMMUNICATION DEVICES
WO2019001834A1 (en) Methods and apparatuses for access control to a network device from a user device
KR101481403B1 (en) Data certification and acquisition method for vehicle
US8707390B2 (en) System and method for secure access control in a wireless network
US20050086481A1 (en) Naming of 802.11 group keys to allow support of multiple broadcast and multicast domains
KR101290177B1 (en) Spectrum authorization and related communications methods and apparatus
CN113221136B (en) AIS data transmission method, AIS data transmission device, electronic equipment and storage medium
KR20170032210A (en) Data commincaiton method for vehicle, Electronic Control Unit and system thereof
KR102287775B1 (en) Data communication method for vehicle, Electronic Control Unit and system thereof
KR101451163B1 (en) System and method for access authentication for wireless network
CN116886208B (en) Information encryption transmission method, device, terminal equipment and storage medium
Rogobete et al. Improved authentication method in embedded networks systems. An autonomous vehicle approach
US20220360981A1 (en) Wireless device and network node for verification of a device as well as corresponding methods in a wireless communication system
CN114584169A (en) Digital radio communication
CN118174902A (en) Distributed equipment authentication method and system based on embedded security asymmetric key
KR20130062965A (en) System and method for access authentication for wireless network

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant