KR20040093306A - Micro Controller unit with program security - Google Patents

Micro Controller unit with program security Download PDF

Info

Publication number
KR20040093306A
KR20040093306A KR1020030027180A KR20030027180A KR20040093306A KR 20040093306 A KR20040093306 A KR 20040093306A KR 1020030027180 A KR1020030027180 A KR 1020030027180A KR 20030027180 A KR20030027180 A KR 20030027180A KR 20040093306 A KR20040093306 A KR 20040093306A
Authority
KR
South Korea
Prior art keywords
program code
rom
bit
flag
predetermined bit
Prior art date
Application number
KR1020030027180A
Other languages
Korean (ko)
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 KR1020030027180A priority Critical patent/KR20040093306A/en
Publication of KR20040093306A publication Critical patent/KR20040093306A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1673Details of memory controller using buffers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/82Protecting input, output or interconnection devices
    • G06F21/85Protecting input, output or interconnection devices interconnection devices, e.g. bus-connected or in-line devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/22Microcontrol or microprogram arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)

Abstract

PURPOSE: An MCU having a program security function is provided to keep security of a program code by encrypting/storing the program code to a ROM and decrypting the stored program code with a flag bit. CONSTITUTION: The ROM(210) stores the program code of 10 bits by encrypting the program code of 8 bits with the flag bit of 2 bits. A decryption tool decrypts the encrypted program code output from the ROM by using the flag bit and transmits the decrypted program code to an internal bus system. The decryption tool comprises XOR gates(321-324) generating the program code of the 8 bits by respectively using the flag bit(FB) and data(D0-D3) output from the ROM as input.

Description

프로그램 보안기능을 갖는 마이크로 콘트롤장치{Micro Controller unit with program security}Micro controller unit with program security

본 발명은 마이크로 콘트롤러 유니트에 관한 것으로서, 보다 구체적으로는 롬의 프로프램 코드를 암호화하여 롬에 저장하므로써, 롬의 프로그램 코드의 보안을 유지할 수 있는 마이크로 콘트롤장치 및 그의 보안방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcontroller unit, and more particularly, to a microcontroller and a security method thereof capable of maintaining the security of a program code of a ROM by encrypting and storing the program code of the ROM in a ROM.

8-비트 마이크로 콘트롤러 유니트(Micro Controller Unit, MCU)는 사용상의 편의성으로 인하여 전자산업의 다양한 분야에서 채택되어 이용되고 있으며, 해당 응용 프로그램에 따라 다양한 특징을 지니게 된다. 특히 현재 전자산업이 개인을 위한 맞춤 시스템의 형태로 변화하면서, 개인정보를 보호하는 문제가 크게 매우 심각하게 대두되고 있는 실정이다.The 8-bit micro controller unit (MCU) has been adopted and used in various fields of the electronics industry because of its ease of use, and has various characteristics depending on the application. In particular, as the electronic industry changes to the form of personalized systems for individuals, the problem of protecting personal information is very serious.

또한, 응용 시스템의 설계단계에서부터 시스템을 보호하기 위한 롬코드의 보안문제가 대두되었으며, 이를 위한 다양한 롬 코드의 보안장치가 개발되어 사용되고 있다.In addition, the security problem of the ROM code to protect the system from the design stage of the application system has emerged, and various ROM code security devices have been developed and used for this purpose.

도 1은 일반적인 MCU 의 구성도를 도시한 것으로서, 중앙처리장치(CPU, 10), 에스램(SRAM, 15) 및 프로그램용 롬(20), 데이터용 EEPROM(25)를 구비하며, 또한, 타이머(30), 직렬 I/O(serial I/O, 35), 와치독 타이머(watch-dog timer, 40), 펄스폭 변조기(Pulse-Width Modulation, PWM), (45) 등 여러 주변장치를 구비한다.1 is a block diagram of a general MCU, which includes a central processing unit (CPU) 10, an SRAM 15, a program ROM 20, and an EEPROM 25 for data, and also includes a timer. (30), serial I / O (35), watch-dog timer (40), Pulse-Width Modulation (PWM), (45) do.

상기 MCU의 구성요소중 롬(20)은 시스템의 응용코드가 저장되는 프로그램 영역으로서, 전체 시스템의 프로그램 코드가 저장된다. CPU(10)는 매 명령어 사이클마다 프로그램 어드레스에 따라 해당 어드레스에 저장되어 있는 프로그램 코드를 읽어 들이고(fetch), 읽어 들인 프로그램코드를 디코딩하며(decode), 디코딩된 결과에 따라 해당명령을 수행하게 된다(execute).ROM 20 of the components of the MCU is a program area for storing the application code of the system, the program code of the entire system is stored. The CPU 10 reads the program code stored in the corresponding address according to the program address in every instruction cycle, decodes the read program code, and executes the corresponding instruction according to the decoded result. (execute).

