KR20220096818A - Private key protection method against cache side channel attack - Google Patents

Private key protection method against cache side channel attack Download PDF

Info

Publication number
KR20220096818A
KR20220096818A KR1020200189603A KR20200189603A KR20220096818A KR 20220096818 A KR20220096818 A KR 20220096818A KR 1020200189603 A KR1020200189603 A KR 1020200189603A KR 20200189603 A KR20200189603 A KR 20200189603A KR 20220096818 A KR20220096818 A KR 20220096818A
Authority
KR
South Korea
Prior art keywords
random
value
cache side
channel attack
secret key
Prior art date
Application number
KR1020200189603A
Other languages
Korean (ko)
Other versions
KR102505587B1 (en
Inventor
하재철
배대현
황종배
Original Assignee
호서대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 호서대학교 산학협력단 filed Critical 호서대학교 산학협력단
Priority to KR1020200189603A priority Critical patent/KR102505587B1/en
Publication of KR20220096818A publication Critical patent/KR20220096818A/en
Application granted granted Critical
Publication of KR102505587B1 publication Critical patent/KR102505587B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/24Key scheduling, i.e. generating round keys or sub-keys for block encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

The present invention relates to a private key protection method against a cache side channel attack and, more specifically, to a method for defending a secret key against a cache side channel attack through randomization of cryptographic reference table elements. According to the present invention, a shuffling table is configured in advance, a random RT-table is configured through this, a random RT-table value is obtained through this if plain text is inputted, and a cache side channel attack is fundamentally blocked by preventing a round key from being recovered even though an attacker performs a cache side channel attack by performing AES encryption by calculating with the round key.

Description

캐시 부채널 공격에 대한 비밀 키 방어 방법{Private key protection method against cache side channel attack}{Private key protection method against cache side channel attack}

본 발명은 캐시 부채널 공격에 대한 비밀 키 방어 방법에 관한 것으로서, 더욱 상세하게는, 암호용 참조 테이블 원소 랜덤화를 통하여 캐시 부채널 공격에 대한 비밀 키를 방어하는 방법에 관한 것이다.The present invention relates to a method for protecting a secret key against a cache side-channel attack, and more particularly, to a method for protecting a secret key against a cache side-channel attack through randomization of a reference table element for encryption.

AES(Advanced Encryption Standard)와 같은 암호 시스템은, 블록 암호 알고리즘 이용하여 데이터 암호화를 수행한다. 이 경우 시스템 구현의 최적화를 위해 1024 바이트 크기의 T-테이블을 4개(T0~T3) 사용하여 암호화 하는데, 기본적으로 다음과 같이 테이블을 참조하는 구조를 사용한다. An encryption system such as Advanced Encryption Standard (AES) performs data encryption using a block encryption algorithm. In this case, for the optimization of the system implementation, four (T0~T3) T-tables of 1024 byte size are used for encryption. Basically, the table referencing structure is used as follows.

Figure pat00001
Figure pat00001

이 경우 T-테이블에 들어있는 값이 고정되어 있으면 캐시 부채널 공격을 통해 참조한 T 테이블이 사용된 캐시 라인을 탐색하여 T[i]의 출력 값을 예측할 수 있다. 즉, 참조한 캐시 라인의 접근 정보를 가지고 T[i] 값의 후보를 찾을 수 있게 되는 것이다. 따라서 캐시 접근이 일어난 T[i] 후보 값을 정하고 해당 암호문을 저장할 수 있으므로, 공격자는 통계학적 분석을 통해 마지막 라운드 키 추출이 가능하고, 마지막 라운드 키를 추출하면 비밀 키를 역으로 계산할 수 있다. 즉, 암호화 과정에서 캐시 부채널 공격에 의해 비밀 키가 노출될 수 있는 문제점이 있어, 비밀 키가 노출되지 않는 대응 기법이 필요한 실정이다.In this case, if the value in the T-table is fixed, the output value of T[i] can be predicted by searching the cache line in which the referenced T table is used through a cache side-channel attack. That is, it is possible to find candidates for the T[i] value with access information of the referenced cache line. Therefore, since the T[i] candidate value for which the cache access has occurred can be determined and the corresponding ciphertext can be stored, the attacker can extract the last round key through statistical analysis, and by extracting the last round key, the secret key can be calculated inversely. That is, there is a problem in that the secret key may be exposed by a cache side-channel attack in the encryption process, so a countermeasure technique in which the secret key is not exposed is required.

KRKR 10-212444310-2124443 B1B1

G, Irazoqui, M. Inci, T. Eisenbarth and B. Sunar, “Wait a minute! A fast, Cross-VM attack on AES," International Workshop on Recent Advances in Intrusion Detection, pp. 299-319, 2014.G, Irazoqui, M. Inci, T. Eisenbarth and B. Sunar, “Wait a minute! A fast, Cross-VM attack on AES," International Workshop on Recent Advances in Intrusion Detection, pp. 299-319, 2014.

본 발명은 이와 같은 문제점을 해결하기 위해 창안된 것으로서, 사전에 셔플링 테이블을 구성하고 이를 통해 랜덤 RT-테이블을 구성하며, 평문이 입력되면 이를 통해 랜덤 RT-테이블 값을 가져오고 라운드 키와 연산하여 AES 암호를 수행함에 의해, 공격자가 캐시 부채널 공격을 수행하더라도 라운드 키를 복구할 수 없도록 함으로써, 캐시 부채널 공격을 원천적으로 차단시키는데 그 목적이 있다.The present invention was devised to solve such a problem. A shuffling table is configured in advance, a random RT-table is configured through this, and a random RT-table value is obtained through this when a plaintext is input, and a round key and operation are performed. The purpose of the AES encryption is to fundamentally block the cache side-channel attack by making it impossible to recover the round key even if an attacker performs a cache side-channel attack.

이와 같은 목적을 달성하기 위하여 본 발명에 따른 캐시 부채널 공격에 대한 비밀 키 방어 방법은, (a) 암호화할 평문을 입력받는 단계; (b) 랜덤 RT-테이블 값을 추출하는 단계; 및, (c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계를 포함한다.In order to achieve the above object, a method for protecting a secret key against a cache side-channel attack according to the present invention includes the steps of: (a) receiving a plaintext to be encrypted; (b) extracting random RT-table values; and, (c) performing encryption on the plaintext using the extracted random RT-table value and round key.

상기 단계(b) 이전에, (b0) 랜덤 RT-테이블을 재배치하는 단계를 더 포함할 수 있다.Prior to step (b), the method may further include (b0) rearranging the random RT-table.

상기 단계(b0)는, (b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및, (b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계를 포함할 수 있다.The step (b0) includes: (b01) performing randomization of a shuffling table; and, (b02) rearranging the random RT-table according to the randomized shuffling table.

상기 단계(b02)는, 고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치될 수 있다.In the step (b02), the table value for the index i of the fixed T-table is set to T[i], the table value for the index i of the shuffling table is set to S[i], and the index i of the random RT-table is When the table value for RT[i] is RT[i], for all values of i, the value of T[i] may be arranged as RT[S[i]].

본 발명의 다른 측면에 따르면, 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램은, 비일시적 저장 매체에 저장되며, 프로세서에 의하여, (a) 암호화할 평문을 입력받는 단계; (b) 랜덤 RT-테이블 값을 추출하는 단계; 및, (c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계가 실행되도록 하는 명령을 포함한다.According to another aspect of the present invention, a computer program for protecting a secret key against a cache side-channel attack is stored in a non-transitory storage medium, comprising the steps of: (a) receiving, by a processor, plaintext to be encrypted; (b) extracting random RT-table values; and, (c) executing the step of encrypting the plaintext using the extracted random RT-table value and round key.

상기 단계(b) 이전에, (b0) 랜덤 RT-테이블을 재배치하는 단계를 더 포함할 수 있다.Prior to step (b), the method may further include (b0) rearranging the random RT-table.

상기 단계(b0)는, (b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및, (b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계를 포함할 수 있다.The step (b0) includes: (b01) performing randomization of a shuffling table; and, (b02) rearranging the random RT-table according to the randomized shuffling table.

상기 단계(b02)는, 고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치될 수 있다.In the step (b02), the table value for the index i of the fixed T-table is set to T[i], the table value for the index i of the shuffling table is set to S[i], and the index i of the random RT-table is When the table value for RT[i] is RT[i], for all values of i, the value of T[i] may be arranged as RT[S[i]].

본 발명의 또 다른 측면에 따르면, 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치는, (a) 암호화할 평문을 입력받는 단계; (b) 랜덤 RT-테이블 값을 추출하는 단계; 및, (c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계가 실행되도록 한다.According to another aspect of the present invention, an apparatus for protecting a secret key against a cache side channel attack includes the steps of: (a) receiving a plaintext to be encrypted; (b) extracting random RT-table values; and (c) performing encryption on the plaintext using the extracted random RT-table value and round key.

상기 단계(b) 이전에, (b0) 랜덤 RT-테이블을 재배치하는 단계를 더 포함할 수 있다.Prior to step (b), the method may further include (b0) rearranging the random RT-table.

상기 단계(b0)는, (b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및, (b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계를 포함할 수 있다.The step (b0) includes: (b01) performing randomization of a shuffling table; and, (b02) rearranging the random RT-table according to the randomized shuffling table.

상기 단계(b02)는, 고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치될 수 있다.In the step (b02), the table value for the index i of the fixed T-table is set to T[i], the table value for the index i of the shuffling table is set to S[i], and the index i of the random RT-table is When the table value for RT[i] is RT[i], for all values of i, the value of T[i] may be arranged as RT[S[i]].

본 발명에 의하면, 사전에 셔플링 테이블을 구성하고 이를 통해 랜덤 RT-테이블을 구성하며, 평문이 입력되면 이를 통해 랜덤 RT-테이블 값을 가져오고 라운드 키와 연산하여 AES 암호를 수행함에 의해, 공격자가 캐시 부채널 공격을 수행하더라도 라운드 키를 복구할 수 없도록 함으로써, 캐시 부채널 공격을 원천적으로 차단시키는 효과가 있다.According to the present invention, a shuffling table is configured in advance, a random RT-table is configured through this, and when a plaintext is input, a random RT-table value is obtained through this, and an AES encryption is performed by calculating with a round key. It has the effect of fundamentally blocking the cache side-channel attack by making it impossible to recover the round key even if it performs a cache side-channel attack.

도 1은 캐시(cache) 메모리에 적재된 T-테이블의 구조를 나타내는 도면.
도 2는 셔플링(shuffling) 테이블의 구조를 나타내는 도면.
도 3은 셔플링 테이블을 이용한 랜덤 RT 테이블의 접근 방식을 설명하기 위한 도면.
도 4는 셔플링 테이블을 이용한 랜덤 RT 테이블 접근 방식을 운용하는 실시예를 나타내는 도면.
도 5는 기존의 AES 암호문을 구현하는 블럭도.
도 6은 본 발명에 따른 AES 암호문을 구현하는 블럭도.
도 7은 본 발명에 따른 AES 암호문을 구현하는 순서도.
1 is a diagram showing the structure of a T-table loaded in a cache memory;
2 is a diagram showing the structure of a shuffling table;
3 is a diagram for explaining an approach of a random RT table using a shuffling table.
4 is a diagram illustrating an embodiment of operating a random RT table approach using a shuffling table.
5 is a block diagram for implementing the existing AES ciphertext.
6 is a block diagram for implementing an AES ciphertext according to the present invention.
7 is a flowchart for implementing an AES ciphertext according to the present invention.

이하 첨부된 도면을 참조로 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. 이에 앞서, 본 명세서 및 청구범위에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다. 따라서, 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Prior to this, the terms or words used in the present specification and claims should not be construed as being limited to conventional or dictionary meanings, and the inventor should properly understand the concept of the term in order to best describe his invention. Based on the principle that it can be defined, it should be interpreted as meaning and concept consistent with the technical idea of the present invention. Accordingly, the embodiments described in this specification and the configurations shown in the drawings are only the most preferred embodiment of the present invention and do not represent all of the technical spirit of the present invention, so at the time of the present application, various It should be understood that there may be equivalents and variations.

도 1은 캐시(cache) 메모리에 적재된 T-테이블의 구조를 나타내는 도면이다.1 is a diagram showing the structure of a T-table loaded in a cache memory.

캐시는 라인 단위로 구성되어 있으며 일반적으로 하나의 캐시라인은 도 1에 도시된 바와 같이 64바이트 데이터를 적재할 수 있다. 또한 하나의 T-테이블을 적재하기 위해서는 16개의 캐시라인이 필요하다.The cache is configured in line units, and in general, one cache line can load 64 bytes of data as shown in FIG. 1 . Also, 16 cache lines are required to load one T-table.

동일한 키로 평문이 다른 메시지에 대해 암호 연산을 수천~수만 번 수행하며, 이때 각각의 암호화 과정 동안, 공격자는 특정 캐시라인에 대한 접근 여부를 캐시 부채널 공격으로 모니터링한다. 공격자는 모니터링을 통해서 수집한 캐시라인에 대한 접근 여부 정보를 이용해서, 암호화 과정 동안에 사용되거나 또는 사용되지 않은 테이블 원소를 추측할 수 있다.Cryptographic operations are performed thousands to tens of thousands of times on messages with different plaintexts with the same key, and during each encryption process, an attacker monitors access to a specific cache line using a cache side-channel attack. An attacker can guess the table elements that are used or not used during the encryption process by using the access information about the cash line collected through monitoring.

예)

Figure pat00002
Yes)
Figure pat00002

암호문은 위와 같은 연산을 통하여 생성될 수 있는데, 여기서 i는 T-테이블의 인덱스이며, 사용되는 T-테이블은 사전에 계산된 인덱스에 따른 고정된 값이다.A ciphertext can be generated through the above operation, where i is the index of the T-table, and the T-table used is a fixed value according to the index calculated in advance.

이와 같은 고정된 값의 T-테이블의 경우, 공격자는 수집한 캐시에 통계학적인 방법으로 접근한 인덱스 정보를 찾을 수 있고, 인덱스 정보를 알면 참조했던 테이블의 내용을 알 수 있으며, 결과적으로는 라운드 키와 비밀 키를 추출해 낼 수 있다. 이와 같이 비밀 키를 찾아내는 공격을 캐시 부채널 공격이라고 한다. In the case of such a fixed-value T-table, an attacker can find the index information accessed by a statistical method to the collected cache, and if the index information is known, the contents of the referenced table can be known, and as a result, the round key and the secret key can be extracted. An attack that finds the secret key in this way is called a cache side-channel attack.

즉, 공격자는,That is, the attacker

i) 캐시 접근 정보를 이용하여 T-테이블의 첫번째 16개 항목 사용 여부의 검사가 가능하고,i) It is possible to check whether the first 16 items of the T-table are used using the cache access information,

ii) 고정 T-테이블이 사용되고 있는 경우, T-테이블의 첫번째 캐시라인, 즉, 0-15인덱스에 접근한 암호문을 저장하여,ii) When a fixed T-table is used, the ciphertext accessed to the first cache line of the T-table, that is, index 0-15, is stored,

iii) 첫번째 캐시라인에 접근했던 인덱스 후보와 암호문 후보를 모아 통계학적 분석을 통해 비밀 키를 추출해내게 된다.iii) The secret key is extracted through statistical analysis by collecting the index candidates and ciphertext candidates who have accessed the first cash line.

이와 같은 캐시 부채널 공격이 성공할 수 있는 핵심 요인은, 전술한 바와 같이 캐시 접근 정보를 통해 암호화 과정 동안에 사용되거나 사용되지 않은 T-테이블 값을 특정할 수 있다는 것이다.A key factor for the success of such a cache side-channel attack is that, as described above, a T-table value that is used or not used during the encryption process can be specified through the cache access information.

도 2는 셔플링(shuffling) 테이블의 구조를 나타내는 도면이다.2 is a diagram illustrating a structure of a shuffling table.

T-테이블을 이용하는 AES 암호 알고리즘에서 캐시 부채널 공격에도 비밀 키가 노출되지 않도록 하는 테이블 사용 방식이 필요한데, 도 1을 참조하여 설명한 바와 같이, 수집한 캐시 접근 정보를 이용하더라도 암호화 과정에서 사용되거나 또는 사용되지 않은 T-테이블 값을 특정할 수 없도록 해야 하는 것이 관건이다. 따라서 대응 방법으로서, 매 암호화 과정마다 T-테이블 원소의 순서를 무작위로 섞어주어, 수집된 캐시 접근 정보로부터 T-테이블 값을 특정할 수 없도록 해야한다.In the AES encryption algorithm using T-table, it is necessary to use a table method that prevents the secret key from being exposed even to a cache side channel attack. The key is to ensure that unused T-table values cannot be specified. Therefore, as a countermeasure, the order of T-table elements should be randomly mixed in each encryption process so that the T-table value cannot be specified from the collected cache access information.

따라서 본 발명에서는, 무작위 순서의 새로운 T-테이블을 만들기 위하여, 암호화 전에 도 2에 도시된 바와 같은 256바이트의 셔플링(shuffling) 테이블을 만든다. 이러한 셔플링 테이블의 값은 도 2의 좌측 테이블과 같이 처음에 초기화 후, 매 암호화 과정마다 랜덤하게 값이 바뀌도록 한다. 도 2의 우측 테이블은 그와 같이 랜덤하게 바뀐 셔플링 테이블의 일 실시예를 도시한 것이다. 이 경우 셔플링 테이블 값은, 셔플링 알고리즘(예를 들어 Fisher-Yates 알고리즘 등)에 의해 0에서 255의 값이 중복되지 않으며 임의의 위치로 섞이도록 재배치된다.Therefore, in the present invention, in order to create a new T-table in a random order, a shuffling table of 256 bytes as shown in FIG. 2 is created before encryption. The values of the shuffling table are initially initialized as shown in the left table of FIG. 2 and then randomly changed in every encryption process. The right table of FIG. 2 shows an embodiment of the randomly changed shuffling table. In this case, the shuffling table values are rearranged by a shuffling algorithm (eg, Fisher-Yates algorithm, etc.) so that the values from 0 to 255 do not overlap and are shuffled to arbitrary positions.

도 3은 셔플링 테이블을 이용한 랜덤 RT-테이블의 접근 방식을 설명하기 위한 도면이고, 도 4는 셔플링 테이블을 이용한 랜덤 RT 테이블 접근 방식을 운용하는 실시예를 나타내는 도면이다.3 is a diagram for explaining a random RT-table access method using a shuffling table, and FIG. 4 is a diagram illustrating an embodiment of operating a random RT table access method using a shuffling table.

도 3(a)는 값이 캐시 메모리에 적재된, 고정 T-테이블을 나타내고, 도 3(b)는 본 발명의, 캐시 메모리 상에 랜덤하게 바뀌어 적재되는 T-테이블(이하 '랜덤 RT-테이블'이라 한다)을 나타낸다.Fig. 3(a) shows a fixed T-table in which values are loaded into the cache memory, and Fig. 3(b) is a T-table (hereinafter, 'random RT-table') which is randomly changed and loaded onto the cache memory of the present invention. ') is indicated.

도 3(b)를 참조하면, 도 2에 설명한 바와 같이, 암호화 과정마다 랜덤하게 만들어진 좌측의 셔플링 테이블에 따라, 우측과 같은 랜덤 RT-테이블을 만든다. i를 인덱스라 할 경우, S[i]는 셔플링 테이블의 인덱스 i에 대한 테이블 값이며, RT[i]는 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값이다. 즉, 인덱스 i에 대한 랜덤 RT-테이블의 테이블 값은 RT[S[i]]이 되며, 인덱스 i에 대하여, 도 3(a)의 고정 T-테이블의 테이블 값 T[i]와 랜덤 RT-테이블의 테이블 값 RT[S[i]]은 동일한 값이 되도록 RT-테이블을 구성하는 것이다.Referring to FIG. 3( b ), as described in FIG. 2 , a random RT-table as shown on the right is created according to the shuffling table on the left randomly generated for each encryption process. If i is an index, S[i] is a table value for index i of the shuffling table, and RT[i] is a table value for index i of a random RT-table. That is, the table value of the random RT-table for index i becomes RT[S[i]], and for index i, the table value T[i] of the fixed T-table of FIG. 3(a) and the random RT- The table value RT[S[i]] of the table constitutes the RT-table to be the same value.

이러한 결과로, 도 4를 참조하면, 도 4(a)와 도 4(b)의 좌측의 셔플링 테이블 값은 암호화 과정마다 변경되고, 이에 따라 도 4(a)와 도 4(b)의 우측 테이블과 같이 캐시 메모리에 적재되는 랜덤 RT-테이블 역시 항상 바뀌지만, 모든 인덱스 i에 대하여 RT[S[i]]은 항상 동일한 값이다. 즉, 데이터를 암호화할 경우에는 T-테이블 T[i]을 이용하는 것이 아니라, 새롭게 생성한 랜덤 RT-테이블을 이용하기 위하여 RT[S[i]]와 같이 접근하도록 하여, 동일한 인덱스 i에 대해 T-테이블을 이용하는 것과 랜덤 RT-테이블을 이용하여 암호화한 결과는 동일하지만, 캐시 메모리 상의 위치는 항상 랜덤하게 바뀌게 된다. 따라서 공격자가 캐시라인은 모니터링한다 하더라도 T-테이블 값을 특정할 수 없으며, 언제나 임의의(random) 원소를 이용하여 키를 분석하게 되므로, 캐시 부채널 공격은 실패할 수 밖에 없게 된다.As a result, referring to Fig. 4, the shuffling table values on the left side of Figs. 4(a) and 4(b) are changed for each encryption process, and accordingly, the values of Figs. 4(a) and 4(b) on the right side of Figs. Like a table, a random RT-table loaded into the cache memory also changes all the time, but for every index i, RT[S[i]] is always the same value. That is, when data is encrypted, instead of using T-table T[i], access is made like RT[S[i]] in order to use a newly created random RT-table, so that T for the same index i -The result of encryption using a table and a random RT-table is the same, but the location in the cache memory is always changed randomly. Therefore, even if the attacker monitors the cache line, the T-table value cannot be specified, and the key is always analyzed using a random element, so the cache side channel attack has no choice but to fail.

도 5는 기존의 AES 암호문을 구현하는 블럭도이고, 도 6은 본 발명에 따른 AES 암호문을 구현하는 블럭도이다.5 is a block diagram for implementing an existing AES cipher text, and FIG. 6 is a block diagram for implementing an AES cipher text according to the present invention.

AES 암호에서 마지막 라운드 키 한 바이트를 rk, 암호문 한 바이트를 c라고 할 때

Figure pat00003
과정이 필요하다. 도 5와 같이 고정된 T-테이블을 이용하는 경우, 이와 같은 암호문 생성, 즉, 암호화 시에 T[i]를 읽어오는 연산을 수행할 경우, 읽어온 T[i] 값이 캐시에 적재된다. 공격자는 공격 대상자가 이와 같이 캐시에 접근한 기록을 파악하여 인덱스 i값을 통계학적으로 찾아내고, T[i] 값을 구하여 최종적으로 라운드 키를 추출할 수 있게 된다.In AES cipher, when one byte of the last round key is rk and c is one byte of the ciphertext.
Figure pat00003
process is needed In the case of using a fixed T-table as shown in FIG. 5, when generating the ciphertext, ie, performing an operation to read T[i] during encryption, the read T[i] value is loaded into the cache. The attacker can find the index i value statistically by grasping the history of the attacker accessing the cache in this way, and finally extract the round key by obtaining the T[i] value.

그러나 본 발명을 나타내는 도 6의 블럭도에 따라, 암호화하는 경우마다 셔플링 테이블과 랜덤 RT-테이블을 사용하면, 도 2 내지 도 4를 참조하여 설명한 바와 같이 인덱스 i에 따라 캐시에 접근한 정보가 항상 달라져 있게 되어, 공격자는 라운드 키를 찾아낼 수 없게 되어 공격에 실패하게 된다.However, according to the block diagram of FIG. 6 showing the present invention, if a shuffling table and a random RT-table are used for each encryption, as described with reference to FIGS. 2 to 4, information accessed to the cache according to index i is It will always be different, and the attacker will not be able to find the round key and will fail the attack.

도 7은 본 발명에 따른, 캐시 부채널 공격에 대한 비밀 키 방어를 위한 암호문 생성을 구현하는 순서도이다.7 is a flowchart for implementing the generation of a ciphertext for protecting a secret key against a cache side-channel attack according to the present invention.

먼저 새로운 암호화할 평문이 입력된 경우(S701), 셔플링 테이블의 값을 랜덤값으로 재배치, 즉, 랜덤화를 수행한다(S702). 이때 셔플링 테이블 값은, 셔플링 알고리즘(예를 들어 Fisher-Yates 알고리즘 등)에 의해 일정 범위(예를 들어 0에서 255)의 값이 중복되지 않으며 임의의 위치로 섞이도록 재배치된다.First, when a new plaintext to be encrypted is input (S701), the value of the shuffling table is rearranged to a random value, that is, randomization is performed (S702). At this time, the values of the shuffling table are rearranged so that values within a certain range (eg, 0 to 255) do not overlap and are mixed in arbitrary positions by a shuffling algorithm (eg, Fisher-Yates algorithm, etc.).

이와 같이 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블의 값을 재배치한다(S703). 이때 고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치되게 되고, 이와 같이 재배치된 랜덤 RT 테이블이 캐시 메모리에 적재되는 것이다. 이로써 암호문 생성시에 고정 T 테이블의 T[i]값을 이용하려는 경우, 랜덤 RT-테이블의 RT[S[i]]를 이용함으로써 동일한 값을 이용하게 되지만, 캐시 메모리 상에서는 암호문 생성시마다 랜덤 RT-테이블은 랜덤 재배치가 되어 있는 상태가 되어 있게 된다.The values of the random RT-table are rearranged according to the randomized shuffling table as described above (S703). At this time, the table value for index i of the fixed T-table is T[i], the table value for index i of the shuffling table is S[i], and the table value for index i of the random RT-table is RT[i] In this case, for all i values, the T[i] value is arranged as RT[S[i]], and the relocated random RT table is loaded into the cache memory. Accordingly, if the T[i] value of the fixed T table is used when generating the ciphertext, the same value is used by using the RT[S[i]] of the random RT-table, but in the cache memory, the random RT- The table is in a state in which random relocation is performed.

이후, 인덱스 i에 대한 셔플링 테이블 값을 인덱스로 하여 랜덤 RT-테이블 값을 추출하며(S704), 이와 같이 추출된 랜덤 RT-테이블 값, 비밀 키로부터 생성된 라운드 키를 이용하여 평문을 암호화 함으로써 암호문을 생성한다(S705).Thereafter, a random RT-table value is extracted using the shuffling table value for index i as an index (S704), and the plaintext is encrypted using the round key generated from the thus extracted random RT-table value and the secret key. A cipher text is generated (S705).

100: 암호문 생성부100: cipher text generator

Claims (12)

캐시 부채널 공격에 대한 비밀 키 방어 방법으로서,
(a) 암호화할 평문을 입력받는 단계;
(b) 랜덤 RT-테이블 값을 추출하는 단계; 및,
(c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계
를 포함하는 캐시 부채널 공격에 대한 비밀 키 방어 방법.
A secret key defense method against a cache side-channel attack, comprising:
(a) receiving an input of plaintext to be encrypted;
(b) extracting random RT-table values; and,
(c) performing encryption on the plaintext using the extracted random RT-table value and round key
A secret key defense method against cache side-channel attacks, including:
청구항 1에 있어서,
상기 단계(b) 이전에,
(b0) 랜덤 RT-테이블을 재배치하는 단계
를 더 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대한 비밀 키 방어 방법.
The method according to claim 1,
Prior to step (b),
(b0) relocating the random RT-table
Secret key defense method against a cache side-channel attack, characterized in that it further comprises.
청구항 2에 있어서,
상기 단계(b0)는,
(b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및,
(b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계
를 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대한 비밀 키 방어 방법.
3. The method according to claim 2,
The step (b0) is,
(b01) performing randomization of a shuffling table; and,
(b02) rearranging the random RT-table according to the randomized shuffling table
A secret key defense method against a cache side-channel attack, comprising a.
청구항 3에 있어서,
상기 단계(b02)는,
고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치되는 것
을 특징으로 하는 캐시 부채널 공격에 대한 비밀 키 방어 방법.
4. The method according to claim 3,
The step (b02) is,
The table value for index i of the fixed T-table is T[i], the table value for index i of the shuffling table is S[i], and the table value for index i of the random RT-table is RT[i] ], for all i values, the T[i] value is arranged as RT[S[i]]
A secret key defense method against cache side-channel attacks, characterized in that
캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램으로서,
비일시적 저장 매체에 저장되며, 프로세서에 의하여,
(a) 암호화할 평문을 입력받는 단계;
(b) 랜덤 RT-테이블 값을 추출하는 단계; 및,
(c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계
가 실행되도록 하는 명령을 포함하는,
캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램.
A computer program for defending a secret key against a cache side-channel attack, comprising:
It is stored in a non-transitory storage medium, and by the processor,
(a) receiving an input of plaintext to be encrypted;
(b) extracting random RT-table values; and,
(c) performing encryption on the plaintext using the extracted random RT-table value and round key
containing the command to be executed,
A computer program for defending a secret key against cache side-channel attacks.
청구항 5에 있어서,
상기 단계(b) 이전에,
(b0) 랜덤 RT-테이블을 재배치하는 단계
를 더 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램.
6. The method of claim 5,
Prior to step (b),
(b0) relocating the random RT-table
A computer program for defending the secret key against a cache side-channel attack, characterized in that it further comprises a.
청구항 6에 있어서,
상기 단계(b0)는,
(b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및,
(b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계
를 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램.
7. The method of claim 6,
The step (b0) is,
(b01) performing randomization of a shuffling table; and,
(b02) rearranging the random RT-table according to the randomized shuffling table
A computer program for defending the secret key against a cache side-channel attack comprising a.
청구항 7에 있어서,
상기 단계(b02)는,
고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치되는 것
을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 컴퓨터 프로그램.
8. The method of claim 7,
The step (b02) is,
The table value for index i of the fixed T-table is T[i], the table value for index i of the shuffling table is S[i], and the table value for index i of the random RT-table is RT[i] ], for all i values, the T[i] value is arranged as RT[S[i]]
A computer program for defending the secret key against a cache side-channel attack, characterized in that.
캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치로서,
(a) 암호화할 평문을 입력받는 단계;
(b) 랜덤 RT-테이블 값을 추출하는 단계; 및,
(c) 상기 추출된 랜덤 RT-테이블 값 및 라운드 키를 이용하여 상기 평문에 대한 암호화를 수행하는 단계
가 실행되도록 하는,
캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치.
A device for defending a secret key against a cache side-channel attack, comprising:
(a) receiving an input of plaintext to be encrypted;
(b) extracting random RT-table values; and,
(c) performing encryption on the plaintext using the extracted random RT-table value and round key
to run,
A device for defending secret keys against cache side-channel attacks.
청구항 9에 있어서,
상기 단계(b) 이전에,
(b0) 랜덤 RT-테이블을 재배치하는 단계
를 더 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치.
10. The method of claim 9,
Prior to step (b),
(b0) relocating the random RT-table
Device for defending the secret key against a cache side-channel attack, characterized in that it further comprises.
청구항 10에 있어서,
상기 단계(b0)는,
(b01) 셔플링(shuffling) 테이블의 랜덤화를 수행하는 단계; 및,
(b02) 랜덤화된 셔플링 테이블에 따라 랜덤 RT-테이블을 재배치하는 단계
를 포함하는 것을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치.
11. The method of claim 10,
The step (b0) is,
(b01) performing randomization of a shuffling table; and,
(b02) rearranging the random RT-table according to the randomized shuffling table
Apparatus for defending the secret key against a cache side-channel attack, characterized in that it comprises a.
청구항 11에 있어서,
상기 단계(b02)는,
고정 T-테이블의 인덱스 i에 대한 테이블 값을 T[i], 상기 셔플링 테이블의 인덱스 i에 대한 테이블 값을 S[i], 상기 랜덤 RT-테이블의 인덱스 i에 대한 테이블 값을 RT[i]라 할 경우, 모든 i값에 대하여, T[i] 값은 RT[S[i]]로 배치되는 것
을 특징으로 하는 캐시 부채널 공격에 대하여 비밀 키를 방어하기 위한 장치.
12. The method of claim 11,
The step (b02) is,
The table value for index i of the fixed T-table is T[i], the table value for index i of the shuffling table is S[i], and the table value for index i of the random RT-table is RT[i] ], for all i values, the T[i] value is arranged as RT[S[i]]
A device for defending the secret key against a cache side-channel attack, characterized in that.
KR1020200189603A 2020-12-31 2020-12-31 Private key protection method against cache side channel attack KR102505587B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200189603A KR102505587B1 (en) 2020-12-31 2020-12-31 Private key protection method against cache side channel attack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200189603A KR102505587B1 (en) 2020-12-31 2020-12-31 Private key protection method against cache side channel attack

Publications (2)

Publication Number Publication Date
KR20220096818A true KR20220096818A (en) 2022-07-07
KR102505587B1 KR102505587B1 (en) 2023-03-02

Family

ID=82398904

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200189603A KR102505587B1 (en) 2020-12-31 2020-12-31 Private key protection method against cache side channel attack

Country Status (1)

Country Link
KR (1) KR102505587B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100667189B1 (en) * 2005-12-10 2007-01-12 한국전자통신연구원 Apparatus for aes encryption in mobile device and method thereby
KR102124443B1 (en) 2018-11-22 2020-06-24 광운대학교 산학협력단 A Real-Time Detection System And Method On Flush Reload Attack Using PCM

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100667189B1 (en) * 2005-12-10 2007-01-12 한국전자통신연구원 Apparatus for aes encryption in mobile device and method thereby
KR102124443B1 (en) 2018-11-22 2020-06-24 광운대학교 산학협력단 A Real-Time Detection System And Method On Flush Reload Attack Using PCM

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
G, Irazoqui, M. Inci, T. Eisenbarth and B. Sunar, "Wait a minute! A fast, Cross-VM attack on AES," International Workshop on Recent Advances in Intrusion Detection, pp. 299-319, 2014.
Johanna Sepulveda 외 3명, Towards Trace-driven Cache Attacks on Systems-on-Chips - Exploiting Bus Communication, 2017 12th International Symposium on Reconfigurable Communication-centric Systems-on-Chip (ReCoSoc), IEEE (2017.08.24.)* *
Stephen Crane 외 4명, Thwarting Cache Side-Channel Attacks Through Dynamic Software Diversity, NDSS (2015.02.11.)* *

Also Published As

Publication number Publication date
KR102505587B1 (en) 2023-03-02

Similar Documents

Publication Publication Date Title
US8345876B1 (en) Encryption/decryption system and method
CN1989726B (en) Method and device for executing cryptographic calculation
CN107077469B (en) Server device, search system, terminal device, and search method
KR102413846B1 (en) A method for protecting encryption processes using SBOX from higher-order side-channel attacks
EP2953052B1 (en) Systems and methods for dynamic data storage
WO2017173136A9 (en) Key update for masked keys
Kim et al. A method for decrypting data infected with hive ransomware
US10673627B2 (en) Encryption device, search device, computer readable medium, encryption method, and search method
Khashan et al. Secure Stored Images Using Transparent Crypto Filter Driver.
CN112532379A (en) File protection method and device
de Loaysa Babiano et al. Evaluation of live forensic techniques, towards Salsa20-Based cryptographic ransomware mitigation
KR102505587B1 (en) Private key protection method against cache side channel attack
KR20140134796A (en) Method and apparatus for managing distribution of file to recover original file with at least pre-determined number file fragments with random sizes
Nakano et al. Memory access pattern protection for resource-constrained devices
US20210143978A1 (en) Method to secure a software code performing accesses to look-up tables
CN111475690A (en) Character string matching method and device, data detection method and server
US11061996B2 (en) Intrinsic authentication of program code
CN116881986B (en) Hard disk data confidentiality method and system
Jókay et al. Steganographic file system based on JPEG files
Geng et al. Securing Relational Database Storage with Attribute Association Aware Shuffling
EP4366232A1 (en) Secure and fast bit unpacking for dilithium
Alfawair et al. Secure Image Indexing Using Speeded Up Robust Features (SURF) Key Points and SHAKE256 Hashing
KR20240066806A (en) Method of storing encryption key using table and method of extracting encryption key
EP3975470A1 (en) Method for securing an execution of an algorithm of a cryptographic process
Huang et al. A true random-number encryption method

Legal Events

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