KR101978684B1 - Code-based encryption apparatus and method capable of preventing replay attack - Google Patents

Code-based encryption apparatus and method capable of preventing replay attack Download PDF

Info

Publication number
KR101978684B1
KR101978684B1 KR1020170110648A KR20170110648A KR101978684B1 KR 101978684 B1 KR101978684 B1 KR 101978684B1 KR 1020170110648 A KR1020170110648 A KR 1020170110648A KR 20170110648 A KR20170110648 A KR 20170110648A KR 101978684 B1 KR101978684 B1 KR 101978684B1
Authority
KR
South Korea
Prior art keywords
value
matrix
message
hash
error vector
Prior art date
Application number
KR1020170110648A
Other languages
Korean (ko)
Other versions
KR20190024064A (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 KR1020170110648A priority Critical patent/KR101978684B1/en
Publication of KR20190024064A publication Critical patent/KR20190024064A/en
Application granted granted Critical
Publication of KR101978684B1 publication Critical patent/KR101978684B1/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/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • 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/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/20Manipulating the length of blocks of bits, e.g. padding or block truncation

Abstract

재생 공격 방지가 가능한 부호 기반 암호화 장치 및 방법이 개시된다. 본 발명에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치 및 방법은 부호 기반의 암호화 방식에 있어서, 암호화가 수행될 때마다 소정의 난수를 생성하여 상기 난수를 상기 원본 메시지에 반영함으로써, 매번 암호화 메시지의 패턴이 다르게 생성되도록 유도하여 제3자의 재생 공격(Replay Attack)으로 인한 원본 메시지의 노출을 최소화할 수 있다.A code-based encryption apparatus and method capable of preventing a replay attack are disclosed. A code-based encryption apparatus and method capable of preventing a replay attack according to the present invention is characterized in that in a code-based encryption scheme, a predetermined random number is generated every time encryption is performed and the random number is reflected in the original message, It is possible to minimize the exposure of the original message due to the replay attack of the third party by inducing the pattern to be generated differently.

Description

재생 공격 방지가 가능한 부호 기반 암호화 장치 및 방법{CODE-BASED ENCRYPTION APPARATUS AND METHOD CAPABLE OF PREVENTING REPLAY ATTACK}TECHNICAL FIELD [0001] The present invention relates to a code-based encryption apparatus and method capable of preventing a replay attack,

본 발명은 암호화 메시지의 생성 패턴을 인지하여 암호화 메시지로부터 원본 메시지를 복원해내는 재생 공격(Replay Attack)을 방지할 수 있는 부호 기반 암호화 장치 및 방법에 대한 것이다.The present invention relates to a code-based encryption apparatus and method capable of preventing a replay attack that recognizes a generation pattern of an encrypted message and restores an original message from an encrypted message.

최근, 다양한 형태의 정보가 생성되고 유통됨에 따라, 해킹이나 잘못된 경로로의 정보 전달로 인해 중요한 정보가 제3자에게 노출되는 등의 피해가 발생하고 있다.Recently, as various types of information are generated and circulated, important information is exposed to a third party due to hacking or transmission of information to a wrong path.

특히, 정보의 전달과정에서 군사 정보나 개인 정보 등과 같은 중요 정보에 어떠한 방어 기제가 적용되어 있지 않은 상태에서 이러한 중요 정보가 우연히 제3자에게 전달된다면, 제3자가 손쉽게 중요 정보에 접근할 수 있어, 큰 피해가 발생할 수 있다.Particularly, in case that important information such as military information or personal information is not applied in the process of transmitting information, and if such important information is accidentally transmitted to a third party, a third party can easily access important information , Can cause great damage.

최근에는 이러한 중요 정보의 노출을 방지하기 위해, 중요 정보를 소정의 암호화키를 이용하여 암호화한 후 이를 상대방에게 전달하는 기법 등이 도입되고 있다.Recently, in order to prevent exposure of such important information, a technique of encrypting important information by using a predetermined encryption key and transmitting it to the other party has been introduced.

일반적인 데이터 암호화 방식은 데이터 전송측과 데이터 수신측이 동일한 비밀키를 공유하고 있다가, 데이터 전송측이 비밀키로 데이터를 암호화해서 전송하면, 데이터 수신측이 동일한 비밀키로 데이터를 복호화하는 방식이 사용된다.In a general data encryption scheme, when the data transmission side and the data reception side share the same secret key and the data transmission side encrypts and transmits the data with the secret key, a method in which the data reception side decrypts the data with the same secret key is used .

하지만, 이러한 대칭키 기반의 암호화 방식은 비밀키의 전달 및 공유 과정에서 해당 비밀키가 노출될 위험성이 존재한다는 점에서 보안에 취약한 약점이 존재한다.However, such a symmetric key-based cryptosystem has a weak vulnerability in that there is a risk that the corresponding secret key is exposed in the process of transmitting and sharing the secret key.

이러한 대칭키 기반의 암호화 방식의 단점을 해소하기 위해서, 공개키와 개인키라는 비대칭키를 활용한 데이터 암호화 방식이 도입되었다. 비대칭키 기반의 데이터 암호화 방식은 데이터 전송측이 공개키로 데이터를 암호화해서 데이터 수신측으로 전송하면, 데이터 수신측이 상기 공개키에 대응하는 개인키로 데이터를 복호화하거나 데이터 전송측이 개인키로 데이터를 암호화해서 데이터 수신측으로 전송하면, 데이터 수신측이 상기 공개키로 데이터를 복호화하는 방식이 사용된다.In order to solve the drawbacks of symmetric key based cryptosystem, data encryption system using asymmetric key, which is a public key and a private key, has been introduced. In the asymmetric key-based data encryption scheme, when the data transmission side encrypts data with the public key and transmits the data to the data reception side, the data reception side decrypts the data with the private key corresponding to the public key, or the data transmission side encrypts the data with the private key When the data is transmitted to the data receiving side, a method in which the data receiving side decrypts the data with the public key is used.

이렇게, 다양한 암호화 방식이 등장하고 있지만, 항상 동일한 암호화키를 이용하여 평문을 암호화하게 되면, 암호문의 생성 패턴 분석을 통한 재생 공격(Replay Attack)이 가능하다는 점에서 이를 방지하기 위한 기법으로 암호화 대상이 되는 평문 데이터에 대해 난수를 추가하여 암호화함으로써, 암호문의 패턴 분석이 불가능하도록 하는 기법의 도입을 고려할 수 있다.Although a variety of encryption schemes have been introduced in this way, it is a technique to prevent replay attack by analyzing generation pattern of ciphertext if plaintext is always encrypted using the same encryption key. It is possible to consider introducing a technique of encrypting the plaintext data by adding a random number so as to disable the pattern analysis of the ciphertext.

아울러, 최근에는 암호화 과정에서 고성능의 컴퓨터 시스템을 기반으로 한 공격에 대응하기 위해 부호 기반의 암호화 방식이 도입되고 있다.Recently, a code-based encryption method has been introduced to cope with an attack based on a high-performance computer system in an encryption process.

부호 기반의 암호화 방식은 데이터 전송 장치가 t(t는 자연수)비트의 코드에 대한 오류 정정 능력을 갖는 선형 코드에 대한 "1"과 "0"의 코드 값을 성분으로 포함하는 k x n(k와 n은 자연수) 크기의 생성 행렬 Ge와 "1"과 "0"의 코드 값을 성분으로 포함하는 k x k 크기의 이진 정칙 행렬(Binary non-singular matrix) S 및 "1"과 "0"의 코드 값을 성분으로 포함하는 n x n 크기의 순열 행렬 P를 활용해서 공개키 Kpub을 만들고, 데이터 수신 장치로 전송할 메시지 m을 상기 공개키 Kpub로 암호화하여 암호화 메시지 c를 생성한 후 상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송하면, 상기 데이터 수신 장치가 메모리 상에 기 저장하고 있는 상기 생성 행렬 Ge, 상기 이진 정칙 행렬 S 및 상기 순열 행렬 P를 개인키로 활용해서 상기 암호화 메시지에 대한 복호화를 수행함으로써, 상기 메시지 m을 복원하는 방식이다.The code-based cryptosystem is such that kxn (k and n), which includes a code value of " 1 " and " 0 " for a linear code having error correction capability for a code of t is a natural number) generation matrix of size G e and "1" and code of "0" binary nonsingular matrix (binary non-singular matrix) S and "1" and "0" of the kxk size including the code value as a component of the A public key K pub is generated by using a permutation matrix P having a size of nxn, and a message m to be transmitted to the data receiving device is encrypted with the public key K pub to generate an encrypted message c, The data receiving apparatus decodes the encrypted message using the generated matrix G e , the binary regular matrix S, and the permuted matrix P stored in the memory by the data receiving apparatus as a private key, And restores the message m.

관련해서, 부호 기반의 암호화 방식에서의 데이터 암호화와 복호화 방식에 대해 간단히 설명하면 다음과 같다.In this regard, the data encryption and decryption method in the code-based encryption method will be briefly described as follows.

우선, 데이터 전송 장치가 사용하는 공개키는 Kpub는 하기의 수학식 1과 같이 정의된다.First, the public key used by a data transmitting apparatus is defined as shown in Equation 1 below is K pub.

Figure 112017084420707-pat00001
Figure 112017084420707-pat00001

여기서, 상기 수학식 1에서 생성 행렬 Ge는 t비트의 코드에 대한 오류 정정 능력을 갖는 k x n 크기의 생성 행렬이고, S는 랜덤하게 결정된 k x k 크기를 갖는 이진 정칙 행렬이며, P는 랜덤하게 결정된 n x n 크기를 갖는 순열 행렬이다.In Equation (1), the generator matrix G e is a kxn-sized generator matrix having an error correction capability for t-bit codes, S is a randomly determined binary regular matrix having a kxk size, P is a randomly determined nxn Lt; / RTI >