롬(20)으로부터 출력되는 데이터는 내부 시스템 버스(50)에 연결되어 CPU(10)로 전달되는데,8-비트 MCU의 경우에는 데이터 버스가 8비트로 구성되기 때문에, 도 2에 도시된 바와 같이 8비트의 데이터출력을 갖는 롬을 사용한다. 즉, 롬(20)은 각 어드레스에 8-비트의 프로그램 코드를 저장하고, 프로그램이 수행됨에 따라 롬(20)으로부터 해당 어드레스에 저장되어 있는 8-비트의 코드가 출력되어 CPU(10)를 이용하게 된다.Data output from the ROM 20 is connected to the internal system bus 50 and transferred to the CPU 10. In the case of an 8-bit MCU, since the data bus is composed of 8 bits, 8 is shown in FIG. Use ROM with bit data output. That is, the ROM 20 stores 8-bit program code at each address, and as the program is executed, the 8-bit code stored at the address is output from the ROM 20 to use the CPU 10. Done.

그러나 종래의 MUC 에서는 사용자 코드를 해킹하기 위한 기술이 발달하여 프로그램이 동작하는 동안 내부시스템 버스에 실리는 데이터 값을 정확하게 알아내는 문제점이 있었다. 또한, 외부 롬을 사용하는 경우에도 외부 롬과 MCU간의 연결버스를 통해 정확하게 프로그램 코드를 알아내는 문제점이 있었다.However, in the conventional MUC, a technique for hacking user code has been developed, and thus there is a problem in that the data value on the internal system bus is accurately determined while the program is running. In addition, even in the case of using an external ROM, there was a problem in that the program code was correctly found out through the connection bus between the external ROM and the MCU.

따라서 본 발명은 상기한 바와 같은 종래기술의 문제점을 해결하기 위한 것으로서, 프로그램 코드를 암호화하여 롬에 저장하고, 저장된 프로그램 코드를 플래그비트를 통해 복호화하여 프로그램 코드의 보안을 유지시켜 줄 수 있는 마이크로 콘트롤 장치 및 그의 프로그램 코드보안방법을 제공하는 데 그 목적이 있다.Therefore, the present invention is to solve the problems of the prior art as described above, micro-control that can maintain the security of the program code by encrypting the program code and stored in the ROM, and decrypts the stored program code through the flag bit It is an object of the present invention to provide a device and a program code security method thereof.

도 1은 일반적인 마이크로 콘트롤러 유니트의 구성도,1 is a configuration diagram of a general microcontroller unit;

도 2는 종래의 8-비트 롬의 내부 데이터를 나타내는 도면,2 is a diagram showing internal data of a conventional 8-bit ROM;

도 3은 본 발명의 일 실시예에 따른 내부롬의 프로그램 보안기능을 갖는 마이크로 콘트로러 유니트의 구성도,3 is a configuration diagram of a microcontroller unit having a program security function of an internal ROM according to an embodiment of the present invention;

도 4는 본 발명의 다른 실시예에 따른 외부롬의 프로그램 보안기능을 갖는 마이크로 콘트롤러의 구성도,4 is a configuration diagram of a microcontroller having a program security function of an external ROM according to another embodiment of the present invention;

도 5는 도 4의 마이크로 콘트롤러 유니트에 있어서, 플래그비트 선택회로의 구성도,5 is a configuration diagram of a flag bit selection circuit in the microcontroller unit of FIG. 4;

도 6는 본 발명의 내부 롬의 데이터를 나타내는 도면,6 is a diagram showing data of an internal ROM of the present invention;

*도면의 주요 부분에 대한 부호의 설명** Description of the symbols for the main parts of the drawings *

21, 310 : 롬 330 : 플래그 비트 셀렉터21, 310: ROM 330: Flag bit selector

340 : 스페이트 머신 331-334 : 버퍼340: spat machine 331-334: buffer

335, 336 : D 플립플롭 337 : 디코더335, 336: D flip-flop 337: decoder

221-224, 321-324 : 익스클루시브 오아 게이트221-224, 321-324: Exclusive Oa Gate

상기한 바와 같은 목적을 달성하기 위하여, 본 발명은 내부에 롬을 구비하는 마이크로 콘트롤 장치에 있어서, 상기 롬은 플래그 비트를 이용하여 암호화된 제1소정 비트의 프로그램 코드가 저장되며, 상기 롬으로부터 출력되는 암호화된 프로그램 코드를 복호화하고, 복호화된 제2소정비트의 프로그램 코드를 내부 시스템버스로 전송하기 위한 복호화수단을 구비하는 프로그램 보안기능을 갖는 마이크로 콘트롤 장치를 제공하는 것을 특징으로 한다.In order to achieve the above object, the present invention provides a microcontroller having a ROM therein, wherein the ROM stores a program code of a first predetermined bit encrypted using flag bits, and outputs from the ROM. It is characterized in that it provides a micro control device having a program security function having a decryption means for decrypting the encrypted program code to be transmitted, and transmits the decrypted second predetermined bit program code to the internal system bus.

상기 내부 롬은 프로그램 코드를 플래그 비트와 익스클루시브 오아 논리동작에 의해 암호화한 프로그램 코드가 저장되어 있으며, 상기 롬에 저장된 제1소정비트의 프로그램중 상위 2비트는 플래그 비트로 사용한다. 상기 복호화수단은 상기 플래그비트와 프로그램 코드를 입력하여 익스클루시브 오아 논리동작을 수행하는 다수의 익스클루시브 오아 게이트 이루어진다.The internal ROM stores a program code obtained by encoding a program code by a flag bit and an exclusive OR operation. The upper two bits of the first predetermined bit program stored in the ROM are used as flag bits. The decoding means comprises a plurality of exclusive or gates for inputting the flag bits and the program code to perform an exclusive or logical operation.

또한, 본 발명은 외부에 롬과 램을 구비하는 마이크로 콘트롤 장치에 있어서, 상기 롬은 암호화된 제1소정 비트의 프로그램 코드가 저장되며, 상기 롬으로부터 출력되는 암호화된 프로그램 코드를 플래그비트를 이용하여 복호화하고, 복호화된 제1소정비트의 프로그램코드를 내부 시스템버스로 전송하기 위한 복호화수단과; 제1 및 제2제어신호에 의해 플래그 비트를 선택하기 위한 플래그비트 셀렉터와; 상기 플래그 비트 셀렉터로부터 선택된 플래그비트를 순서대로 상기 복호화수단으로 제공하기 위한 스테이트 머신을 구비하는 프로그램 보안기능을 갖는 마이크로 콘트롤 장치를 제공하는 것을 특징으로 한다.In addition, the present invention is a micro-control device having a ROM and a RAM in the outside, the ROM is stored in the program code of the first predetermined bit encrypted, and the encrypted program code output from the ROM using a flag bit Decoding means for decoding and transmitting the decoded first predetermined bit program code to an internal system bus; A flag bit selector for selecting flag bits according to the first and second control signals; A microcontroller having a program security function comprising a state machine for sequentially providing flag bits selected from the flag bit selector to the decryption means.

상기 외부 롬은 스테이트 머신으로부터 출력되는 플래그비트의 순서에 따라 프로그램 코드가 익스클루시브 오아 논리동작에 의해 암호화한 프로그램 코드가 저장되어 있으며, 상기 복호화수단은 상기 스테이트 머신으로부터 제공되는 플래그비트와 프로그램 코드를 입력하여 익스클루시브 오아 논리동작을 수행하는 다수의 익스클루시브 오아 게이트 이루어진다.The external ROM stores a program code encrypted by an exclusive or logical operation by a program code according to an order of flag bits output from a state machine, and the decryption means includes a flag bit and a program code provided from the state machine. A plurality of exclusive ora gates is formed to perform an exclusive ora logical operation by inputting a.

상기 플래그 비트셀렉터는 내부 리세트신호에 따라 마이크로 콘트롤장치로부터 외부로 제1 및 제2제어신호를 각각 출력하기 위한 제1 및 제2버퍼와; 상기 제1 및 제2버퍼를 통해 출력되는 제1 및 제2제어신호를 플래그비트 셀렉터의 입력신호로 전환하기 위한 제3 및 제4버퍼와; 상기 제3 및 제4버퍼의 출력신호를 클럭신호와 동기시켜 주기위한 제1 및 제2플립플롭과; 상기 제1 및 제2플립플롭의 출력신호를 디코딩하여 플래그 비트를 선택하기 위한 디코더를 구비한다.The flag bit selector includes: first and second buffers for outputting first and second control signals to the outside from the microcontroller according to an internal reset signal; Third and fourth buffers for converting first and second control signals output through the first and second buffers into input signals of a flag bit selector; First and second flip-flops for synchronizing output signals of the third and fourth buffers with a clock signal; And a decoder for selecting flag bits by decoding the output signals of the first and second flip-flops.

또한, 본 발명은 내부 롬을 구비하는 마이크로 콘트롤 장치에 있어서, 상기 내부 롬에 제1소정비트의 프로그램 코드를 제2소정비트의 플래그비트와 암호화하고, 암호화된 제3소정비트의 프로그램 코드를 저장하는 단계와; 상기 내부 롬에 저장된 제3소정비트의 프로그램 코드를 제2소정비트의 플래그 비트를 이용하여 복호화하고, 복호화된 제1소정비트의 프로그램 코드를 시스템 버스로 전달하는 단계로 이루어지는 마이크로 콘트롤장치의 프로그램코드 보안방법을 제공하는 것을 특징으로 한다.In addition, the present invention provides a microcontroller having an internal ROM, wherein the program code of the first predetermined bit is encrypted with the flag bit of the second predetermined bit in the internal ROM, and the encrypted program code of the third predetermined bit is stored. Making a step; Program code of a microcontroller, comprising: decoding a program code of a third predetermined bit stored in the internal ROM by using a flag bit of a second predetermined bit, and transferring the decoded first predetermined bit program code to a system bus It is characterized by providing a security method.

또한, 본 발명은 외부 롬과 램을 구비하는 마이크로 콘트롤 장치에 있어서, 상기 외부 롬에 제1소정비트의 프로그램 코드를 암호화하여 저장하는 단계와; 상기외부 롬과 램을 억세스하기 위한 제1 및 제2제어신호를 이용하여 제2소정비트의 플래그 비트를 선택하는 단계와; 상기 선택된 플래그비트의 순서에 따라 상기 제1소정비트의 암호화된 프로그램 코드를 제1소정비트의 프로그램 코드로 복호화하여 시스템버스로 전달하는 단계로 이루어지는 마이크로 콘트롤장치의 프로그램코드 보안방법을 제공하는 것을 특징으로 한다.In addition, the present invention provides a microcontroller having an external ROM and a RAM, comprising: encrypting and storing a program code of a first predetermined bit in the external ROM; Selecting a flag bit of a second predetermined bit by using first and second control signals for accessing the external ROM and the RAM; And providing a program code security method of the microcontroller, the method comprising: decrypting an encrypted program code of the first predetermined bit into a program code of a first predetermined bit according to the order of the selected flag bit and transmitting the same to a system bus. It is done.