이때, 데이터 수신 장치는 메모리 상에서 상기 공개키 Kpub에 대응하는 개인키로 상기 생성 행렬 Ge, 상기 이진 정칙 행렬 S 및 상기 순열 행렬 P를 각각 저장하고 있다.At this time, the data receiving apparatus stores the generation matrix G e , the binary regular matrix S, and the permutation matrix P, respectively, with a private key corresponding to the public key K pub in the memory.

이러한 상황 하에서 데이터 전송 장치는 상기 데이터 수신 장치로 전송할 k비트의 크기를 갖는 메시지 m에 대해서 하기의 수학식 2에 따른 암호화 연산을 수행함으로써, 암호화 메시지 c를 생성할 수 있다.Under such circumstances, the data transmission apparatus can generate an encrypted message c by performing an encryption operation according to the following equation (2) for a message m having a size of k bits to be transmitted to the data reception apparatus.

Figure 112017084420707-pat00002
Figure 112017084420707-pat00002

여기서, e는 t 이하의 해밍 무게(Hamming Weight)를 가지면서, n비트의 길이를 갖는 랜덤 벡터이고, "

Figure 112017084420707-pat00003
"는 배타적 논리합 연산이다.Where e is a random vector having a length of n bits with a Hamming Weight of t or less,
Figure 112017084420707-pat00003
&Quot; is an exclusive OR operation.

그리고, 해밍 무게란 데이터를 구성하는 비트열에서 "1"이라는 비트 값의 개수를 의미한다.The Hamming weight means the number of bit values " 1 " in the bit string constituting the data.

이렇게, 상기 암호화 메시지 c가 생성되면, 상기 데이터 전송 장치는 상기 데이터 수신 장치로 상기 암호화 메시지 c를 전송함으로써, 데이터 암호화 전송을 완료한다.When the encryption message c is generated, the data transmission device transmits the encryption message c to the data reception device, thereby completing the data encryption transmission.

이렇게, 상기 데이터 전송 장치로부터 상기 암호화 메시지 c가 상기 데이터 수신 장치로 전송되면, 상기 데이터 수신 장치는 메모리 상에 저장되어 있는 상기 생성 행렬 Ge, 상기 이진 정칙 행렬 S 및 상기 순열 행렬 P를 활용해서 상기 암호화 메시지에 대한 복호화를 수행하게 된다.When the encrypted message c is transmitted from the data transmission apparatus to the data reception apparatus, the data reception apparatus utilizes the generation matrix G e , the binary regular matrix S and the permutation matrix P stored in the memory And decrypts the encrypted message.

관련해서, 상기 데이터 수신 장치는 상기 암호화 메시지 c가 수신되면, 하기의 수학식 3과 같이 상기 암호화 메시지 c에 대해 상기 순열 행렬 P의 역행렬인 P-1을 곱하여 cP-1을 연산한다.When the encryption message c is received, the data reception apparatus calculates cP -1 by multiplying the encrypted message c by the inverse matrix P -1 of the permuted matrix P, as shown in Equation (3).

Figure 112017084420707-pat00004
Figure 112017084420707-pat00004

그러고 나서, 상기 데이터 수신 장치는 cP-1로부터 상기 생성 행렬 Ge를 이용해서 오류 정정을 위한 데이터 디코딩을 수행하여 mS를 연산할 수 있다.Then, the data receiving apparatus can calculate mS by performing data decoding for error correction using cP -1 from the generation matrix G e .

여기서, 상기 e는 t 이하의 해밍 무게를 갖는 벡터이고, P는 순열 행렬이므로, eP-1도 t 이하의 해밍 무게를 갖기 때문에 결론적으로 cP-1은 mSGe라는 부호어에서 t개 이하의 비트 값에 대해 오류가 발생한 것으로 볼 수 있어서, 상기 데이터 수신 장치는 메모리 상에 저장되어 있는 t비트의 코드에 대한 오류 정정 능력을 갖는 생성 행렬인 Ge를 이용하여 cP-1에 대해 오류 정정을 수행함으로써, mS를 디코딩할 수 있다.Since e is a vector having a Hamming weight equal to or less than t and P is a permutation matrix, since eP -1 has a Hamming weight of less than or equal to t, cP -1 is less than or equal to t bits in codeword mSG e , The data reception apparatus performs error correction on cP- 1 using G e , which is a generation matrix having an error correction capability with respect to t-bit codes stored in the memory So that mS can be decoded.

이렇게, mS의 연산이 완료되면, 상기 데이터 수신 장치는 하기의 수학식 4와 같이 메모리 상에 저장되어 있는 상기 이진 정칙 행렬 S의 역행렬인 S-1을 mS에 곱함으로써, 원본 메시지인 m을 최종적으로 복호화할 수 있다.When the calculation of the mS is completed, the data receiving apparatus multiplies mS by the inverse matrix S -1 of the binary regular matrix S stored in the memory, as shown in Equation (4) . ≪ / RTI >

Figure 112017084420707-pat00005
Figure 112017084420707-pat00005

이렇게, 데이터 보안의 중요성이 증대됨에 따라, 고성능의 컴퓨터 시스템에 기반한 공격을 방어하기 위해, 부호 기반의 암호화 방식을 사용하되, 암호문의 패턴 분석에 기반한 재생 공격의 가능성을 차단하기 위해서 평문 데이터에 난수를 추가하여 항상 다른 암호문이 생성될 수 있도록 하기 위한 암호화 기법에 대한 연구가 필요하다.As the importance of data security increases, a code-based encryption scheme is used to protect attacks based on a high-performance computer system. However, in order to block the possibility of a replay attack based on pattern analysis of ciphertexts, The cryptosystem is required to be able to generate different ciphertexts at all times.

본 발명에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치 및 방법은 부호 기반의 암호화 방식에 있어서, 암호화가 수행될 때마다 소정의 난수를 생성하여 상기 난수를 상기 원본 메시지에 반영함으로써, 매번 암호화 메시지의 패턴이 다르게 생성되도록 유도하여 제3자의 재생 공격으로 인한 원본 메시지의 노출을 최소화할 수 있도록 한다.A code-based encryption apparatus and method capable of preventing a replay attack according to the present invention is characterized in that in a code-based encryption scheme, a predetermined random number is generated every time encryption is performed and the random number is reflected in the original message, Thereby inducing the pattern to be generated differently so as to minimize the exposure of the original message due to the replay attack of the third party.

본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치는 데이터 수신 장치로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩(padding) 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성하는 패딩부, q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G - 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수임 - 에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성하는 제1 연산부, 상기 제1 연산 값 X를 제2 해시 함수 H - 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수임 - 에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성하는 제2 연산부, 상기 제2 연산 값 Y로부터 해밍 무게(Hamming Weight)가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성하는 오류 벡터 생성부, 상기 제1 연산 값 X에 대해 선정된(predetermined) 공개키와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성하는 암호화부 및 상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송하는 암호화 메시지 전송부를 포함한다.A code-based encryption apparatus capable of preventing a replay attack according to an embodiment of the present invention encrypts a padding bit of 1 bit or more with respect to an original message m to be transmitted to a data receiving apparatus so that k (k is a natural number) A padding unit for generating a message M, a random number r having a bit size of q (q is a natural number smaller than k), a first hash function G - the first hash function G, And generating a first hash value G (r) having a k-bit size by performing an exclusive-OR operation on the message M and the first hash value G (r) A first operation unit for generating a first operation value X of a bit size; a second operation unit for multiplying the first operation value X by a second hash function H - the second hash function H reduces an input value of k bits size to an output value of q bits size As a one-way function to input (X) having a q-bit size, and generating a second calculated value Y of q-bit size by performing an XOR operation on the random number r and the second hash value H (X) 2 operation unit, an error vector generating unit for generating an error vector e whose Hamming Weight is t (t is a natural number) and whose size is n (n is a natural number) from the second calculated value Y, An encryption unit for generating an encrypted message c by performing sign-based encryption on the basis of a predetermined public key and an error vector e for the computed value X, and an encrypting message c for transmitting the encrypted message c to the data receiving apparatus And a transmission unit.

또한, 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법은 데이터 수신 장치로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성하는 단계, q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G - 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수임 - 에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성하는 단계, 상기 제1 연산 값 X를 제2 해시 함수 H - 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수임 - 에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성하는 단계, 상기 제2 연산 값 Y로부터 해밍 무게가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성하는 단계, 상기 제1 연산 값 X에 대해 선정된 공개키와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성하는 단계 및 상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송하는 단계를 포함한다.Also, a code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention includes padding a padding bit of 1 bit or more with respect to an original message m to be transmitted to a data receiving apparatus, thereby generating a message having k (k is a natural number) Generating a random number r having a bit size of q (q is a natural number smaller than k) as a first hash function G - the first hash function G is a k-bit size input value as an output value of k bits size And generating a first hash value G (r) having a k-bit size by performing an exclusive-OR operation on the message M and the first hash value G (r) The first hash function H and the second hash function H are bidirectional functions that reduce the input value of the k-bit size to the output value of the q-bit size. - as an input to generating a second hash value H (X) having a q-bit size, performing a XOR operation on the random number r and the second hash value H (X) to generate a second calculated value Y of q-bit size, Generating an error vector e having a hamming weight t (t is a natural number) and a size n (n is a natural number) from the second calculated value Y, Generating an encrypted message c by performing sign-based encryption based on the error vector e, and transmitting the encrypted message c to the data receiving device.

본 발명에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치 및 방법은 부호 기반의 암호화 방식에 있어서, 암호화가 수행될 때마다 소정의 난수를 생성하여 상기 난수를 상기 원본 메시지에 반영함으로써, 매번 암호화 메시지의 패턴이 다르게 생성되도록 유도하여 제3자의 재생 공격으로 인한 원본 메시지의 노출을 최소화할 수 있다.A code-based encryption apparatus and method capable of preventing a replay attack according to the present invention is characterized in that in a code-based encryption scheme, a predetermined random number is generated every time encryption is performed and the random number is reflected in the original message, It is possible to minimize the exposure of the original message due to the replay attack of the third party by inducing the pattern to be generated differently.