이하, 본 발명의 실시예를 첨부된 도면을 참조하여 설명하면 다음과 같다.Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.

도 3은 본 발명의 실시예에 따른 MCU 가 내부 롬을 사용하는 경우에 있어서, 프로그램 코드가 저장된 롬의 보안을 유지하기 위한 구성도를 도시한 것이다.3 is a block diagram for maintaining the security of the ROM in which the program code is stored when the MCU uses an internal ROM according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 MCU는 8비트의 프로그램 코드가 2비트 플래그비트를 이용하여 10-비트 프로그램 코드로 암호화되어 저장되어 있는 롬(210)과, 상기 롬(210)에 저장된 10-비트 프로그램 코드를 상기 플래그 비트를 이용하여 복호화하여 MCU의 내부 시스템 버스(도 1의 50)으로 전달하기 위한 복호화수단을 구비한다. 상기 복호화수단은 각각 플래그비트(FB)와 롬(210)으로부터의 데이터(D0-D3)를 각각 입력으로 하여 8비트의 프로그램 코드를 발생하는 다수의 익스클루시브 오아 게이트(221-224)로 이루어진다.Referring to FIG. 3, the MCU of the present invention includes a ROM 210 in which 8-bit program code is encrypted and stored as a 10-bit program code using a 2-bit flag bit, and 10-stored in the ROM 210. And decoding means for decoding the bit program code using the flag bits and transferring the bit program code to the MCU's internal system bus (50 in FIG. 1). The decoding means comprises a plurality of exclusive ora gates 221-224 which generate flag bits FB and data D0-D3 from the ROM 210, respectively, and generate 8-bit program codes. .

상기한 바와 같은 구성을 갖는 내부 롬을 사용하는 MCU의 프로그램의 보안을 유지하는 동작에 대하여 다음과 같다.The operation of maintaining the security of the program of the MCU using the internal ROM having the above configuration is as follows.

상기 롬(210)에는 도 6에 도시된 바와 같이, 종래의 8-비트의 프로그램 코드를 저장하는 대신에 8-비트의 프로그램 코드를 10-비트의 프로그램 코드로 암호화하여 저장한다. 이때, 롬(210)에 저장되는 10비트의 프로그램 코드는 2-비트의 플래그비트(flag bit)를 이용하여 익스클루시브 오아 논리동작이 수행된 프로그램 코드가 저장된다.As shown in FIG. 6, instead of storing the conventional 8-bit program code, the ROM 210 encrypts and stores the 8-bit program code into a 10-bit program code. In this case, the 10-bit program code stored in the ROM 210 may store a program code in which an exclusive OR operation is performed using a 2-bit flag bit.

그러므로, CPU(10)가 롬(210)에 저장되어 있는 프로그램 코드를 사용하기 위하여 상기 롬(210)을 억세스하는 경우에는, 인에이블신호가 하이레벨로 유지되므로, 모든 프로그램 코드는 MCU 내부의 롬(210)으로부터 가져온다.Therefore, when the CPU 10 accesses the ROM 210 to use the program code stored in the ROM 210, the enable signal is maintained at a high level, so that all program codes are stored in the ROM inside the MCU. Taken from 210.

즉, 롬(210)으로부터 독출된 10비트의 암호화된 프로그램 코드는 2비트 플래그비트를 이용하여 익스클루시브 오아게이트(221-224)를 통해 8-비트의 프로그램 코드로 복호화되어 내부 시스템 버스로 전달되어진다. 이때, 롬(210)으로부터 독출되는 10비트의 프로그램코드중 상위 2비트는 플래그비트를 의미한다.That is, the 10-bit encrypted program code read from the ROM 210 is decoded into 8-bit program code through the exclusive OA gates 221-224 using the 2-bit flag bit and transferred to the internal system bus. It is done. At this time, the upper two bits of the 10-bit program code read from the ROM 210 mean a flag bit.

본 발명의 MUC 에서는, 롬(210)의 각 데이터 출력비트마다 익스클루시브 오아게이트가 각가 연결되도록 구성되어 딜레이가 크지 않으므로 동작주파수가 높은 MCU에서도 사용가능하다. 본 발명의 실시예에서는 도 5에 도시된 바와 같이, 플래그비트(FB)가 "00"부터 "11" 까지의 값을 가지며, "00, 01, 10, 11"의 순으로 각 어드레스에 순차적으로 사용되도록 하였으나, 플래그비트의 순서는 반드시 이에 국한되는 것이 아니라 사용자의 결정에 따라 달라질 수 있다.In the MUC of the present invention, since an exclusive orifice is configured to be connected to each data output bit of the ROM 210, the delay is not large, and therefore, the MUC may be used in an MCU having a high operating frequency. In the embodiment of the present invention, as shown in Figure 5, the flag bit (FB) has a value from "00" to "11", sequentially in each address in the order of "00, 01, 10, 11" Although it is intended to be used, the order of the flag bits is not necessarily limited thereto and may vary according to a user's decision.

도 4는 본 발명의 다른 실시예에 따른 MCU가 외부 롬을 사용하는 경우에 있어서, 프로그램 코드가 저장된 외부 롬의 보안을 유지하기 위한 구성도를 도시한 것이다.4 is a block diagram for maintaining the security of the external ROM in which the program code is stored when the MCU uses the external ROM according to another embodiment of the present invention.

도 4를 참조하면, MCU는 8비트의 프로그램 코드가 익스클르시브 오아되어 저장되어 있는 외부 롬(310)과, 상기 외부 롬(310)으로부터 출력되는 8비트의 프로그램 코드를 플래그비트에 의해 복호화하는 복호화수단을 구비한다. 이때, 상기 복호화수단은 플래그비트와 외부롬(310)으로부터 독출된 데이터(D0-D3)을 입력으로 하여 8비트의 프로그램 코드를 발생하는 다수의 익스클루시브 오아 게이트(321-324)와, 상기 인에이블신호(EAN)과 외부 롬과 내부롬을 억세스하기 위한 제어신호(ALE), (PSENN)를 이용하여 플래그비트를 선택하기 위한 플래그비트 셀렉터(330)과, 셀렉트 비트(330)를 통해 선택된 플래그비트(FB)를 순차적으로 상기 복호화수단인 익스클루시브 오아게이트(321-324)에 제공하기 위한 스테이트 머신(340)을 구비한다.Referring to FIG. 4, the MCU decodes an external ROM 310 in which an 8-bit program code is exclusively stored and an 8-bit program code output from the external ROM 310 by flag bits. And decoding means. In this case, the decoding means includes a plurality of exclusive OR gates 321-324 for generating an 8-bit program code by inputting flag bits and data D 0 -D 3 read from the external ROM 310, and The flag bit selector 330 for selecting a flag bit using the enable signal EAN, the control signals ALE and PSENN for accessing the external ROM and the internal ROM, and the select bit 330 are selected. A state machine 340 is provided to sequentially provide the flag bits FB to the exclusive oragates 321-324 which are the decoding means.

도 4에서와 같이 MCU가 외부 롬을 사용하는 경우에는 외부롬(310)으로부터 8비트의 프로그램 코드가 출력되므로, 외부 롬에 저장되어 있는 프로그램코드를 복호화시켜 내부시스템 버스로 전달하기 위해서는 별도로 플래그비트(FB)를 입력시켜 주어야 하는데, 이러한 플래그 비트셀렉터가 도 5에 도시되어 있다.As shown in FIG. 4, when the MCU uses an external ROM, an 8-bit program code is output from the external ROM 310. Therefore, in order to decode the program code stored in the external ROM and transmit the program code to the internal system bus, a flag bit is separately provided. (FB) should be input. This flag bit selector is shown in FIG.

도 5를 참조하면, 본 발명의 플래그 비트 셀렉터(330)는 외부 롬 및 램을 억세스하기 위한 제어신호(ALE)와 (PSENN)를 내부 리세트신호(IRESET)에 의해 각각 출력하기 위한 3상버퍼(331), (332)와, 상기 3상 버퍼(331), (332)를 통해 출력되는 제어신호(ALE), (PSENN)를 각각 입력신호로 전환하기 위한 버퍼(333), (334)와, 외부 리세트신호(ERESET)에 의해 인에이블되고 클럭신호(CLK)에 동기시켜 상기 제어신호(ALE)와 (PSENN)를 출력하기 위한 D플립플립(335), (336)과, 외부롬을 사용하는 경우 로우상태로 되는 인에이블신호(EAN)에 의해 인에이블되어 상기 D플립플롭(335),(336)의 출력신호를 입력하여 플래그비트(FB)를 출력하는 디코더(337)로 이루어진다.Referring to FIG. 5, the flag bit selector 330 of the present invention is a three-phase buffer for respectively outputting control signals ALE and PSENN for accessing an external ROM and RAM by an internal reset signal IRESET. 331 and 332 and buffers 333 and 334 for converting the control signals ALE and PSENN output through the three-phase buffers 331 and 332 into input signals, respectively. And D flip-flops 335 and 336, which are enabled by an external reset signal ERESET and output the control signals ALE and PSENN in synchronization with the clock signal CLK. In this case, the decoder 337 includes a decoder 337 which is enabled by the enable signal EAN in a low state and inputs an output signal of the D flip-flops 335 and 336 to output a flag bit FB.

상기한 바와같은 구성을 갖는 플래그비트 셀렉터(330)는 내부 리세트신호(IRESET)에 의해 3상버퍼(331), (332)를 통해 출력되는 제어신호(ALE), (PSENN)를 버퍼(333), (334)를 통해 각각 입력신호로 전환한다. 이때, 제어신호(ALE)와 (PSENN)는 리세트 구간에서 입력상태가 되어 D플립플롭(335), (336)으로 각각 제공된다.The flag bit selector 330 having the configuration as described above buffers the control signals ALE and PSENN output through the three-phase buffers 331 and 332 by the internal reset signal IRESET. ) And (334) are respectively converted into input signals. At this time, the control signals ALE and PSENN become input states in the reset period and are provided to the D flip-flops 335 and 336, respectively.