도 1은 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치의 구조를 도시한 도면이다.
도 2는 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법을 도시한 순서도이다.
1 is a block diagram of a code-based encryption apparatus capable of preventing a replay attack according to an embodiment of the present invention.
2 is a flowchart illustrating a code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention.

이하에서는 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명하기로 한다. 이러한 설명은 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였으며, 다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 본 명세서 상에서 사용되는 모든 용어들은 본 발명이 속하는 기술분야에서 통상의 지식을 가진 사람에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다.Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the description is not intended to limit the invention to the specific embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals in the drawings are used for similar elements and, unless otherwise defined, all terms used in the specification, including technical and scientific terms, are to be construed in a manner that is familiar to those skilled in the art. It has the same meaning as commonly understood by those who have it.

도 1은 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치의 구조를 도시한 도면이다.1 is a block diagram of a code-based encryption apparatus capable of preventing a replay attack according to an embodiment of the present invention.

도 1을 참조하면, 본 발명에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치(110)는 패딩부(111), 제1 연산부(112), 제2 연산부(113), 오류 벡터 생성부(114), 암호화부(115) 및 암호화 메시지 전송부(116)를 포함한다.Referring to FIG. 1, a code-based encryption apparatus 110 capable of preventing a replay attack according to the present invention includes a padding unit 111, a first computing unit 112, a second computing unit 113, an error vector generating unit 114, An encryption unit 115, and an encrypted message transmission unit 116. [

패딩부(111)는 데이터 수신 장치(120)로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩(padding) 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성한다.The padding unit 111 generates a message M having a bit size of k (where k is a natural number) by padding a padding bit of 1 bit or more with respect to the original message m to be transmitted to the data receiving apparatus 120. [

이때, 상기 패딩 비트는 "0"이라는 비트 값이 될 수 있다. 예컨대, 원본 메시지 m이 "1010"이라고 하고, k를 "8"이라고 하는 경우, 패딩부(111)는 상기 원본 메시지 m인 "1010"에 대해 "0"이라는 비트 값을 4개 패딩함으로써, "10100000"이라는 메시지 M을 생성할 수 있다.At this time, the padding bit may be a bit value of " 0 ". For example, when the original message m is " 1010 ", and k is " 8 ", the padding unit 111 paddes a bit value " 0 "Quot; 10100000 ".

제1 연산부(112)는 q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 하기의 수학식 5에서와 같이 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성한다.The first calculation unit 112 generates a first hash value G (r) having a k-bit size by inputting a random number r having a bit size of q (q is a natural number smaller than k) as an input to the first hash function G , And performs a XOR operation on the message M and the first hash value G (r) as shown in Equation (5) below to generate a first calculated value X of k bits.

여기서, 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수이다.Here, the first hash function G is a one-way function for expanding a q-bit input value to an k-bit output value.

Figure 112017084420707-pat00006
Figure 112017084420707-pat00006

상기 수학식 5에서 "

Figure 112017084420707-pat00007
"는 배타적 논리합 연산을 의미한다.In Equation (5)
Figure 112017084420707-pat00007
"Means an exclusive OR operation.

제2 연산부(113)는 상기 제1 연산 값 X를 제2 해시 함수 H에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 하기의 수학식 6에서와 같이 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성한다The second calculation unit 113 generates a second hash value H (X) having a q-bit size by applying the first calculated value X to the second hash function H as an input, The second hash value H (X) is XORed with the random number r and the second hash value H

여기서, 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수이다.Here, the second hash function H is a one-way function that reduces the k-bit input value to the q-bit output value.

Figure 112017084420707-pat00008
Figure 112017084420707-pat00008

오류 벡터 생성부(114)는 상기 제2 연산 값 Y로부터 해밍 무게(Hamming Weight)가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성한다.The error vector generating unit 114 generates an error vector e whose Hamming Weight is t (t is a natural number) and whose size is n (n is a natural number) from the second calculated value Y. [

이때, 본 발명의 일실시예에 따르면, 오류 벡터 생성부(114)는 q비트 크기의 입력 값을 t의 해밍 무게를 갖는 n비트 크기의 출력 값으로 매핑(mapping) 변환하도록 설계된 매핑 함수에 대해 상기 제2 연산 값 Y를 입력으로 인가하여 상기 오류 벡터 e를 생성할 수 있다.In this case, according to an embodiment of the present invention, the error vector generating unit 114 generates a error vector for a mapping function designed to map an input value of a q-bit size to an output value of n-bit size having a hamming weight of t The error value e may be generated by applying the second calculated value Y as an input.

여기서, 상기 매핑 함수는 앞서 설명한 바와 같이, q비트 크기의 입력 값이 입력으로 인가되면, t의 해밍 무게를 갖는 n비트 크기의 출력 값으로 변환해서 출력하는 함수로 하기의 표 1에서 정리한 바와 같이, 선행기술문헌인 "Raphael Overbeck, Nicolas Sendrier, "Code-Based Cryptography", Post-Quantum Cryptography, pp.95-145., 2009"에서 제안된 "Mapping bit strings to constant weight codewords" 방식에 따라 입력 값을 출력 값으로 매핑 변환하는 함수일 수 있다.As described above, the mapping function is a function that converts an input value of q bits in size to an output value of n bits in size having a hamming weight of t when the input value is input, Likewise, input according to the "Mapping bit strings to constant weight codewords" scheme proposed in the prior art "Raphael Overbeck, Nicolas Sendrier," Code-Based Cryptography ", Post-Quantum Cryptography, pp.95-145. And converting the value to an output value.

입력 값:

Figure 112017084420707-pat00009

출력 값:
Figure 112017084420707-pat00010
, 이때, 출력 값은 길이가
Figure 112017084420707-pat00011
이고, 해밍 무게가
Figure 112017084420707-pat00012
인 워드(word)라고 할 때,

Figure 112017084420707-pat00013

Figure 112017084420707-pat00014
사전식 순서(lexicographic order) 내의
Figure 112017084420707-pat00015
의 인덱스(Index)로 정수(integer)이고,

Figure 112017084420707-pat00016
일 동안, 아래의 과정을 반복 수행함으로써, 출력 값을 생성함
Figure 112017084420707-pat00017

만약,
Figure 112017084420707-pat00018
이면,
Figure 112017084420707-pat00019
이고,
그렇지 않으면,
Figure 112017084420707-pat00020

그러고 나서,
Figure 112017084420707-pat00021
』Input Value:
Figure 112017084420707-pat00009

Output Value:
Figure 112017084420707-pat00010
, The output value is the length
Figure 112017084420707-pat00011
, Hamming weight
Figure 112017084420707-pat00012
When a word is referred to,

Figure 112017084420707-pat00013

Figure 112017084420707-pat00014
Within a lexicographic order
Figure 112017084420707-pat00015
Is an integer (integer)

Figure 112017084420707-pat00016
During the day, the following process is repeated to generate the output value
"
Figure 112017084420707-pat00017

if,
Figure 112017084420707-pat00018
If so,
Figure 112017084420707-pat00019
ego,
Otherwise,
Figure 112017084420707-pat00020
being
and then,
Figure 112017084420707-pat00021
"

상기 표 1에 나타낸 논리에 따라 4비트의 입력 값을 "6"의 해밍 무게를 갖는 10비트의 출력 값으로 변환하는 매핑 함수를 설계하였다고 가정하면, "0101"이라는 입력 값은 "1101001101"로 매핑 변환될 수 있고, "1101"이라는 입력 값은 "1011000111"로 매핑 변환될 수 있다.Assuming that a mapping function for converting an input value of 4 bits to an output value of 10 bits having a Hamming weight of "6" is designed according to the logic shown in Table 1, an input value of "0101" is mapped to "1101001101" And an input value of " 1101 " may be mapped to " 1011000111 ".

상기 표 1에 따른 매핑 함수는 입력 값을 출력 값으로 매핑 변환하였을 때, 상기 표 1에 따른 매핑 함수의 역연산을 수행하게 되면, 출력 값으로부터 입력 값을 역변환해낼 수 있는 특징을 가지고 있다.The mapping function according to Table 1 is characterized in that when an input value is mapped to an output value and an inverse operation of the mapping function according to Table 1 is performed, the input value can be inversely transformed from the output value.

이러한 매핑 함수를 기초로 오류 벡터 생성부(114)는 상기 제2 연산 값 Y를 입력으로 인가함으로써, t의 해밍 무게를 갖는 n비트 크기의 상기 오류 벡터 e를 생성할 수 있다.Based on this mapping function, the error vector generator 114 can generate the error vector e of n-bit size having the Hamming weight of t by applying the second calculated value Y as an input.

본 발명의 다른 실시예에 따르면, 오류 벡터 생성부(114)는 상기 표 1과 같은 매핑 함수에 상기 제2 연산 값 Y를 입력으로 인가함으로써, 상기 오류 벡터 e를 생성하도록 구성될 수도 있지만, q비트 크기를 갖는 2q개의 서로 다른 입력 값들 각각에 대해, t의 해밍 무게를 가지면서 n비트 크기를 갖는 서로 다른 출력 값들이 매핑되어 있는 매핑 테이블을 미리 구축해 둔 후 상기 매핑 테이블을 참조하여 상기 매핑 테이블로부터 상기 제2 연산 값 Y와 동일한 입력 값에 매핑되어 있는 출력 값을 상기 오류 벡터 e로 생성하도록 구성될 수도 있다.According to another embodiment of the present invention, the error vector generator 114 may be configured to generate the error vector e by applying the second calculated value Y to the mapping function as shown in Table 1 above, but q For each of 2 q different input values having a bit size, a mapping table in which different output values having n bits size are mapped and which has a hamming weight of t is constructed in advance, and the mapping table is referred to And generate an output value mapped to an input value equal to the second calculated value Y from the table as the error vector e.

즉, 상기 표 1과 같은 매핑 함수를 이용하여 상기 오류 벡터 e를 연산하는 과정이 수행된다면, 연산으로 인해서 시간이 많이 소요될 수 있다는 점에서, 관리자는 q비트 크기를 갖는 2q개의 서로 다른 입력 값들 전부에 대해 상기 표 1과 같은 매핑 함수에 따른 출력 값들을 미리 계산해서 소정의 매핑 테이블로 구성해 둠으로써, 오류 벡터 생성부(114)가 상기 매핑 테이블을 참조하여 상기 제2 연산 값 Y에 대응하는 오류 벡터 e를 바로 찾아낼 수 있도록 구성할 수도 있다.That is, if the process of calculating the error vector e using the mapping function as shown in Table 1 is performed, it may take a long time due to the operation. Therefore, the manager may calculate 2 q different input values The output values according to the mapping function as shown in Table 1 are calculated in advance and configured as a predetermined mapping table so that the error vector generating unit 114 generates the error vector corresponding to the second calculated value Y The error vector e may be directly detected.

암호화부(115)는 상기 오류 벡터 e의 생성이 완료되면, 상기 제1 연산 값 X에 대해 선정된(predetermined) 공개키와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성한다.When the generation of the error vector e is completed, the encryption unit 115 performs code-based encryption on the first computation value X based on a predetermined public key and the error vector e, thereby generating an encrypted message c .

이때, 본 발명의 일실시예에 따르면, 재생 공격 방지가 가능한 부호 기반 암호화 장치(110)는 공개키 저장부(117)를 더 포함할 수 있다.In this case, according to an embodiment of the present invention, the code-based encryption apparatus 110 capable of preventing a replay attack may further include a public key storage unit 117.

공개키 저장부(117)에는 "1"과 "0"의 코드 값을 성분으로 포함하는 k x k 크기의 이진 정칙 행렬 S, t비트의 코드에 대한 오류 정정 능력을 가지면서 "1"과 "0"의 코드 값을 성분으로 포함하는 k x n 크기의 생성 행렬 Ge 및 "1"과 "0"의 코드 값을 성분으로 포함하는 n x n 크기의 순열 행렬 P가 곱해진 상기 선정된 공개키 Kpub(Kpub=SGeP)가 저장되어 있다.1 " and " 0 " s, having error correcting capability for a code of t bits, and a public key storage unit 117, a generation matrix of kxn size including the code value of ingredient G e and "1" and "0" of the code value, the public key the became the permutation matrix P of nxn size product selection, including the component K pub (K pub = SG e P) is stored.

관련해서, 공개키 저장부(117)에는 하기의 수학식 7에 따른 상기 선정된 공개키 Kpub가 저장되어 있다.In association with this, the public key storage unit 117 stores the selected public key K pub according to Equation (7) below.

Figure 112017084420707-pat00022
Figure 112017084420707-pat00022

이때, 암호화부(115)는 상기 제1 연산 값 X에 상기 공개키 Kpub를 곱하여 결과 값 c'을 생성하고, 상기 결과 값 c'과 상기 오류 벡터 e에 대해 배타적 논리합 연산을 수행함으로써, 상기 암호화 메시지 c를 생성할 수 있다.At this time, the encryption unit 115 multiplies the first computation value X by the public key K pub to generate a result c ', and performs an exclusive-OR operation on the result c' and the error vector e, An encrypted message c can be generated.

관련해서, 암호화부(115)는 하기의 수학식 8의 연산에 따라 상기 암호화 메시지 c를 생성할 수 있다.In this regard, the encryption unit 115 may generate the encrypted message c according to the following equation (8).

Figure 112017084420707-pat00023
Figure 112017084420707-pat00023

이렇게, 상기 암호화 메시지 c의 생성이 완료되면, 암호화 메시지 전송부(116)는 상기 암호화 메시지 c를 데이터 수신 장치(120)로 전송한다.When the generation of the encrypted message c is completed, the encrypted message transmitting unit 116 transmits the encrypted message c to the data receiving apparatus 120. [

이와 같이, 상기 수학식 8의 연산에 따른 암호화 메시지 c가 데이터 수신 장치(120)로 전송되면, 데이터 수신 장치(120)는 상기 암호화 메시지 c를 복호화하여 원본 메시지 m을 복원할 수 있는데, 이하에서는 데이터 수신 장치(120)가 상기 암호화 메시지 c로부터 원본 메시지 m을 복원해 내는 과정에 대해 상세히 설명하기로 한다.When the encrypted message c according to the operation of Equation (8) is transmitted to the data receiving apparatus 120, the data receiving apparatus 120 can decrypt the encrypted message c to recover the original message m. Hereinafter, The process of restoring the original message m from the encrypted message c will now be described in detail.

우선, 데이터 수신 장치(120)는 메모리 상에 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 상기 공개키 Kpub에 대응하는 개인키로 각각 저장하고 있음과 동시에, 상기 제1 해시 함수 G와 상기 제2 해시 함수 H 및 상기 매핑 함수를 저장하고 있을 수 있다.First, the data receiving apparatus 120 stores the binary regular matrix S, the generation matrix G e, and the permutation matrix P as a private key corresponding to the public key K pub on the memory, The function G, the second hash function H, and the mapping function.

만약, 데이터 수신 장치(120)로 상기 암호화 메시지 c가 수신되면, 데이터 수신 장치(120)는 상기 암호화 메시지 c로부터 상기 메모리 상에 저장되어 있는 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 기초로한 오류 정정을 수행함으로써, 상기 제1 연산 값 X를 복원할 수 있다.If the encryption message c is received by the data reception apparatus 120, the data reception apparatus 120 extracts the binary regular matrix S, the generation matrix G e, and the permutation By performing error correction based on the matrix P, the first computation value X can be recovered.

관련해서, 데이터 수신 장치(120)는 상기 암호화 메시지 c가 수신되면, 하기의 수학식 9의 연산에 따라 상기 암호화 메시지 c에 대해 상기 메모리 상에 저장되어 있는 상기 순열 행렬 P의 역행렬 P-1을 곱하여 cP-1을 연산할 수 있다.In response to the encryption message c, the data receiving apparatus 120 calculates the inverse matrix P -1 of the permutation matrix P stored in the memory with respect to the encrypted message c according to the following equation (9) Can be multiplied to calculate cP -1 .

Figure 112017084420707-pat00024
Figure 112017084420707-pat00024

그러고 나서, 데이터 수신 장치(120)는 상기 생성 행렬 Ge를 기초로 상기 cP-1에 대한 오류 정정을 수행하여 상기 제1 연산 값 X와 상기 이진 정칙 행렬 S가 곱해진 XS를 연산할 수 있다.Then, the data receiving apparatus 120 performs error correction on the cP -1 based on the generation matrix G e , and calculates the XS multiplied by the first computation value X and the binary normality matrix S .

여기서, 상기 오류 벡터 e는 t개의 해밍 무게를 갖는 벡터이고, P는 순열 행렬이므로, eP-1도 t개의 해밍 무게를 갖기 때문에 결론적으로 cP-1은 XSGe라는 부호어에서 t개의 비트 값에 대해 오류가 발생한 것으로 볼 수 있어서, 데이터 수신 장치(120)는 메모리 상에 저장되어 있는 t비트의 코드에 대한 오류 정정 능력을 갖는 생성 행렬인 Ge를 이용하여 cP-1에 대해 오류 정정을 수행함으로써, XS를 디코딩할 수 있다.Here, since the error vector e is a vector having t Hamming weights and P is a permutation matrix, eP -1 has t Hamming weights, so that cP -1 is the sum of t bits in the codeword XSG e The data receiving apparatus 120 performs error correction on cP- 1 using G e , which is a generation matrix having an error correction capability for the t-bit code stored in the memory So that XS can be decoded.

이렇게, XS의 연산이 완료되면, 데이터 수신 장치(120)는 하기의 수학식 10의 연산에 따라 상기 XS에 대해 상기 이진 정칙 행렬 S의 역행렬 S-1을 곱하여 상기 제1 연산 값 X를 복원할 수 있다.When the operation of XS is completed, the data receiving apparatus 120 multiplies the XS by the inverse matrix S -1 of the binary regular matrix S according to the operation of Equation (10) to restore the first operation value X .

Figure 112017084420707-pat00025
Figure 112017084420707-pat00025

이렇게, 상기 제1 연산 값 X의 복원이 완료되면, 데이터 수신 장치(120)는 상기 암호화 메시지 c로부터 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 이용하여 상기 오류 벡터 e를 추출하며, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원한 후 상기 제1 해시 함수 G와 상기 제2 해시 함수 H를 기초로 상기 복원된 제1 연산 값 X와 상기 복원된 제2 연산 값 Y로부터 상기 메시지 M을 복원하여 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화할 수 있다.When the restoration of the first calculation value X is completed, the data reception device 120 extracts the restored first calculation value X, the binary regularity matrix S, the generation matrix G e, and the permutation matrix C from the encryption message c P, and performs an inverse operation on the extracted error vector e with respect to the mapping function, thereby restoring the second calculated value Y, and then, by using the first hash function G and the second hash function e, 2 decoding the original message m by restoring the message M from the restored first calculation value X and the restored second calculation value Y based on the second hash function H and removing the padding bits from the restored message M, can do.

관련해서, 데이터 수신 장치(120)는 상기 제1 연산 값 X의 복원이 완료되면, 하기의 수학식 11의 연산에 따라 상기 암호화 메시지 c에 대해, 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P가 곱해진 결과 값을 배타적 논리합함으로써, 상기 오류 벡터 e를 추출할 수 있다.When the restoration of the first computation value X is completed, the data reception apparatus 120 transmits the restored first computation value X and the binary normality X to the encryption message c according to the following equation (11) The error vector e can be extracted by performing exclusive-OR of the result of multiplication by the matrix S, the generation matrix G e, and the permutation matrix P, respectively.

Figure 112017084420707-pat00026
Figure 112017084420707-pat00026

그러고 나서, 데이터 수신 장치(120)는 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원할 수 있다.Then, the data receiving apparatus 120 can restore the second calculated value Y by performing an inverse operation on the extracted error vector e with respect to the mapping function.

만약, 재생 공격 방지가 가능한 부호 기반 암호화 장치(110)에서 상기 오류 벡터 e가 소정의 매핑 테이블을 통해서 생성된 후 이를 기초로 상기 암호화 메시지 c가 생성되었다고 한다면, 데이터 수신 장치(120)에는 메모리 상에 상기 매핑 함수를 저장하고 있는 것이 아니라 상기 매핑 테이블을 저장하고 있을 수 있고, 데이터 수신 장치(120)는 상기 수학식 11의 연산에 따라 상기 오류 벡터 e가 추출되면, 상기 매핑 테이블 상에서 상기 추출된 오류 벡터 e에 매핑되어 있는 입력 값을 찾음으로써, 상기 제2 연산 값 Y를 복원할 수 있다.If the encrypted message c is generated on the basis of the error vector e generated in the predetermined mapping table in the code-based encryption apparatus 110 capable of preventing a replay attack, the data receiving apparatus 120 is provided with a memory- The data receiving apparatus 120 may store the mapping table instead of storing the mapping function in the mapping table and if the error vector e is extracted according to the operation of Equation 11, The second calculated value Y can be recovered by finding an input value mapped to the error vector e.

이렇게, 상기 제2 연산 값 Y의 복원도 완료되면, 데이터 수신 장치(120)는 메모리 상에 저장되어 있는 상기 제2 해시 함수 H에 대해 상기 복원된 제1 연산 값 X를 입력으로 인가하여 상기 제2 해시 값 H(X)를 연산한 후 하기의 수학식 12의 연산에 따라, 상기 복원된 제2 연산 값 Y와 상기 제2 해시 값 H(X)를 배타적 논리합함으로써, 상기 난수 r을 복원할 수 있다.When the restoration of the second calculation value Y is completed, the data reception device 120 applies the restored first calculation value X as an input to the second hash function H stored in the memory, 2, the random number r is recovered by performing an exclusive OR operation on the restored second calculation value Y and the second hash value H (X) according to the following equation (12) after calculating the hash value H (X) .

Figure 112017084420707-pat00027
Figure 112017084420707-pat00027

그러고 나서, 데이터 수신 장치(120)는 메모리 상에 저장되어 있는 상기 제1 해시 함수 G에 대해 상기 복원된 난수 r을 입력으로 인가하여 상기 제1 해시 값 G(r)을 연산하고, 상기 수학식 13의 연산에 따라, 상기 복원된 제1 연산 값 X와 상기 제1 해시 값 G(r)을 배타적 논리합함으로써, 상기 메시지 M을 복원할 수 있다.Then, the data receiving apparatus 120 calculates the first hash value G (r) by applying the restored random number r as an input to the first hash function G stored in the memory, 13, the message M can be restored by exclusive-ORing the restored first calculation value X and the first hash value G (r).

Figure 112017084420707-pat00028
Figure 112017084420707-pat00028

이렇게, 상기 메시지 M의 복원이 완료되면, 데이터 수신 장치(120)는 상기 복원된 메시지 M에서 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화할 수 있다.When the restoration of the message M is completed, the data reception apparatus 120 can decode the original message m by removing the padding bits from the restored message M.

결국, 본 발명에 따른 재생 공격 방지가 가능한 부호 기반 암호화 장치(110)는 부호 기반의 암호화 방식에 있어서, 암호화가 수행될 때마다 소정의 난수를 생성하여 상기 난수를 상기 원본 메시지에 반영함으로써, 매번 암호화 메시지의 패턴이 다르게 생성되도록 유도하여 제3자의 재생 공격으로 인한 원본 메시지의 노출을 최소화할 수 있다.As a result, the code-based encryption apparatus 110 capable of preventing the replay attack according to the present invention generates a predetermined random number every time encryption is performed in the code-based encryption scheme, and reflects the random number in the original message every time It is possible to minimize the exposure of the original message due to the replay attack of the third party by inducing the pattern of the encrypted message to be generated differently.

도 2는 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법을 도시한 순서도이다.2 is a flowchart illustrating a code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention.

단계(S210)에서는 데이터 수신 장치로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성한다.In step S210, a padding bit of 1 bit or more is padded to the original message m to be transmitted to the data receiving apparatus to generate a message M having k (k is a natural number) bit size.

단계(S220)에서는 q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성한다.In step S220, a random number r having a bit size of q (q is a natural number smaller than k) is input to the first hash function G to generate a first hash value G (r) having a k-bit size, The message M and the first hash value G (r) are XORed to generate a first calculated value X of k bits.

여기서, 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수이다.Here, the first hash function G is a one-way function for expanding a q-bit input value to an k-bit output value.

단계(S230)에서는 상기 제1 연산 값 X를 제2 해시 함수 H에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성한다.In step S230, the first calculation value X is input to the second hash function H to generate a second hash value H (X) having a q-bit size, and the random number r and the second hash value H X) to generate a second calculated value Y having a q-bit size.

여기서, 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수이다.Here, the second hash function H is a one-way function that reduces the k-bit input value to the q-bit output value.

단계(S240)에서는 상기 제2 연산 값 Y로부터 해밍 무게가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성한다.In step S240, an error vector e having a hamming weight t (t is a natural number) and a size n (n is a natural number) is generated from the second calculated value Y. [

이때, 본 발명의 일실시예에 따르면, 단계(S240)에서는 q비트 크기의 입력 값을 t의 해밍 무게를 갖는 n비트 크기의 출력 값으로 매핑 변환하도록 설계된 매핑 함수에 대해 상기 제2 연산 값 Y를 입력으로 인가하여 상기 오류 벡터 e를 생성할 수 있다.According to an embodiment of the present invention, in step S240, a mapping function designed to map an input value having a q-bit size to an output value having an n-bit size having a hamming weight of t is compared with the second calculation value Y May be applied as an input to generate the error vector e.

또한, 본 발명의 다른 실시예에 따르면, 단계(S240)에서는 q비트 크기를 갖는 2q개의 서로 다른 입력 값들 각각에 대해, t의 해밍 무게를 가지면서 n비트 크기를 갖는 서로 다른 출력 값들이 매핑되어 있는 매핑 테이블을 참조하여, 상기 매핑 테이블로부터 상기 제2 연산 값 Y와 동일한 입력 값에 매핑되어 있는 출력 값을 상기 오류 벡터 e로 생성할 수 있다.According to another embodiment of the present invention, in step S240, for each of 2 q different input values having a q-bit size, different output values having an n-bit size having a Hamming weight of t are mapped An output value mapped to the same input value as the second calculated value Y can be generated from the mapping table as the error vector e.

단계(S250)에서는 상기 제1 연산 값 X에 대해 선정된 공개키와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성한다.In step S250, code-based encryption is performed based on the selected public key and the error vector e for the first computation value X, thereby generating an encrypted message c.

이때, 본 발명의 일실시예에 따르면, 재생 공격 방지가 가능한 부호 기반 암호화 방법은 단계(S210)이전에 "1"과 "0"의 코드 값을 성분으로 포함하는 k x k 크기의 이진 정칙 행렬 S, t비트의 코드에 대한 오류 정정 능력을 가지면서 "1"과 "0"의 코드 값을 성분으로 포함하는 k x n 크기의 생성 행렬 Ge 및 "1"과 "0"의 코드 값을 성분으로 포함하는 n x n 크기의 순열 행렬 P가 곱해진 상기 선정된 공개키 Kpub(Kpub=SGeP)가 저장되어 있는 공개키 저장부를 유지하는 단계를 더 포함할 수 있다.According to an embodiment of the present invention, a code-based encryption method capable of preventing a replay attack includes a kxk-sized binary regularity matrix S including code values of "1" and "0" and includes a kxn-sized generator matrix G e and a code value of " 1 " and a code value of " 0 " having a code correction value for a code of t bits and including code values of & and maintaining the public key storage unit in which the selected public key K pub (K pub = SG e P) multiplied by the permutation matrix P of size nxn is stored.

이때, 단계(S250)에서는 상기 제1 연산 값 X에 상기 공개키 Kpub를 곱하여 결과 값 c'을 생성하고, 상기 결과 값 c'과 상기 오류 벡터 e에 대해 배타적 논리합 연산을 수행함으로써, 상기 암호화 메시지 c를 생성할 수 있다.At this time, in step S250, the first calculation value X is multiplied by the public key K pub to generate a result c ', and an exclusive OR operation is performed on the result c' and the error vector e, Message c can be generated.

단계(S260)에서는 상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송한다.In step S260, the encryption message c is transmitted to the data receiving apparatus.

이때, 본 발명의 일실시예에 따르면, 상기 데이터 수신 장치는 메모리 상에 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 상기 공개키 Kpub에 대응하는 개인키로 각각 저장하고 있음과 동시에, 상기 제1 해시 함수 G와 상기 제2 해시 함수 H 및 상기 매핑 함수를 저장하고 있을 수 있다.According to an embodiment of the present invention, the data receiving apparatus stores the binary regular matrix S, the generation matrix G e, and the permutation matrix P as a private key corresponding to the public key K pub , respectively, in a memory And may store the first hash function G, the second hash function H, and the mapping function.

이때, 상기 데이터 수신 장치는 상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c로부터 상기 메모리 상에 저장되어 있는 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 기초로한 오류 정정을 수행함으로써, 상기 제1 연산 값 X를 복원할 수 있고, 그 이후, 상기 암호화 메시지 c로부터 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 이용하여 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원한 후 상기 제1 해시 함수 G와 상기 제2 해시 함수 H를 기초로 상기 복원된 제1 연산 값 X와 상기 복원된 제2 연산 값 Y로부터 상기 메시지 M을 복원하여 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화할 수 있다.At this time, when the encryption message c is received, the data reception device performs error correction based on the binary regular matrix S, the generation matrix G e, and the permuted matrix P stored in the memory from the encryption message c The first computation value X and the recovered first computation value X, the binary normals matrix S, the generation matrix G e, and the permutation matrix P from the encrypted message c And then performs an inverse operation on the extracted error vector e with respect to the mapping function to restore the second calculated value Y, and then the first hash function G and the second hash function e H, the message M is recovered from the restored first calculation value X and the restored second calculation value Y to remove the padding bits from the recovered message M, And can decode the original message m.

관련해서, 본 발명의 일실시예에 따르면, 상기 데이터 수신 장치는 상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c에 대해 상기 메모리 상에 저장되어 있는 상기 순열 행렬 P의 역행렬 P-1을 곱하여 cP-1을 연산하고, 상기 생성 행렬 Ge를 기초로 상기 cP-1에 대한 오류 정정을 수행하여 상기 제1 연산 값 X와 상기 이진 정칙 행렬 S가 곱해진 XS를 연산한 후 상기 XS에 대해 상기 이진 정칙 행렬 S의 역행렬 S-1을 곱하여 상기 제1 연산 값 X를 복원할 수 있다.In this regard, according to an embodiment of the present invention, when the encrypted message c is received, the data receiving apparatus multiplies the encrypted message c by the inverse matrix P -1 of the permuted matrix P stored in the memory, -1 , performs an error correction on the cP- 1 based on the generation matrix G e , calculates an XS multiplied by the first computation value X and the binary normality matrix S, The first calculation value X can be recovered by multiplying the inverse matrix S -1 of the binary regular matrix S. [

그러고 나서, 상기 데이터 수신 장치는 상기 암호화 메시지 c에 대해, 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P가 곱해진 결과 값을 배타적 논리합함으로써, 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원할 수 있다.Then, the data receiving apparatus performs an exclusive OR operation on the recovered first computation value X and the result of the binary normals matrix S, the generation matrix G e, and the permuted matrix P, The second calculation value Y can be recovered by extracting the error vector e and performing an inverse operation on the extracted error vector e with respect to the mapping function.

그 이후, 상기 데이터 수신 장치는 상기 제2 해시 함수 H에 대해 상기 복원된 제1 연산 값 X를 입력으로 인가하여 상기 제2 해시 값 H(X)를 연산하고, 상기 복원된 제2 연산 값 Y와 상기 제2 해시 값 H(X)를 배타적 논리합함으로써, 상기 난수 r을 복원할 수 있다.Thereafter, the data receiving apparatus applies the restored first calculation value X as an input to the second hash function H to calculate the second hash value H (X), and outputs the restored second calculation value Y And the second hash value H (X), the random number r can be restored.

그리고, 상기 데이터 수신 장치는 상기 난수 r의 복원이 완료되면, 상기 제1 해시 함수 G에 대해 상기 복원된 난수 r을 입력으로 인가하여 상기 제1 해시 값 G(r)을 연산하고, 상기 복원된 제1 연산 값 X와 상기 제1 해시 값 G(r)을 배타적 논리합함으로써, 상기 메시지 M을 복원한 후 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화할 수 있다.The data receiving apparatus calculates the first hash value G (r) by applying the restored random number r as an input to the first hash function G when the restoration of the random number r is completed, The original message m can be decrypted by performing an exclusive OR operation on the first calculated value X and the first hashed value G (r) to recover the message M and then remove the padding bits from the recovered message M.

이상, 도 2를 참조하여 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법에 대해 설명하였다. 여기서, 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법은 도 1을 이용하여 설명한 재생 공격 방지가 가능한 부호 기반 암호화 장치(110)의 동작에 대한 구성과 대응될 수 있으므로, 이에 대한 보다 상세한 설명은 생략하기로 한다.2, a code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention has been described. Here, the code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention can correspond to the configuration of the operation of the code-based encryption apparatus 110 capable of preventing the replay attack described with reference to FIG. 1, A detailed description thereof will be omitted.

본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법은 컴퓨터와의 결합을 통해 실행시키기 위한 저장매체에 저장된 컴퓨터 프로그램으로 구현될 수 있다.A code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention can be implemented by a computer program stored in a storage medium for execution through a combination with a computer.

또한, 본 발명의 일실시예에 따른 재생 공격 방지가 가능한 부호 기반 암호화 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. In addition, the code-based encryption method capable of preventing a replay attack according to an embodiment of the present invention can be implemented in the form of a program command which can be executed through various computer means and recorded in a computer readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions recorded on the medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like.

이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. As described above, the present invention has been described with reference to particular embodiments, such as specific elements, and specific embodiments and drawings. However, it should be understood that the present invention is not limited to the above- And various modifications and changes may be made thereto by those skilled in the art to which the present invention pertains.

따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.Accordingly, the spirit of the present invention should not be construed as being limited to the embodiments described, and all of the equivalents or equivalents of the claims, as well as the following claims, belong to the scope of the present invention .

110: 재생 공격 방지가 가능한 부호 기반 암호화 장치
111: 패딩부 112: 제1 연산부
113: 제2 연산부 114: 오류 벡터 생성부
115: 암호화부 116: 암호화 메시지 전송부
117: 공개키 저장부 120: 데이터 수신 장치
110: Code-based encryption device capable of preventing playback attack
111: padding unit 112: first calculation unit
113: second operation unit 114: error vector generation unit
115: encryption unit 116: encrypted message transmission unit
117: public key storage unit 120: data receiving apparatus

Claims (14)

"1"과 "0"의 코드 값을 성분으로 포함하는 k x k 크기의 이진 정칙 행렬 S, t비트의 코드에 대한 오류 정정 능력을 가지면서 "1"과 "0"의 코드 값을 성분으로 포함하는 k x n 크기의 생성 행렬 Ge 및 "1"과 "0"의 코드 값을 성분으로 포함하는 n x n 크기의 순열 행렬 P가 곱해진 선정된(predetermined) 공개키 Kpub(Kpub=SGeP)가 저장되어 있는 공개키 저장부;
데이터 수신 장치로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩(padding) 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성하는 패딩부;
q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G - 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수임 - 에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성하는 제1 연산부;
상기 제1 연산 값 X를 제2 해시 함수 H - 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수임 - 에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성하는 제2 연산부;
상기 제2 연산 값 Y로부터 해밍 무게(Hamming Weight)가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성하는 오류 벡터 생성부;
상기 제1 연산 값 X에 대해 상기 공개키 Kpub와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성하는 암호화부; 및
상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송하는 암호화 메시지 전송부
를 포함하고,
상기 암호화부는
상기 제1 연산 값 X에 상기 공개키 Kpub를 곱하여 결과 값 c'을 생성하고, 상기 결과 값 c'과 상기 오류 벡터 e에 대해 배타적 논리합 연산을 수행함으로써, 상기 암호화 메시지 c를 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 장치.
A binary regular matrix S of kxk size including the code values of " 1 " and " 0 " as elements, code values of "1" and "0" a predetermined public key K pub (K pub = SG e P) obtained by multiplying a generation matrix G e of kxn size and a permutation matrix P of nxn size containing code values of "1" and "0" A stored public key storage unit;
A padding unit for padding a padding bit of 1 or more bits with respect to an original message m to be transmitted to the data receiving apparatus to generate a message M having k (k is a natural number) bit size;
a random number r having a bit size q (q is a natural number smaller than k) is a first hash function G - the first hash function G is a one-way function for expanding an input value of a q-bit size to an output value of a k- And generates a first hash value G (r) having a k-bit size by performing an exclusive-OR operation on the message M and the first hash value G (r) A first calculation unit for generating a first calculation result;
The first hash function H and the second hash function H are input to the input of the k-bit input value as an output value of the q-bit size, A second arithmetic unit for generating a second hash value H (X), performing a XOR operation on the random number r and the second hash value H (X) to generate a second arithmetic value Y of q bits;
An error vector generator for generating an error vector e having a Hamming Weight t (t is a natural number) and a size n (n is a natural number) from the second calculated value Y;
An encryption unit for generating an encrypted message c by performing code-based encryption on the first computation value X based on the public key K pub and the error vector e; And
An encryption message transmission unit for transmitting the encryption message c to the data reception device,
Lt; / RTI >
The encryption unit
Generating an encrypted message c by performing an exclusive-OR operation on the result c 'and the error vector e by multiplying the first computed value X by the public key K pub to generate a result c' Code-based encryption device capable of preventing unauthorized access.
삭제delete 제1항에 있어서,
상기 오류 벡터 생성부는
q비트 크기의 입력 값을 t의 해밍 무게를 갖는 n비트 크기의 출력 값으로 매핑(mapping) 변환하도록 설계된 매핑 함수에 대해 상기 제2 연산 값 Y를 입력으로 인가하여 상기 오류 벡터 e를 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 장치.
The method according to claim 1,
The error vector generation unit
a mapping function designed to map an input value of a q-bit size to an output value of an n-bit size having a hamming weight of t, A code-based encryption device capable of preventing attacks.
제1항에 있어서,
상기 오류 벡터 생성부는
q비트 크기를 갖는 2q개의 서로 다른 입력 값들 각각에 대해, t의 해밍 무게를 가지면서 n비트 크기를 갖는 서로 다른 출력 값들이 매핑되어 있는 매핑 테이블을 참조하여, 상기 매핑 테이블로부터 상기 제2 연산 값 Y와 동일한 입력 값에 매핑되어 있는 출력 값을 상기 오류 벡터 e로 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 장치.
The method according to claim 1,
The error vector generation unit
for each of 2 q different input values having a q-bit size, referring to a mapping table in which different output values having an n-bit size are mapped with a Hamming weight of t, And generates an output value mapped to an input value equal to the value Y as the error vector e.
제3항에 있어서,
상기 데이터 수신 장치는
메모리 상에 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 상기 공개키 Kpub에 대응하는 개인키로 각각 저장하고 있음과 동시에, 상기 제1 해시 함수 G와 상기 제2 해시 함수 H 및 상기 매핑 함수를 저장하고 있으며,
상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c로부터 상기 메모리 상에 저장되어 있는 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 기초로한 오류 정정을 수행함으로써, 상기 제1 연산 값 X를 복원하고,
상기 암호화 메시지 c로부터 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 이용하여 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원한 후 상기 제1 해시 함수 G와 상기 제2 해시 함수 H를 기초로 상기 복원된 제1 연산 값 X와 상기 복원된 제2 연산 값 Y로부터 상기 메시지 M을 복원하여 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화하는 재생 공격 방지가 가능한 부호 기반 암호화 장치.
The method of claim 3,
The data receiving apparatus
Storing the binary regular matrix S, the generator matrix G e, and the permutation matrix P as a private key corresponding to the public key K pub on the memory, and storing the first hash function G and the second hash function H And the mapping function,
When the encryption message c is received, performs error correction based on the binary regular matrix S, the generation matrix G e, and the permutation matrix P stored in the memory from the encryption message c, Restores the value X,
Extracting the error vector e from the recovered first computation value X, the binary normals matrix S, the generation matrix G e, and the permutation matrix P from the encryption message c, Mapping function, and restoring the second computation value Y by using the restored first computation value X and the restored second computation value X based on the first hash function G and the second hash function H, And decrypting the original message m by recovering the message M from the computed value Y and removing the padding bits from the recovered message M.
제5항에 있어서,
상기 데이터 수신 장치는
상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c에 대해 상기 메모리 상에 저장되어 있는 상기 순열 행렬 P의 역행렬 P-1을 곱하여 cP-1을 연산하고, 상기 생성 행렬 Ge를 기초로 상기 cP-1에 대한 오류 정정을 수행하여 상기 제1 연산 값 X와 상기 이진 정칙 행렬 S가 곱해진 XS를 연산한 후 상기 XS에 대해 상기 이진 정칙 행렬 S의 역행렬 S-1을 곱하여 상기 제1 연산 값 X를 복원하고,
상기 암호화 메시지 c에 대해, 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P가 곱해진 결과 값을 배타적 논리합함으로써, 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원하며,
상기 제2 해시 함수 H에 대해 상기 복원된 제1 연산 값 X를 입력으로 인가하여 상기 제2 해시 값 H(X)를 연산하고, 상기 복원된 제2 연산 값 Y와 상기 제2 해시 값 H(X)를 배타적 논리합함으로써, 상기 난수 r을 복원하고,
상기 제1 해시 함수 G에 대해 상기 복원된 난수 r을 입력으로 인가하여 상기 제1 해시 값 G(r)을 연산하고, 상기 복원된 제1 연산 값 X와 상기 제1 해시 값 G(r)을 배타적 논리합함으로써, 상기 메시지 M을 복원한 후 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화하는 재생 공격 방지가 가능한 부호 기반 암호화 장치.
6. The method of claim 5,
The data receiving apparatus
If the encrypted message c is received, the encryption of a message and c calculated by multiplying an inverse matrix P -1 -1 a cP of a permutation matrix P, which is stored on the memory, the cP based on the generator matrix G e - 1 to calculate an XS multiplied by the first computation value X and the binary normals matrix S and then multiply the XS by the inverse matrix S -1 of the binary normals matrix S to calculate the first computation value X Lt; / RTI >
The error vector e is extracted by performing an exclusive OR operation on the recovered first computation value X, the binary normals matrix S, the generation matrix G e, and the permutation matrix P, Performing an inverse operation on the extracted error vector e with respect to the mapping function to restore the second calculated value Y,
(X) by applying the restored first calculation value X to the second hash function H, and outputs the restored second calculation value Y and the second hash value H (X) X), thereby restoring the random number r,
The first hash value G is computed by applying the restored random number r to the first hash function G as an input, and the first hash value G (r) is computed using the restored first computation value X and the first hash value G And decrypting the original message m by removing the padding bits from the restored message M after restoring the message M by exclusive-ORing the original message m.
"1"과 "0"의 코드 값을 성분으로 포함하는 k x k 크기의 이진 정칙 행렬 S, t비트의 코드에 대한 오류 정정 능력을 가지면서 "1"과 "0"의 코드 값을 성분으로 포함하는 k x n 크기의 생성 행렬 Ge 및 "1"과 "0"의 코드 값을 성분으로 포함하는 n x n 크기의 순열 행렬 P가 곱해진 선정된(predetermined) 공개키 Kpub(Kpub=SGeP)가 저장되어 있는 공개키 저장부를 유지하는 단계;
데이터 수신 장치로 전송할 원본 메시지 m에 대해 1비트 이상의 패딩(padding) 비트를 패딩하여 k(k는 자연수임)비트 크기를 갖는 메시지 M을 생성하는 단계;
q(q는 k보다 작은 자연수임)비트 크기를 갖는 난수 r을 제1 해시 함수 G - 상기 제1 해시 함수 G는 q비트 크기의 입력 값을 k비트 크기의 출력 값으로 확장시키는 일방향 함수임 - 에 입력으로 인가하여 k비트 크기를 갖는 제1 해시 값 G(r)을 생성하고, 상기 메시지 M과 상기 제1 해시 값 G(r)을 배타적 논리합 연산함으로써, k비트 크기의 제1 연산 값 X를 생성하는 단계;
상기 제1 연산 값 X를 제2 해시 함수 H - 상기 제2 해시 함수 H는 k비트 크기의 입력 값을 q비트 크기의 출력 값으로 축소시키는 일방향 함수임 - 에 입력으로 인가하여 q비트 크기를 갖는 제2 해시 값 H(X)를 생성하고, 상기 난수 r과 상기 제2 해시 값 H(X)를 배타적 논리합 연산함으로써, q비트 크기의 제2 연산 값 Y를 생성하는 단계;
상기 제2 연산 값 Y로부터 해밍 무게(Hamming Weight)가 t(t는 자연수임)이면서, 크기가 n(n은 자연수임)인 오류 벡터 e를 생성하는 단계;
상기 제1 연산 값 X에 대해 상기 공개키 Kpub와 상기 오류 벡터 e를 기초로 부호 기반 암호화를 수행함으로써, 암호화 메시지 c를 생성하는 단계; 및
상기 암호화 메시지 c를 상기 데이터 수신 장치로 전송하는 단계
를 포함하고,
상기 암호화 메시지 c를 생성하는 단계는
상기 제1 연산 값 X에 상기 공개키 Kpub를 곱하여 결과 값 c'을 생성하고, 상기 결과 값 c'과 상기 오류 벡터 e에 대해 배타적 논리합 연산을 수행함으로써, 상기 암호화 메시지 c를 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 방법.
A binary regular matrix S of kxk size including the code values of " 1 " and " 0 " as elements, code values of "1" and "0" a predetermined public key K pub (K pub = SG e P) obtained by multiplying a generation matrix G e of kxn size and a permutation matrix P of nxn size containing code values of "1" and "0" Maintaining a stored public key storage;
Padding a padding bit of 1 bit or more with respect to the original message m to be transmitted to the data receiving apparatus to generate a message M having k (k is a natural number) bit size;
a random number r having a bit size q (q is a natural number smaller than k) is a first hash function G - the first hash function G is a one-way function for expanding an input value of a q-bit size to an output value of a k- And generates a first hash value G (r) having a k-bit size by performing an exclusive-OR operation on the message M and the first hash value G (r) ≪ / RTI >
The first hash function H and the second hash function H are input to the input of the k-bit input value as an output value of the q-bit size, Generating a second hash value H (X), performing a XOR operation on the random number r and the second hash value H (X) to generate a second calculated value Y of q bit size;
Generating an error vector e having a Hamming Weight t (t is a natural number) and a size n (n is a natural number) from the second calculated value Y;
Generating an encrypted message c by performing code-based encryption on the first computed value X based on the public key K pub and the error vector e; And
Transmitting the encrypted message c to the data receiving apparatus
Lt; / RTI >
The step of generating the encrypted message c
Generating an encrypted message c by performing an exclusive-OR operation on the result c 'and the error vector e by multiplying the first computed value X by the public key K pub to generate a result c' Code - based encryption method that can prevent.
삭제delete 제7항에 있어서,
상기 오류 벡터 e를 생성하는 단계는
q비트 크기의 입력 값을 t의 해밍 무게를 갖는 n비트 크기의 출력 값으로 매핑(mapping) 변환하도록 설계된 매핑 함수에 대해 상기 제2 연산 값 Y를 입력으로 인가하여 상기 오류 벡터 e를 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 방법.
8. The method of claim 7,
The step of generating the error vector e
a mapping function designed to map an input value of a q-bit size to an output value of an n-bit size having a hamming weight of t, A code - based encryption method capable of preventing attacks.
제7항에 있어서,
상기 오류 벡터 e를 생성하는 단계는
q비트 크기를 갖는 2q개의 서로 다른 입력 값들 각각에 대해, t의 해밍 무게를 가지면서 n비트 크기를 갖는 서로 다른 출력 값들이 매핑되어 있는 매핑 테이블을 참조하여, 상기 매핑 테이블로부터 상기 제2 연산 값 Y와 동일한 입력 값에 매핑되어 있는 출력 값을 상기 오류 벡터 e로 생성하는 재생 공격 방지가 가능한 부호 기반 암호화 방법.
8. The method of claim 7,
The step of generating the error vector e
for each of 2 q different input values having a q-bit size, referring to a mapping table in which different output values having an n-bit size are mapped with a Hamming weight of t, And generating an output value mapped to an input value equal to the value Y as the error vector e.
제9항에 있어서,
상기 데이터 수신 장치는
메모리 상에 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 상기 공개키 Kpub에 대응하는 개인키로 각각 저장하고 있음과 동시에, 상기 제1 해시 함수 G와 상기 제2 해시 함수 H 및 상기 매핑 함수를 저장하고 있으며,
상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c로부터 상기 메모리 상에 저장되어 있는 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 기초로한 오류 정정을 수행함으로써, 상기 제1 연산 값 X를 복원하고,
상기 암호화 메시지 c로부터 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P를 이용하여 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원한 후 상기 제1 해시 함수 G와 상기 제2 해시 함수 H를 기초로 상기 복원된 제1 연산 값 X와 상기 복원된 제2 연산 값 Y로부터 상기 메시지 M을 복원하여 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화하는 재생 공격 방지가 가능한 부호 기반 암호화 방법.
10. The method of claim 9,
The data receiving apparatus
Storing the binary regular matrix S, the generator matrix G e, and the permutation matrix P as a private key corresponding to the public key K pub on the memory, and storing the first hash function G and the second hash function H And the mapping function,
When the encryption message c is received, performs error correction based on the binary regular matrix S, the generation matrix G e, and the permutation matrix P stored in the memory from the encryption message c, Restores the value X,
Extracting the error vector e from the recovered first computation value X, the binary normals matrix S, the generation matrix G e, and the permutation matrix P from the encryption message c, Mapping function, and restoring the second computation value Y by using the restored first computation value X and the restored second computation value X based on the first hash function G and the second hash function H, And decoding the original message m by recovering the message M from the computed value Y and removing the padding bits from the recovered message M.
제11항에 있어서,
상기 데이터 수신 장치는
상기 암호화 메시지 c가 수신되면, 상기 암호화 메시지 c에 대해 상기 메모리 상에 저장되어 있는 상기 순열 행렬 P의 역행렬 P-1을 곱하여 cP-1을 연산하고, 상기 생성 행렬 Ge를 기초로 상기 cP-1에 대한 오류 정정을 수행하여 상기 제1 연산 값 X와 상기 이진 정칙 행렬 S가 곱해진 XS를 연산한 후 상기 XS에 대해 상기 이진 정칙 행렬 S의 역행렬 S-1을 곱하여 상기 제1 연산 값 X를 복원하고,
상기 암호화 메시지 c에 대해, 상기 복원된 제1 연산 값 X와 상기 이진 정칙 행렬 S, 상기 생성 행렬 Ge 및 상기 순열 행렬 P가 곱해진 결과 값을 배타적 논리합함으로써, 상기 오류 벡터 e를 추출하고, 상기 추출된 오류 벡터 e에 대해 상기 매핑 함수에 대한 역연산을 수행함으로써, 상기 제2 연산 값 Y를 복원하며,
상기 제2 해시 함수 H에 대해 상기 복원된 제1 연산 값 X를 입력으로 인가하여 상기 제2 해시 값 H(X)를 연산하고, 상기 복원된 제2 연산 값 Y와 상기 제2 해시 값 H(X)를 배타적 논리합함으로써, 상기 난수 r을 복원하고,
상기 제1 해시 함수 G에 대해 상기 복원된 난수 r을 입력으로 인가하여 상기 제1 해시 값 G(r)을 연산하고, 상기 복원된 제1 연산 값 X와 상기 제1 해시 값 G(r)을 배타적 논리합함으로써, 상기 메시지 M을 복원한 후 상기 복원된 메시지 M에서 상기 패딩 비트를 제거함으로써, 상기 원본 메시지 m을 복호화하는 재생 공격 방지가 가능한 부호 기반 암호화 방법.
12. The method of claim 11,
The data receiving apparatus
If the encrypted message c is received, the encryption of a message and c calculated by multiplying an inverse matrix P -1 -1 a cP of a permutation matrix P, which is stored on the memory, the cP based on the generator matrix G e - 1 to calculate an XS multiplied by the first computation value X and the binary normals matrix S and then multiply the XS by the inverse matrix S -1 of the binary normals matrix S to calculate the first computation value X Lt; / RTI >
The error vector e is extracted by performing an exclusive OR operation on the recovered first computation value X, the binary normals matrix S, the generation matrix G e, and the permutation matrix P, Performing an inverse operation on the extracted error vector e with respect to the mapping function to restore the second calculated value Y,
(X) by applying the restored first calculation value X to the second hash function H, and outputs the restored second calculation value Y and the second hash value H (X) X), thereby restoring the random number r,
The first hash value G is computed by applying the restored random number r to the first hash function G as an input, and the first hash value G (r) is computed using the restored first computation value X and the first hash value G Wherein the original message m is decrypted by removing the padding bits from the restored message M after restoring the message M by exclusive-ORing.
제7항, 제9항, 제10항, 제11항 또는 제12항 중 어느 한 항의 방법을 수행하는 프로그램을 기록한 컴퓨터 판독 가능 기록 매체.A computer-readable recording medium recording a program for performing the method of any one of claims 7, 9, 10, 11, and 12. 제7항, 제9항, 제10항, 제11항 또는 제12항 중 어느 한 항의 방법을 컴퓨터와의 결합을 통해 실행시키기 위한 저장매체에 저장된 컴퓨터 프로그램.A computer program stored in a storage medium for executing the method of any one of claims 7, 9, 10, 11, or 12 through a combination with a computer.
KR1020170110648A 2017-08-31 2017-08-31 Code-based encryption apparatus and method capable of preventing replay attack KR101978684B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170110648A KR101978684B1 (en) 2017-08-31 2017-08-31 Code-based encryption apparatus and method capable of preventing replay attack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170110648A KR101978684B1 (en) 2017-08-31 2017-08-31 Code-based encryption apparatus and method capable of preventing replay attack

Publications (2)

Publication Number Publication Date
KR20190024064A KR20190024064A (en) 2019-03-08
KR101978684B1 true KR101978684B1 (en) 2019-05-15

Family

ID=65801732

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170110648A KR101978684B1 (en) 2017-08-31 2017-08-31 Code-based encryption apparatus and method capable of preventing replay attack

Country Status (1)

Country Link
KR (1) KR101978684B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187447A (en) * 2020-10-22 2021-01-05 南方电网科学研究院有限责任公司 Encryption and decryption algorithm key generation method and device
CN117201020B (en) * 2023-11-08 2024-01-26 陕西元镁体信息科技有限公司 Network information security encryption method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011509433A (en) * 2008-01-11 2011-03-24 フランス・テレコム Methods and entities for probabilistic symmetric encryption
JP2012068436A (en) 2010-09-24 2012-04-05 Mitsubishi Electric Corp Hash value arithmetic device, hash value arithmetic method and hash value arithmetic program
JP5038866B2 (en) * 2007-11-27 2012-10-03 日本電信電話株式会社 Encryption communication method, encryption device, decryption device, and program thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080044150A (en) * 2006-11-09 2008-05-20 한국전자통신연구원 Apparatus and method for mapping out compressed function of a hash mode of operation for block cipher
KR101663274B1 (en) * 2015-01-14 2016-10-07 주식회사 틸론 Encryption device, decryption device and system for performing padding in block cipher mode

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5038866B2 (en) * 2007-11-27 2012-10-03 日本電信電話株式会社 Encryption communication method, encryption device, decryption device, and program thereof
JP2011509433A (en) * 2008-01-11 2011-03-24 フランス・テレコム Methods and entities for probabilistic symmetric encryption
JP2012068436A (en) 2010-09-24 2012-04-05 Mitsubishi Electric Corp Hash value arithmetic device, hash value arithmetic method and hash value arithmetic program

Also Published As

Publication number Publication date
KR20190024064A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US20170324554A1 (en) Public Key Cryptosystem Based On Partitioning Of Galois Field Elements
KR101942030B1 (en) Electronic device for performing code-based encryption supporting integrity verification of a message and operating method thereof
KR101913100B1 (en) Data encryption apparatus and method using an encryption key based on puncturing of a generator matrix
KR101913644B1 (en) Code-based encryption apparatus and method capable of message authentication
JP6588048B2 (en) Information processing device
US11349668B2 (en) Encryption device and decryption device
EP3167569B1 (en) Method and system for providing a secure update of code on a memory-constrained device
US11153068B2 (en) Encryption device, encryption method, decryption device and decryption method
US8724802B2 (en) Cryptographic system
KR100561847B1 (en) Method of public key encryption and decryption method
JP2004363739A (en) Enciphering device or deciphering device for common key cipher that can detect alteration
JP2003535378A (en) Parallel modulo operations using bitwise logical operations
KR101978684B1 (en) Code-based encryption apparatus and method capable of preventing replay attack
KR102096359B1 (en) Data transmission apparatus capable of secret key encryption based on involutory matrix and operating method thereof
JP5992651B2 (en) ENCRYPTION METHOD, PROGRAM, AND SYSTEM
KR102211648B1 (en) Electronic device capable of data communication through electronic signatures based on syndrome and operating method thereof
KR101894566B1 (en) Data transmission apparatus and method for encoding by integrating authentication and error correction
KR102024379B1 (en) Data transmission apparatus capable of digital signature based on biometric information and operating method thereof
JP2003535499A (en) End of message marker
KR101942033B1 (en) Electronic device capable of decrypting code-based encrypted data in which t+a error codes are inserted and operating method thereof
KR101974345B1 (en) Data communication apparatus for connected vehicle supporting secure communication between vehicles via digital signature and operating method thereof
KR20140028233A (en) Homomorphic encryption and decryption method using chinese remainder theorem and apparatus using the same
KR102326527B1 (en) Data transmission device that performs secure communication based on asymmetric encryption and operating method thereof
US20200389328A1 (en) Electronic system capable of self-certification
Kabetta Implementation of A New Quasi-Cyclic Goppa Code in McEliece Cryptography

Legal Events

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