플립플롭(335), (336)은 클럭신호(CLK)에 동기되어 상기 제어신호(ALE)와 (PSENN)를 샘플링하고, 리세트 구간이 종료되면 플립플롭(335), (336)의 출력값이 디코더(337)에 의해 디코딩되어 플래그비트(FB)를 결정하게 된다.The flip-flops 335 and 336 sample the control signals ALE and PSENN in synchronization with the clock signal CLK. When the reset period ends, the output values of the flip-flops 335 and 336 are adjusted. Decoded by the decoder 337 to determine the flag bit (FB).

상기 플래그 비트 셀렉터(330)를 통해 출력되는 플래그 비트(FB)는 2비트이므로 4개의 상태를 갖게 되는데, 플래그 비트 셀렉터(330)를 통해 출력되는 플래그 비트(FB)는 스테이트 머신(330)에 전달되고, 스테이트 머신(340)은 아래 표 1과 같이 미리 정해진 순서에 따라 플래그 비트를 결정한다.Since the flag bit FB output through the flag bit selector 330 has two bits, the flag bit FB has four states. The flag bit FB output through the flag bit selector 330 is transmitted to the state machine 330. The state machine 340 determines the flag bits in a predetermined order as shown in Table 1 below.

플래그 비트 셀렉터 출력Flag bit selector output 0000 0101 1010 1111 스테이트 머신에서 출력되는 플래그비트순서Flag bit order output from the state machine 0001101100011011 0110110001101100 1011000110110001 1100011011000110

예를 들어, 플래그 비트 셀렉터(330)의 출력이 "00" 인 경우에는 (표 1)에서 보는 바와 같은 순서대로 스테이트 머신(340)으로부터 플래그 비트(FB)가 복호화수단인 익스클루시브 오아 게이트(321-324)로 제공된다. 이때, 플레그 비트셀렉터(330)의 출력이 "00" 인 경우에는 외부 롬(310)에는 프로그램 코드가 "00, 01, 10, 11"의 순서로 익스클루시브 오아 논리동작을 수행하여 저장되어있다.For example, when the output of the flag bit selector 330 is "00", the exclusive oragate whose flag bit FB is the decoding means from the state machine 340 in the order as shown in (Table 1) 321-324. At this time, when the output of the flag bit selector 330 is "00", the program code is stored in the external ROM 310 by performing the exclusive OR operation in the order of "00, 01, 10, 11". .

따라서, 익스클루시브 오아 게이트(321-324)는 상기 스테이트 머신(340)으로부터 제공되는 플래그비트(FB)와 외부롬(310)으로부터 어드레스순서에 따라 출력되는 프로그램 코드를 입력하고, 2비트씩 익스클루시브 오아 논리동작을 수행하여 외부 롬(310)으로부터 출력되는 데이터를 복호화하여 8비트의 프로그램 코드를 내부 시스템 버스로 제공하게 된다.Accordingly, the exclusive oar gates 321-324 input flag bits FB provided from the state machine 340 and program codes outputted from the external ROM 310 in address order, and extract by 2 bits. The exclusive OR operation is performed to decode data output from the external ROM 310 to provide an 8-bit program code to the internal system bus.

이때, MCU는 외부롬(310)에 저장된 데이터와 스테이트 머신으로부터 출력되는 플래그 비트의 순서가 제공되어, 정확한 결과를 얻을 수 있으며, 이에 따라 롬의 프로그램 코드를 간단하게 암호화하여 롬의 프로그램 코드의 보안을 유지할 수 있다.In this case, the MCU is provided with the data stored in the external ROM 310 and the order of the flag bits output from the state machine, so that accurate results can be obtained. Accordingly, the program code of the ROM can be easily encrypted to secure the program code of the ROM. Can be maintained.

상기한 바와 같은 본 발명의 실시예에 따르면, 8비트 MCU의 프로그램 코드를 간단하게 플래그 비트를 암호화하고 복호화하여 프로그램 코드의 보안을 유지할 수 있으며, 또한 이러한 방법으로 프로그램 코드를 저장하는 롬 뿐만 아니라 사용자 데이터를 저장하는 이이피롬 또는 메인 메모리로 사용되는 램에도 적용가능하다. 또한, 본 발명은 2개의 플립플롭과 롬의 데이터 출력크기에 따른 익스클루시브 오아 게이트만으로 프로그램 코드의 보안을 유지시켜 줄 수 있으므로, 본 발명을 다른 형태의 MCU와 롬을 사용하는 시스템에도 적용가능하다.According to the embodiment of the present invention as described above, it is possible to maintain the security of the program code by simply encrypting and decrypting the flag bit of the program code of the 8-bit MCU, and also the user as well as the ROM storing the program code in this way. It is also applicable to RAM used as main memory or EPIROM storing data. In addition, the present invention can maintain the security of the program code only by the exclusive or gate according to the data output size of the two flip-flops and ROM, the present invention can be applied to a system using other types of MCU and ROM Do.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although described above with reference to a preferred embodiment of the present invention, those skilled in the art will be variously modified and changed within the scope of the invention without departing from the spirit and scope of the invention described in the claims below I can understand that you can.

Claims (11)

내부에 롬을 구비하는 마이크로 콘트롤 장치에 있어서,In the microcontroller having a ROM therein, 상기 롬은 플래그 비트를 이용하여 암호화된 제1소정 비트의 프로그램 코드가 저장되며,The ROM stores a program code of a first predetermined bit encrypted using a flag bit. 상기 롬으로부터 출력되는 암호화된 프로그램 코드를 복호화하고, 복호화된 제2소정비트의 프로그램 코드를 내부 시스템버스로 전송하기 위한 복호화수단을 구비하는 것을 특징으로 하는 프로그램 보안기능을 갖는 마이크로 콘트롤 장치.And decrypting means for decrypting the encrypted program code output from the ROM, and for transmitting the decrypted second predetermined bit program code to an internal system bus. 제 1 항에 있어서, 상기 내부 롬은 프로그램 코드를 플래그 비트와 익스클루시브 오아 논리동작에 의해 암호화한 프로그램 코드가 저장되어 있는 것을 특징으로 프로그램 보안기능을 갖는 마이크로 콘트롤장치.The microcontroller according to claim 1, wherein the internal ROM stores a program code obtained by encoding a program code by a flag bit and an exclusive OR operation. 제 2 항에 있어서, 상기 복호화수단은 상기 플래그비트와 프로그램 코드를 입력하여 익스클루시브 오아 논리동작을 수행하는 다수의 익스클루시브 오아 게이트 이루어지는 것을 특징으로 프로그램 보안기능을 갖는 마이크로 콘트롤장치.3. The microcontroller according to claim 2, wherein the decryption means comprises a plurality of exclusive or gates for inputting the flag bits and the program code to perform an exclusive OR operation. 제 1 항에 있어서, 상기 롬에 저장된 제1소정비트의 프로그램중 상위 2비트는 플래그 비트로 사용하는 것을 특징으로 하는 마이크로 콘트롤장치.The microcontroller according to claim 1, wherein the upper two bits of the first predetermined bit program stored in the ROM are used as flag bits. 외부에 롬과 램을 구비하는 마이크로 콘트롤 장치에 있어서,In the microcontroller having a ROM and RAM on the outside, 상기 롬은 암호화된 제1소정 비트의 프로그램 코드가 저장되며,The ROM stores a program code of an encrypted first predetermined bit. 상기 롬으로부터 출력되는 암호화된 프로그램 코드를 플래그비트를 이용하여 복호화하고, 복호화된 제1소정비트의 프로그램코드를 내부 시스템버스로 전송하기 위한 복호화수단;Decrypting means for decrypting the encrypted program code outputted from the ROM using a flag bit and transmitting the decrypted first predetermined bit program code to an internal system bus; 제1 및 제2제어신호에 의해 플래그 비트를 선택하기 위한 플래그비트 셀렉터; 및A flag bit selector for selecting flag bits by first and second control signals; And 상기 플래그 비트 셀렉터로부터 선택된 플래그비트를 순서대로 상기 복호화수단으로 제공하기 위한 스테이트 머신을 구비하는 것을 특징으로 하는 프로그램 보안기능을 갖는 마이크로 콘트롤 장치.And a state machine for sequentially providing flag bits selected from said flag bit selector to said decryption means. 제 1 항에 있어서, 상기 외부 롬은 스테이트 머신으로부터 출력되는 플래그비트의 순서에 따라 프로그램 코드가 익스클루시브 오아 논리동작에 의해 암호화된 프로그램 코드가 저장되어 있는 것을 특징으로 프로그램 보안기능을 갖는 마이크로 콘트롤장치.2. The microcontroller according to claim 1, wherein the external ROM stores a program code encrypted by an exclusive or logical operation according to a sequence of flag bits output from a state machine. Device. 제 6 항에 있어서, 상기 복호화수단은 상기 스테이트 머신으로부터 제공되는 플래그비트와 프로그램 코드를 입력하여 익스클루시브 오아 논리동작을 수행하는 다수의 익스클루시브 오아 게이트 이루어지는 것을 특징으로 프로그램 보안기능을 갖는 마이크로 콘트롤장치.The microcomputer having a program security function according to claim 6, wherein the decryption means comprises a plurality of exclusive oragates which perform an exclusive ora logical operation by inputting a flag bit and a program code provided from the state machine. Control unit. 제 5 항에 있어서, 상기 플래그 비트셀렉터는The method of claim 5, wherein the flag bit selector is 내부 리세트신호에 따라 마이크로 콘트롤장치로부터 외부로 제1 및 제2제어신호를 각각 출력하기 위한 제1 및 제2버퍼;First and second buffers for outputting first and second control signals, respectively, from the micro control device to the outside according to the internal reset signal; 상기 제1 및 제2버퍼를 통해 출력되는 제1 및 제2제어신호를 플래그비트 셀렉터의 입력신호로 전환하기 위한 제3 및 제4버퍼;Third and fourth buffers for converting first and second control signals output through the first and second buffers into input signals of a flag bit selector; 상기 제3 및 제4버퍼의 출력신호를 클럭신호와 동기시켜 주기위한 제1 및 제2플립플롭; 및First and second flip-flops for synchronizing output signals of the third and fourth buffers with a clock signal; And 상기 제1 및 제2플립플롭의 출력신호를 디코딩하여 플래그 비트를 선택하기 위한 디코더를 구비하는 것을 특징으로 하는 프로그램 보안기능을 갖는 마이크로 콘트롤장치.And a decoder for selecting flag bits by decoding the output signals of the first and second flip-flops. 제8항에 있어서, 상기 제1 및 제2제어신호는 각각 상기 롬과 램을 억세스하기 위한 제어신호인 것을 특징으로 하는 프로그램 보안기능을 갖는 마이크로 콘트롤장치.9. The microcontroller according to claim 8, wherein the first and second control signals are control signals for accessing the ROM and RAM, respectively. 내부 롬을 구비하는 마이크로 콘트롤 장치에 있어서,In a microcontroller having an internal ROM, 상기 내부 롬에 제1소정비트의 프로그램 코드를 제2소정비트의 플래그비트와 암호화하고, 암호화된 제3소정비트의 프로그램 코드를 저장하는 단계; 및Encrypting a program code of a first predetermined bit and a flag bit of a second predetermined bit in the internal ROM, and storing an encrypted program code of a third predetermined bit; And 상기 내부 롬에 저장된 제3소정비트의 프로그램 코드를 제2소정비트의 플래그 비트를 이용하여 복호화하고, 복호화된 제1소정비트의 프로그램 코드를 시스템 버스로 전달하는 단계로 이루어지는 것을 특징으로 하는 마이크로 콘트롤장치의 프로그램코드 보안방법.And decoding the program code of the third predetermined bit stored in the internal ROM using the flag bit of the second predetermined bit, and transferring the decoded first predetermined bit program code to the system bus. How to secure program code of device. 외부 롬과 램을 구비하는 마이크로 콘트롤 장치에 있어서,In a micro control device having an external ROM and a RAM, 상기 외부 롬에 제1소정비트의 프로그램 코드를 암호화하여 저장하는 단계;Encrypting and storing a first predetermined bit program code in the external ROM; 상기 외부 롬과 램을 억세스하기 위한 제1 및 제2제어신호를 이용하여 제2소정비트의 플래그 비트를 선택하는 단계; 및Selecting a flag bit of a second predetermined bit by using first and second control signals for accessing the external ROM and the RAM; And 상기 선택된 플래그비트의 순서에 따라 상기 제1소정비트의 암호화된 프로그램 코드를 제1소정비트의 프로그램 코드로 복호화하여 시스템버스로 전달하는 단계로 이루어지는 것을 특징으로 하는 마이크로 콘트롤장치의 프로그램코드 보안방법.And decrypting the encrypted program code of the first predetermined bit into a program code of a first predetermined bit according to the order of the selected flag bit and transferring the encrypted program code to a system bus.
KR1020030027180A 2003-04-29 2003-04-29 Micro Controller unit with program security KR20040093306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030027180A KR20040093306A (en) 2003-04-29 2003-04-29 Micro Controller unit with program security

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030027180A KR20040093306A (en) 2003-04-29 2003-04-29 Micro Controller unit with program security

Publications (1)

Publication Number Publication Date
KR20040093306A true KR20040093306A (en) 2004-11-05

Family

ID=37373411

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030027180A KR20040093306A (en) 2003-04-29 2003-04-29 Micro Controller unit with program security

Country Status (1)

Country Link
KR (1) KR20040093306A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100604828B1 (en) * 2004-01-09 2006-07-28 삼성전자주식회사 Method for executing encryption and decryption of firmware and apparatus thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100604828B1 (en) * 2004-01-09 2006-07-28 삼성전자주식회사 Method for executing encryption and decryption of firmware and apparatus thereof

Similar Documents

Publication Publication Date Title
US5214697A (en) Program execution apparatus for ensuring security of a program
US8457306B2 (en) Cryptographic module and IC card
JP4684550B2 (en) Cryptographic device that supports multiple modes of operation
JP4740611B2 (en) A key scheduler that selectively generates an encryption round key and a decryption round key corresponding to an initial round key having a variable key length
US7913316B2 (en) Semiconductor integrated circuit and method for testing semiconductor integrated circuit
US8826042B2 (en) Memory controller, memory control apparatus, memory device, memory information protection system, control method for memory control apparatus, and control method for memory device
JP2005216027A (en) Encryption device, encryption system therewith, decryption device and semiconductor system therewith
KR0137709B1 (en) Method for protecting an enciphered computer object code against cryptanalysis
JP2005209108A (en) Microcomputer with external memory
US20050147239A1 (en) Method for implementing advanced encryption standards using a very long instruction word architecture processor
KR20040093306A (en) Micro Controller unit with program security
JP2008140104A (en) Memory system and memory access method
CN115357947A (en) Hardware implementation method and device for obtaining trusted digital identity CTID network card data
JP2006254099A (en) Microprocessor
US20030138099A1 (en) Method for computer-based encryption and decryption of data
JP2000029790A (en) Data security system
JP2005210271A (en) Device to be authenticated, authentication device, authentication system, digital authentication method, and digital authentication integrated circuit
KR100986226B1 (en) Arithmetic device and encryption/decryption device
JPH07219852A (en) Semiconductor memory device
JP2002358008A (en) Data enciphering circuit
KR20010025564A (en) Apparatus and method for securing recording medium drive
KR100468615B1 (en) Apparatus for protecting internal program
JP2006279868A (en) Semiconductor device, and ic card comprising the same
KR20050095168A (en) A processor for computing multi encryption/decryption algorithm
KR100528890B1 (en) High-speed block cipher with multi-interfaces and method of operating the same

Legal Events

Date Code Title Description
A201 Request for examination
N231 Notification of change of applicant
E902 Notification of reason for refusal
E601 Decision to refuse application