KR20240081407A - Electronic device for encrypting data by public key and methods thereof - Google Patents

Electronic device for encrypting data by public key and methods thereof Download PDF

Info

Publication number
KR20240081407A
KR20240081407A KR1020230168643A KR20230168643A KR20240081407A KR 20240081407 A KR20240081407 A KR 20240081407A KR 1020230168643 A KR1020230168643 A KR 1020230168643A KR 20230168643 A KR20230168643 A KR 20230168643A KR 20240081407 A KR20240081407 A KR 20240081407A
Authority
KR
South Korea
Prior art keywords
value
random
public key
processor
random matrix
Prior art date
Application number
KR1020230168643A
Other languages
Korean (ko)
Inventor
천정희
최형민
홍동연
Original Assignee
주식회사 크립토랩
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 크립토랩 filed Critical 주식회사 크립토랩
Priority to US18/522,648 priority Critical patent/US20240178992A1/en
Publication of KR20240081407A publication Critical patent/KR20240081407A/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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates

Landscapes

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

Abstract

전자 장치가 개시된다. 본 장치는, 통신부, 키 생성을 위한 데이터가 저장되는 메모리 및 프로세서를 포함한다. 여기서, 프로세서는, 메모리에 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하고, 비밀 키 및 에러를 이용하여 공개 키를 생성하여, 비밀 키를 메모리에 저장하고, 통신부를 이용하여 공개 키를 외부 장치로 전송한다. 여기서, 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응될 수 있다. 이에 따라 효율적으로 암호화 및 복호화를 수행할 수 있다. An electronic device is disclosed. This device includes a communication unit, a memory in which data for key generation is stored, and a processor. Here, the processor generates a secret key by randomly combining values within a preset range based on data stored in the memory, generates a public key using the secret key and an error, stores the secret key in the memory, and communicates with the communication unit. Send the public key to an external device using . Here, the sum of the remaining values excluding 0 among the values within the preset range may correspond to the Hamming weight. Accordingly, encryption and decryption can be performed efficiently.

Description

공개 키를 이용하여 암호화하는 전자 장치 및 그 방법들 { ELECTRONIC DEVICE FOR ENCRYPTING DATA BY PUBLIC KEY AND METHODS THEREOF}Electronic device and methods for encrypting using a public key {ELECTRONIC DEVICE FOR ENCRYPTING DATA BY PUBLIC KEY AND METHODS THEREOF}

본 발명은 공개 키를 이용하여 암호화하는 전자 장치 및 그 방법에 대한 것으로, 보다 상세하게는, 에러를 이용하여 공개 키를 생성하고, 그 공개 키로 암호화를 수행하는 전자 장치 및 그 방법에 대한 것이다.The present invention relates to an electronic device and method for encrypting using a public key, and more specifically, to an electronic device and method for generating a public key using an error and performing encryption with the public key.

데이터를 외부 장치로 전송하는 경우, 전송 과정에서 해당 데이터가 제3자에게 유출될 가능성이 있다. 따라서, 비록 유출이 되더라도 제3자가 데이터의 내용을 확인할 수 없도록 암호화를 수행하여 전송하는 것이 일반적이다. When transferring data to an external device, there is a possibility that the data may be leaked to a third party during the transfer process. Therefore, even if it is leaked, it is common to encrypt and transmit the data so that a third party cannot check the contents of the data.

암호화 방법에는 크게 대칭키 암호화 방법과 비대칭키 암호화 방법이 있다. 대칭키 암호화 방법은 암호화에 사용하는 키와 복호화에 사용하는 키가 동일하기 때문에 속도는 빠르지만 키가 외부에 유출되는 경우 보안성이 담보되지 않을 수 있다. 그러한 문제를 해결하기 위하여 비대칭키 암호화 방법이 사용된다. 비대칭키 암호화 방법에서는 제3자에게 공개하는 공개 키와, 사용자 본인만 보유하는 비밀키(또는 개인 키)를 사용한다. 사용자는 공개 키를 이용하여 메시지를 암호화하여 송신하고, 이를 수신한 수신자는 자신의 비밀키를 이용하여 암호문을 복호화한다.Encryption methods largely include symmetric key encryption methods and asymmetric key encryption methods. The symmetric key encryption method is fast because the key used for encryption and the key used for decryption are the same, but security may not be guaranteed if the key is leaked to the outside. To solve such problems, asymmetric key encryption method is used. The asymmetric key encryption method uses a public key that is disclosed to a third party and a secret key (or private key) held only by the user. The user encrypts and sends a message using a public key, and the recipient decrypts the ciphertext using his or her private key.

종래에는 다양한 암호화/복호화 기술이 연구되고 사용되고 있다. 하지만, 종래의 알고리즘들은 보안 성능을 키우기 위하여 프로세서 및 메모리에 많은 연산 부담을 주게 된다. 따라서, 스마트 폰이나 태블릿 pc, 웨어러블 디바이스 등과 같은 소형의 휴대형 장치에서 종래의 암호화/복호화 기술을 그대로 사용하기에는 어려움이 있었다. In the past, various encryption/decryption technologies have been researched and used. However, conventional algorithms place a large computational burden on the processor and memory to increase security performance. Therefore, it was difficult to use conventional encryption/decryption technology in small portable devices such as smart phones, tablet PCs, and wearable devices.

이에 따라, 보다 효율적인 암호화/복호화 기술에 대한 필요성이 대두되었다. Accordingly, the need for more efficient encryption/decryption technology has emerged.

본 발명은 상술한 필요성에 따라 안출된 것으로, 본 발명의 목적은, 높은 보안 성능을 가지면서 효율적으로 암호화/복호화를 수행할 수 있는 전자 장치 및 그 방법들을 제공함에 있다. The present invention was conceived in response to the above-described need, and the purpose of the present invention is to provide an electronic device and method that can efficiently perform encryption/decryption while having high security performance.

상술한 목적을 달성하기 위한 본 개시의 적어도 하나의 실시 예에 따른 전자 장치는, 통신부, 키 생성을 위한 데이터가 저장되는 메모리 및 프로세서를 포함한다. 상기 프로세서는, 상기 메모리에 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하고, 상기 비밀키 및 에러를 이용하여 공개 키를 생성하여, 상기 비밀키 및 상기 공개 키를 상기 메모리에 저장하고, 상기 통신부를 이용하여 상기 공개 키를 외부 장치로 전송하며, 상기 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응된다. An electronic device according to at least one embodiment of the present disclosure for achieving the above-described object includes a communication unit, a memory storing data for key generation, and a processor. The processor generates a secret key by randomly combining values within a preset range based on the data stored in the memory, generates a public key using the secret key and an error, and generates the secret key and the public key. The public key is stored in the memory and transmitted to an external device using the communication unit, and the sum of the remaining values excluding 0 among the values within the preset range corresponds to a Hamming weight.

상기 프로세서는, 랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득하고, 이산가우시안 분포 또는 상기 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 상기 에러를 획득하며, 상기 에러를 모듈러 연산한 값과, 상기 비밀 키 및 상기 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득하며, 상기 공개 키는, 상기 랜덤 행렬(A)또는 상기 랜덤 행렬(A) 획득에 사용되는 시드값과 상기 랜덤 벡터(b)를 포함할 수 있다. The processor obtains a random matrix (A) composed of randomly determined vectors, obtains the error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution, and obtains a modular operation value of the error and , a random vector (b) is obtained based on the secret key and the random matrix, and the public key is the random matrix (A) or a seed value used to obtain the random matrix (A) and the random vector (b ) may include.

또는, 상기 프로세서는, 상기 메모리에 저장된 데이터 중에서 시드 값에 대해 확장 가능 출력 함수(extendable-output function, XOF)를 적용하여 제1 시드값, 제2 시드값, 제3 시드값을 획득하고, 상기 제1 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하고, 상기 제2 시드값에 해밍 웨이트 샘플러 함수를 적용하여, 해밍 웨이트 h를 가지는 비조밀(sparse) 벡터인 상기 비밀키 s를 획득하며, 상기 제3 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 에러 e를 획득할 수도 있다. Alternatively, the processor obtains a first seed value, a second seed value, and a third seed value by applying an extendable-output function (XOF) to a seed value among the data stored in the memory, and The random matrix (A) is obtained by applying a random matrix sampler function to the first seed value, and the Hamming weight sampler function is applied to the second seed value, so that the secret is a sparse vector with a Hamming weight h. The key s may be obtained, and an error e with a standard deviation σ may be obtained by applying a discrete Gaussian sampler function to the third seed value.

또는, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r과 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 상기 랜덤 벡터 b와 상기 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함하는 암호문이 상기 외부 장치로부터 상기 통신부를 통해 수신되면, 상기 프로세서는, 상기 제1 값 및 상기 비밀키를 연산한 결과값 및 상기 제2 값에 각각 모듈러스 연산을 수행한 후, 가산하여 메시지를 복호할 수 있다.Or, a first value (c1) obtained by rounding the result of the operation based on a random vector r randomly extracting values within a preset range and the random matrix A, the random vector b, and the random vector r are calculated. When ciphertext including a second value (c2) obtained by rounding one result value is received from the external device through the communication unit, the processor calculates the first value and the secret key and generates the second value. The message can be decoded by performing a modulus operation on each value and then adding them.

본 개시의 적어도 하나의 실시 예에 따른 전자 장치는, 통신부, 외부 장치로 전송할 데이터를 입력 받기 위한 인터페이스, 상기 데이터를 저장하기 위한 메모리 및 프로세서를 포함하며, 상기 프로세서는, 외부 장치에서 에러를 이용하여 생성한 공개 키에 대한 정보가 상기 통신부를 통해 수신되면, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하고, 상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하고, 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과, 상기 랜덤 벡터 b, 상기 랜덤 벡터 r 및 상기 데이터에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하며, 상기 제1 값 및 상기 제2 값을 포함하는 암호문을 상기 통신부를 통해 상기 외부 장치로 전송한다. An electronic device according to at least one embodiment of the present disclosure includes a communication unit, an interface for receiving data to be transmitted to an external device, a memory for storing the data, and a processor, where the processor detects an error in the external device. When information about the generated public key is received through the communication unit, a random vector r is obtained by randomly extracting values within a preset range, a random matrix A and a random vector b are obtained from the public key, and the random matrix A first value (c1) obtained by rounding the result value calculated based on A, and a second value c2 obtained by rounding the result value calculated based on the random vector b, the random vector r, and the data. each is obtained, and ciphertext including the first value and the second value is transmitted to the external device through the communication unit.

상기 프로세서는, 상기 공개 키에 상기 랜덤 행렬 A가 포함되어 있으면 상기 랜덤 행렬 A를 추출하고, 상기 공개 키에 시드값이 포함되어 있으면 상기 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득할 수 있다. The processor extracts the random matrix A if the public key includes the random matrix A, and if the public key includes a seed value, applies a random matrix sampler function to the seed value to generate the random matrix (A ) can be obtained.

상기 프로세서는, 상기 메모리에 저장된 시드값에 해밍 웨이트 샘플러 함수를 적용하여 상기 랜덤 벡터 r을 획득할 수 있다. The processor may obtain the random vector r by applying a Hamming weight sampler function to the seed value stored in the memory.

본 개시의 적어도 하나의 실시 예에 따르면, 전자 장치의 제어 방법은, 기 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하는 단계, 상기 비밀키 및 에러를 이용하여 공개 키를 생성하는 단계, 상기 비밀키 및 상기 공개 키를 저장하는 단계 및 상기 공개 키를 외부 장치로 전송하는 단계를 포함하며, 여기서, 상기 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응된다. According to at least one embodiment of the present disclosure, a method of controlling an electronic device includes generating a secret key by randomly combining values within a preset range based on pre-stored data, and disclosing the secret key using the secret key and an error. Generating a key, storing the private key and the public key, and transmitting the public key to an external device, wherein the sum of the remaining values excluding 0 among the values within the preset range is corresponds to the Hamming weight.

상기 공개 키를 생성하는 단계는, 랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득하는 단계, 이산가우시안 분포 또는 상기 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 상기 에러를 획득하는 단계, 상기 에러를 모듈러 연산한 값과, 상기 비밀 키 및 상기 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득하는 단계 및 상기 랜덤 행렬(A) 또는 상기 랜덤 행렬(A) 획득에 사용되는 시드값과 상기 랜덤 벡터(b)를 포함하는, 상기 공개 키를 생성하는 단계를 포함할 수 있다.Generating the public key includes obtaining a random matrix (A) composed of randomly determined vectors, obtaining the error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution, Obtaining a random vector (b) based on a modular operation value of an error, the secret key, and the random matrix, and the random matrix (A) or a seed value used to obtain the random matrix (A) and the random and generating the public key, including the vector (b).

또는, 상기 공개 키를 생성하는 단계는, 기 저장된 시드 값에 대해 확장 가능 출력 함수(extendable-output function, XOF)를 적용하여 제1 시드값, 제2 시드값, 제3 시드값을 획득하는 단계, 상기 제1 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하는 단계, 상기 제3 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 상기 에러 e를 획득하는 단계를 포함할 수 있다. 상기 비밀 키를 생성하는 단계는, 상기 제2 시드값에 해밍 웨이트 샘플러 함수를 적용하여, 해밍 웨이트 h를 가지는 비조밀(sparse) 벡터인 상기 비밀키 s를 획득할 수 있다. Alternatively, the step of generating the public key may include obtaining a first seed value, a second seed value, and a third seed value by applying an extendable-output function (XOF) to a pre-stored seed value. , obtaining the random matrix (A) by applying a random matrix sampler function to the first seed value, and obtaining the error e with a standard deviation σ by applying a discrete Gaussian sampler function to the third seed value. May include steps. In the step of generating the secret key, the secret key s, which is a sparse vector with a Hamming weight h, may be obtained by applying a Hamming weight sampler function to the second seed value.

또는, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r과 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 상기 랜덤 벡터 b와 상기 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함하는 암호문이 상기 외부 장치로부터 수신되면, 상기 제1 값 및 상기 비밀키를 연산한 결과값 및 상기 제2 값에 각각 모듈러스 연산을 수행한 후, 가산하여 메시지를 복호하는 단계를 더 포함할 수도 있다. Or, a first value (c1) obtained by rounding the result of the operation based on a random vector r randomly extracting values within a preset range and the random matrix A, the random vector b, and the random vector r are calculated. When ciphertext containing a second value (c2) obtained by rounding one result value is received from the external device, a modulus operation is performed on the first value, the result of calculating the secret key, and the second value, respectively. Afterwards, a step of adding and decoding the message may be further included.

한편, 본 개시의 적어도 하나의 실시 예에 따른, 전자 장치의 암호화 방법은, 외부 장치에서 에러를 이용하여 생성한 공개 키에 대한 정보를 수신하여 저장하는 단계, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하는 단계, 상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계, 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과, 상기 랜덤 벡터 b, 상기 랜덤 벡터 r 및 메시지에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하는 단계, 상기 제1 값 및 상기 제2 값을 포함하는 암호문을 생성하여 상기 외부 장치로 전송하는 단계를 포함한다. Meanwhile, an encryption method for an electronic device according to at least one embodiment of the present disclosure includes receiving and storing information about a public key generated using an error in an external device, randomly extracting values within a preset range, Obtaining a random vector r, obtaining a random matrix A and a random vector b from the public key, a first value c1 obtained by rounding a result calculated based on the random matrix A, and the random vector b, obtaining a second value (c2) obtained by rounding the result of the operation based on the random vector r and the message, generating a ciphertext including the first value and the second value, and It includes the step of transmitting to .

여기서, 상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계는, 상기 공개 키에 상기 랜덤 행렬 A가 포함되어 있으면 상기 랜덤 행렬 A를 추출하는 단계 및 상기 공개 키에 시드값이 포함되어 있으면 상기 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하는 단계를 포함할 수 있다. Here, the step of obtaining the random matrix A and the random vector b from the public key includes extracting the random matrix A if the public key includes the random matrix A, and if the public key includes a seed value. It may include obtaining the random matrix (A) by applying a random matrix sampler function to the seed value.

상기 랜덤 벡터 r을 획득하는 단계는, 기 저장된 시드값에 해밍 웨이트 샘플러 함수를 적용하여 상기 랜덤 벡터 r을 획득할 수 있다. In the step of acquiring the random vector r, the random vector r may be obtained by applying a Hamming weight sampler function to a previously stored seed value.

이상과 같은 본 발명의 다양한 실시 예들에 따르면, 공개 키 생성, 암호화 및 복호화 과정을 효율적으로 처리할 수 있게 된다. According to the various embodiments of the present invention as described above, it is possible to efficiently process public key generation, encryption, and decryption processes.

도 1은 본 개시의 적어도 하나의 실시 예에 따른 전자 장치들의 동작을 설명하기 위한 도면,
도 2는 본 개시의 적어도 하나의 실시 예에 따라 공개 키를 생성하는 전자 장치의 구성을 나타내는 블럭도,
도 3은 본 개시의 적어도 하나의 실시 예에 따라 암호화를 수행하는 전자 장치의 구성을 나타내는 블럭도,
도 4는 본 개시의 적어도 하나의 실시 예에 따라 공개 키를 생성하는 방법을 설명하기 위한 흐름도,
도 5는 본 개시의 적어도 하나의 실시 예에 따라 암호화를 수행하는 방법을 설명하기 위한 흐름도,
도 6은 해밍 웨이트 샘플러 함수를 적용하는 방법을 설명하기 위한 도면,
도 7 및 도 8은 서로 다른 표준 편차를 가지는 이산 가우시안 샘플러 함수를 적용하는 방법을 설명하기 위한 도면, 그리고,
도 9는 본 개시의 일 실시 예에 따른 암호화 방법과 기존 암호화 방법의 성능을 비교하기 위한 테이블이다.
1 is a diagram for explaining the operation of electronic devices according to at least one embodiment of the present disclosure;
2 is a block diagram showing the configuration of an electronic device that generates a public key according to at least one embodiment of the present disclosure;
3 is a block diagram showing the configuration of an electronic device that performs encryption according to at least one embodiment of the present disclosure;
4 is a flowchart illustrating a method for generating a public key according to at least one embodiment of the present disclosure;
5 is a flowchart illustrating a method of performing encryption according to at least one embodiment of the present disclosure;
Figure 6 is a diagram for explaining a method of applying the Hamming weight sampler function;
Figures 7 and 8 are diagrams for explaining a method of applying a discrete Gaussian sampler function with different standard deviations, and
Figure 9 is a table for comparing the performance of an encryption method according to an embodiment of the present disclosure and an existing encryption method.

이하에서는 첨부 도면을 참조하여 본 발명에 대해서 자세하게 설명한다. 본 명세서에서 수행되는 정보(데이터) 전송 과정은 필요에 따라서 암호화/복호화가 적용될 수 있으며, 본 명세서 및 특허청구범위에서 정보(데이터) 전송 과정을 설명하는 표현은 별도로 언급되지 않더라도 모두 암호화/복호화하는 경우도 포함하는 것으로 해석되어야 한다. 본 명세서에서 "A로부터 B로 전송(전달)" 또는 "A가 B로부터 수신"과 같은 형태의 표현은 중간에 다른 매개체가 포함되어 전송(전달) 또는 수신되는 것도 포함하며, A로부터 B까지 직접 전송(전달) 또는 수신되는 것만을 표현하는 것은 아니다. 본 발명의 설명에 있어서 각 단계의 순서는 선행 단계가 논리적 및 시간적으로 반드시 후행 단계에 앞서서 수행되어야 하는 경우가 아니라면 각 단계의 순서는 비제한적으로 이해되어야 한다. 즉, 위와 같은 예외적인 경우를 제외하고는 후행 단계로 설명된 과정이 선행단계로 설명된 과정보다 앞서서 수행되더라도 발명의 본질에는 영향이 없으며 권리범위 역시 단계의 순서에 관계없이 정의되어야 한다. 그리고 본 명세서에서 “A 또는 B”은 A와 B 중 어느 하나를 선택적으로 가리키는 것뿐만 아니라 A와 B 모두를 포함하는 것도 의미하는 것으로 정의된다. 또한, 본 명세서에서 "포함"이라는 용어는 포함하는 것으로 나열된 요소 이외에 추가로 다른 구성요소를 더 포함하는 것도 포괄하는 의미를 가진다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. Encryption/decryption may be applied to the information (data) transmission process performed in this specification as necessary, and expressions describing the information (data) transmission process in this specification and patent claims are all encryption/decryption even if not separately mentioned. It should be interpreted to include cases as well. In this specification, expressions such as “transmitted from A to B” or “received by A from B” also include transmission (transmission) or reception with another medium in between, and directly from A to B. It does not only express what is transmitted (delivered) or received. In the description of the present invention, the order of each step should be understood as non-limiting unless the preceding step must be performed logically and temporally prior to the subsequent step. In other words, except for the above exceptional cases, even if the process described as a subsequent step is performed before the process described as a preceding step, the essence of the invention is not affected, and the scope of rights must also be defined regardless of the order of the steps. And in this specification, “A or B” is defined to mean not only selectively indicating either A or B, but also including both A and B. In addition, the term "included" in this specification has the meaning of including additional components in addition to the elements listed as included.

본 명세서에서는 본 발명의 설명에 필요한 필수적인 구성요소만을 설명하며, 본 발명의 본질과 관계가 없는 구성요소는 언급하지 아니한다. 그리고 언급되는 구성요소만을 포함하는 배타적인 의미로 해석되어서는 아니되며 다른 구성요소도 포함할 수 있는 비배타적인 의미로 해석되어야 한다.In this specification, only essential components necessary for description of the present invention are described, and components unrelated to the essence of the present invention are not mentioned. And it should not be interpreted in an exclusive sense that includes only the mentioned components, but in a non-exclusive sense that can also include other components.

그리고 본 명세서에서 "값"이라 함은 스칼라값 뿐만 아니라 벡터도 포함하는 개념으로 정의된다. And in this specification, “value” is defined as a concept that includes not only scalar values but also vectors.

후술하는 본 발명의 각 단계의 수학적 연산 및 산출은 해당 연산 또는 산출을 하기 위해 공지되어 있는 코딩 방법 및/또는 본 발명에 적합하게 고안된 코딩에 의해서 컴퓨터 연산으로 구현될 수 있다.The mathematical operations and calculations of each step of the present invention described later can be implemented in computer operations by known coding methods and/or coding designed to be suitable for the present invention for performing the corresponding operations or calculations.

이하에서 설명하는 구체적인 수학식은 가능한 여러 대안 중에서 예시적으로 설명되는 것이며, 본 발명의 권리 범위가 본 명세서에 언급된 수학식에 제한되는 것으로 해석되어서는 아니된다.The specific mathematical equations described below are illustrative among various possible alternatives, and should not be construed as limiting the scope of the present invention to the mathematical equations mentioned in this specification.

설명의 편의를 위해서, 본 명세서에서는 다음과 같이 표기를 정하기로 한다.For convenience of explanation, in this specification, the notation is set as follows.

영문 대문자 볼드체: 행렬Bold capital letters: matrix

영문 소문자 볼드체: 열벡터(column vector)English lowercase letters in bold: column vector

a ← D : 분포(D)에 따라서 원소(a)를 선택함a ← D: Select element (a) according to distribution (D)

링 R=Z(x)/(f(x)) : 정수 위에서 다항식 연산 후에 f(x)로 나눈 나머지를 계산함Ring R=Z(x)/(f(x)): Calculate the remainder divided by f(x) after polynomial operation on integers.

: 내부값을 반올림함 : Rounds the internal value.

: 연접(concatenation); 같은 개수의 행을 가지는 열벡터 또는 행렬을 나란히 연결하여 새로운 벡터 또는 행렬을 산출함 : concatenation; Calculate a new vector or matrix by connecting column vectors or matrices with the same number of rows side by side.

HWTn(h) : 0≤h≤n에 대해서 {0,±1}n로부터 균등하게 벡터가 샘플링되는 분포, 여기서 h는 0이 아닌 원소의 개수HWT n (h): Distribution in which vectors are sampled evenly from {0,±1} n for 0≤h≤n, where h is the number of non-zero elements.

이하에서는 첨부된 도면을 이용하여 본 발명의 다양한 실시 예들에 대하여 구체적으로 설명한다. Hereinafter, various embodiments of the present invention will be described in detail using the attached drawings.

도 1은 본 개시의 적어도 하나의 실시 예에 따른 전자 장치들의 동작을 설명하기 위한 도면이다. 1 is a diagram for explaining the operation of electronic devices according to at least one embodiment of the present disclosure.

도 1에서는 두 개의 전자 장치(100, 200) 중 하나인 제1 전자 장치(100)가 공개 키를 전송하고, 다른 하나인 제2 전자 장치(200)가 그 공개 키를 이용하여 암호문을 생성한 후, 그 암호문을 제1 전자 장치(100)로 전송하는 경우를 도시하였다. 여기서 "제1" 및 "제2"라는 표현은 설명의 편의를 위하여 임의로 추가한 것으로, 제1 및 제2 전자 장치(100, 200)는 동종의 전자 장치로 구현될 수도 있고, 다른 종류의 전자 장치로 구현될 수도 있다. 예를 들어, 제1 및 제2 전자 장치(100, 200) 각각은 PC, 랩탑 PC, 서버 장치, 스마트폰, 태블릿 PC, 키오스크, 가전 제품 등 다양한 장치로 구현될 수 있다. 따라서, 전자 장치는 다르게는 사용자 단말 장치, 연산 장치, 데이터 처리 장치 등 다양하게 명명할 수 있다. In Figure 1, the first electronic device 100, one of the two electronic devices 100 and 200, transmits a public key, and the second electronic device 200, the other, generates an encrypted text using the public key. Afterwards, a case in which the encrypted text is transmitted to the first electronic device 100 is shown. Here, the expressions “first” and “second” are arbitrarily added for convenience of explanation, and the first and second electronic devices 100 and 200 may be implemented as the same type of electronic device, or may be implemented as different types of electronic devices. It may also be implemented as a device. For example, each of the first and second electronic devices 100 and 200 may be implemented as various devices such as a PC, laptop PC, server device, smartphone, tablet PC, kiosk, or home appliance. Accordingly, electronic devices can be called variously such as user terminal devices, computing devices, and data processing devices.

제1 전자 장치(100)는 암호화에 사용될 키를 에러를 이용하여 생성한다. 키에는 공개 키, 비밀키가 포함된다. 구체적으로는, 비밀키를 랜덤하게 설정하고, 그 비밀키 및 랜덤 값과, 에러를 이용하여 공개 키를 생성한다. 공개 키는 암호화에 사용되고, 비밀키는 암호화된 메시지를 복호하는 복호화에 사용될 수 있다. 미지의 값인 에러를 이용하여 공개 키를 생성하게 되면, 제3자가 메시지를 획득하여 반복적으로 분석하더라도 비밀 키를 파악하기 어렵게 된다. 따라서, 보안성이 더 높아질 수 있다.The first electronic device 100 generates a key to be used for encryption using an error. Keys include a public key and a private key. Specifically, a private key is randomly set, and a public key is generated using the private key, random value, and error. The public key can be used for encryption, and the private key can be used for decryption to decrypt the encrypted message. If a public key is generated using an error, which is an unknown value, it becomes difficult to determine the private key even if a third party obtains the message and repeatedly analyzes it. Therefore, security can be further increased.

제1 전자 장치(100)는 생성한 공개 키를 제2 전자 장치(200)로 전송한다. 제2 전자 장치(200)는 공개 키를 수신하여 저장한다. 공개 키에는 행렬 및 벡터가 포함되거나, 또는 행렬을 생성하기 위한 시드값(seed) 및 벡터가 포함될 수 있다. The first electronic device 100 transmits the generated public key to the second electronic device 200. The second electronic device 200 receives and stores the public key. The public key may include a matrix and a vector, or a seed and a vector for generating the matrix.

제2 전자 장치(200)는 제1 전자 장치(100)로 전송해야 할 데이터가 있으면, 제1 전자 장치(100)가 전송한 공개 키를 이용하여 해당 데이터를 암호화한다. 제2 전자 장치(200)는 라운딩 처리를 포함하는 암호화 방식으로 암호문을 생성할 수 있다. 이에 대해서는 후술하는 부분에서 다시 구체적으로 설명한다. If there is data to be transmitted to the first electronic device 100, the second electronic device 200 encrypts the data using the public key transmitted by the first electronic device 100. The second electronic device 200 may generate ciphertext using an encryption method including rounding processing. This will be explained in detail again in the later section.

제2 전자 장치(200)는 생성한 암호문을 제1 전자 장치(100)로 전송한다. 제1 전자 장치(100)는 암호문이 수신되면, 기 생성하여 저장한 비밀 키를 이용하여 암호문을 복호하여 데이터를 확보할 수 있다. The second electronic device 200 transmits the generated encrypted text to the first electronic device 100. When the first electronic device 100 receives the encrypted text, it can secure the data by decrypting the encrypted text using a previously generated and stored secret key.

도 1에서 제1 전자 장치(100)가 수행하는 공개 키 생성 방식은 MLWE(Module - Learning with Errors) 방식이라고 할 수 있고, 제1 전자 장치(200)가 수행하는 암호화 방식은 MLWR(Module-Learning with Rounding)이라 할 수 있다. MLWE 방식을 사용하게 되면, 종래의 기술에 비해서 훨씬 더 확장 가능한 방법으로 보안성 및 효율성을 미세하게 조정할 수 있게 된다. 특히, MLWE방식과 MLWR 방식을 조합함에 따라, 암호화 및 복호화의 효율성을 크게 증가시킬 수 있다. In FIG. 1, the public key generation method performed by the first electronic device 100 can be called the MLWE (Module-Learning with Errors) method, and the encryption method performed by the first electronic device 200 can be called the MLWR (Module-Learning) method. It can be said to be with Rounding. Using the MLWE method, security and efficiency can be fine-tuned in a much more scalable way compared to conventional technologies. In particular, by combining the MLWE method and the MLWR method, the efficiency of encryption and decryption can be greatly increased.

도 2는 본 개시의 적어도 일 실시 예에 따른 전자 장치(100)의 구성을 나타낸다. 도 2의 전자 장치(100)는 도 1의 제1 전자 장치가 될 수 있다. FIG. 2 shows the configuration of an electronic device 100 according to at least one embodiment of the present disclosure. The electronic device 100 of FIG. 2 may be the first electronic device of FIG. 1 .

도 2에 따르면, 전자 장치(100)는 메모리(110), 프로세서(120), 통신부(130)를 포함한다. According to FIG. 2 , the electronic device 100 includes a memory 110, a processor 120, and a communication unit 130.

메모리(110)는 전자 장치(100)의 동작에 필요한 각종 프로그램, 명령어, 및 데이터 등을 포함하기 위한 구성이다. 도 2에서 메모리(110)는 프로세서(120)와 별도인 것처럼 도시하였으나 반드시 이에 한정되는 것은 아니며, 메모리(110)는 프로세서(120)에 포함된 롬(ROM)(예를 들어, EEPROM(electrically erasable programmable read-only memory)), 램(RAM) 등의 내부 메모리로 구현될 수도 있다.The memory 110 is configured to include various programs, commands, and data necessary for the operation of the electronic device 100. In FIG. 2, the memory 110 is shown as separate from the processor 120, but is not necessarily limited to this, and the memory 110 is a ROM (e.g., an electrically erasable EEPROM (EEPROM) included in the processor 120. It can also be implemented with internal memory such as programmable read-only memory (RAM).

또는, 메모리(110)는 데이터 저장 용도에 따라 전자 장치(100)에 임베디드된 메모리 형태로 구현되거나, 전자 장치(100)에 탈부착이 가능한 메모리 형태로 구현될 수도 있다. 구체적으로, 메모리(110)는 휘발성 메모리, SRAM(static RAM), 또는 SDRAM(synchronous dynamic RAM) 등), 비휘발성 메모리(예: OTPROM(one time programmable ROM), PROM(programmable ROM), EPROM(erasable and programmable ROM), EEPROM(electrically erasable and programmable ROM), mask ROM, flash ROM, 플래시 메모리, 하드 드라이브, 또는 솔리드 스테이트 드라이브(solid state drive(SSD)), CF(compact flash), SD(secure digital), Micro-SD(micro secure digital), Mini-SD(mini secure digital), xD(extreme digital), MMC(multi-media card) 등) 등 다양한 형태로 구현될 수 있다. Alternatively, the memory 110 may be implemented as a memory embedded in the electronic device 100 or as a memory detachable from the electronic device 100 depending on the data storage purpose. Specifically, the memory 110 includes volatile memory, static RAM (SRAM), or synchronous dynamic RAM (SDRAM), etc.), non-volatile memory (e.g., one time programmable ROM (OTPROM), programmable ROM (PROM), and erasable memory (EPROM). and programmable ROM), electrically erasable and programmable ROM (EEPROM), mask ROM, flash ROM, flash memory, hard drive, or solid state drive (SSD), compact flash (CF), or secure digital (SD). , Micro-SD (micro secure digital), Mini-SD (mini secure digital), xD (extreme digital), MMC (multi-media card), etc.).

본 개시에서 메모리(110)라는 용어는 저장부, 프로세서(120) 내 롬(미도시), 램(미도시) 또는 전자 장치(100)에 장착되는 메모리 카드(미도시)(예를 들어, micro SD 카드, 메모리 스틱)를 포함하는 의미로 사용될 수 있다. 도 1에서 메모리(110)는 하나인 것처럼 도시하였으나, 메모리(110)는 다양한 개수로 구현될 수 있다.In the present disclosure, the term memory 110 refers to a storage unit, a ROM (not shown) within the processor 120, a RAM (not shown), or a memory card (not shown) mounted on the electronic device 100 (e.g., micro It can be used to include SD cards and memory sticks. In FIG. 1, the memory 110 is shown as one, but the memory 110 may be implemented in various numbers.

메모리(110)는 프로세서(120)에 의해 액세스된다. 메모리(110)에서는 프로세서(120)에 의한 데이터의 독취/기록/수정/삭제/갱신 등이 수행될 수 있다. Memory 110 is accessed by processor 120. In the memory 110, reading/writing/modifying/deleting/updating data can be performed by the processor 120.

구체적으로, 메모리(110)는 키 생성을 위한 각종 시드 값(seed)에 대한 정보나, 랜덤 값, 각종 함수 등에 대한 정보를 저장할 수 있다. 프로세서(120)에 의해 비밀 키, 공개 키 등이 생성되면, 프로세서(120)는 비밀 키 및 공개 키에 대한 정보를 메모리(110)에 저장해 둘 수도 있다. Specifically, the memory 110 may store information about various seed values for key generation, random values, and various functions. When a secret key, a public key, etc. are generated by the processor 120, the processor 120 may store information about the secret key and the public key in the memory 110.

프로세서(120)는 전자 장치(100)의 전반적인 동작을 제어하기 위한 구성이다. 프로세서(120)는 디지털 신호를 처리하는 디지털 시그널 프로세서, 마이크로 프로세서, 중앙처리장치(central processing unit(CPU)), MCU(Micro Controller Unit), MPU(micro processing unit), 컨트롤러(controller), 어플리케이션 프로세서, GPU(graphics-processing unit) 또는 커뮤니케이션 프로세서, ARM(advanced reduced instruction set computer (RISC) machines) 프로세서 중 하나 또는 그 이상을 포함하거나, 해당 용어로 정의될 수 있다. 또한, 프로세서(120)는 프로세싱 알고리즘이 내장된 SoC(System on Chip), LSI(large scale integration)로 구현될 수도 있고, FPGA(Field Programmable gate array) 형태로 구현될 수도 있다. 또한, 프로세서(120)는 메모리(110)에 저장된 컴퓨터 실행가능 명령어(computer executable instructions)를 실행함으로써 다양한 기능을 수행할 수 있다.The processor 120 is a component that controls the overall operation of the electronic device 100. The processor 120 is a digital signal processor, microprocessor, central processing unit (CPU), micro controller unit (MCU), micro processing unit (MPU), controller, and application processor that processes digital signals. , a graphics-processing unit (GPU), a communication processor, an advanced reduced instruction set computer (RISC) machine (ARM) processor, or may be defined in that term. Additionally, the processor 120 may be implemented as a System on Chip (SoC) or large scale integration (LSI) with a built-in processing algorithm, or may be implemented in the form of a Field Programmable Gate Array (FPGA). Additionally, the processor 120 may perform various functions by executing computer executable instructions stored in the memory 110.

프로세서(120)는 암호화에 사용되기 위한 각종 키를 생성할 수 있다. 구체적으로, 프로세서(120)는 비밀 키와 공개 키를 생성할 수 있다. 프로세서(120)는 생성된 비밀 키 및 공개 키를 메모리(110)에 저장할 수 있다. The processor 120 can generate various keys to be used for encryption. Specifically, processor 120 may generate a private key and a public key. Processor 120 may store the generated private key and public key in memory 110 .

프로세서(120)는 저장된 키를 이용하여 다양한 동작을 수행할 수 있다. The processor 120 can perform various operations using the stored keys.

일 예로, 프로세서(120)는 공개 키를 통신부(130)를 통해서 도 1의 제2 전자 장치(200)와 같은 각종 외부 장치로 전송할 수 있다. 제2 전자 장치(200)는 전송된 공개 키를 이용하여 암호문을 생성하여, 다시 전자 장치(100)로 전송할 수 있다. 프로세서(120)는 통신부(130)를 통해서 암호문이 수신되면, 메모리(110)에 저장된 비밀 키를 이용하여 암호문을 복호하고, 그 암호문 내의 데이터, 즉, 메시지를 추출할 수 있다. As an example, the processor 120 may transmit the public key to various external devices, such as the second electronic device 200 of FIG. 1, through the communication unit 130. The second electronic device 200 may generate an encrypted text using the transmitted public key and transmit it back to the electronic device 100. When the ciphertext is received through the communication unit 130, the processor 120 can decrypt the ciphertext using the secret key stored in the memory 110 and extract data, that is, a message, within the ciphertext.

또는, 프로세서(120)는 외부 장치로 전송할 메시지를 직접 통신부(130) 또는 기타 인터페이스(미도시)를 통해 입력받을 수도 있다. 인터페이스는 사용자가 키보드, 마우스, 조이스틱, 마이크, 카메라, USB 메모리, 전자장치 등 다양한 외부 장치와 연결 가능한 연결 포트를 포함할 수 있다. 또는, 인터페이스는 사용자가 직접 터치 가능한 터치 스크린이나 버튼, 터치 패드 등을 포함할 수도 있다. 프로세서(120)는 외부 장치로 전송할 메시지가 전자 장치(100)로 입력되면, 그 메시지를 공개 키를 이용하여 암호화한 후, 그 암호문을 외부 장치로 전송한다. 외부장치에서는 비밀 키를 보유하지 못하기 때문에, 암호문을 수신하더라도 암호문에 포함된 메시지를 확인할 수 없게 된다. 프로세서(120)는 외부장치에서 암호문에 대한 임의의 연산을 수행한 결과값이 통신부(130)를 통해 수신되면, 비밀 키를 적용하여 그 결과값을 복호화할 수 있다. 이에 따라, 원 메시지에 대한 연산 결과 값을 확인할 수 있다. Alternatively, the processor 120 may receive a message to be transmitted to an external device directly through the communication unit 130 or another interface (not shown). The interface may include a connection port through which the user can connect various external devices such as a keyboard, mouse, joystick, microphone, camera, USB memory, and electronic devices. Alternatively, the interface may include a touch screen, buttons, or touch pad that the user can directly touch. When a message to be transmitted to an external device is input to the electronic device 100, the processor 120 encrypts the message using a public key and then transmits the encrypted text to the external device. Since the external device cannot hold the secret key, the message contained in the ciphertext cannot be confirmed even if it receives the ciphertext. When the processor 120 receives the result of performing an arbitrary operation on the ciphertext from an external device through the communication unit 130, the processor 120 can decrypt the result by applying a secret key. Accordingly, the operation result value for the original message can be confirmed.

또는, 프로세서(120)는 외부 장치로 비밀 키를 전송하여 줄 수도 있다. 이후, 프로세서(120)는 해당 외부 장치로 전송할 데이터가 발생할 때마다, 공개 키를 이용하여 그 데이터를 암호화한 후, 외부 장치로 전송할 수 있다. 외부장치는 이전에 수신한 비밀 키를 이용하여 암호문을 복호하여, 데이터를 활용할 수 있다. Alternatively, the processor 120 may transmit the secret key to an external device. Thereafter, whenever data to be transmitted to the external device is generated, the processor 120 may encrypt the data using a public key and then transmit it to the external device. The external device can use the data by decrypting the ciphertext using the previously received secret key.

이상과 같이, 전자장치(100)의 프로세서(120)는 공개 키 및 비밀 키를 다양한 형태로 활용할 수 있다. As described above, the processor 120 of the electronic device 100 can utilize the public key and secret key in various forms.

공개 키 및 비밀 키 생성은 다양한 실시 예에 따라 수행될 수 있다. Public key and private key generation may be performed according to various embodiments.

일 예로, 프로세서(120)는, 암호화에 사용될 공개 키, 비밀 키를 에러를 이용하여 생성할 수 있다. As an example, the processor 120 may generate a public key and a secret key to be used for encryption using an error.

프로세서(120)는 비밀 키 생성을 위하여 메모리(110)에 저장된 각종 데이터를 이용할 수 있다. 프로세서(120)는 메모리(110)에 저장된 데이터에 기초하여, 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성한다. 일 예로, 프로세서(120)는 .-1, 0, 1 과 같은 기 설정된 수들을 랜덤하게 조합하여 비밀 키를 생성할 수 있다. 프로세서(120)는 생성한 비밀 키를 메모리(110)에 저장한다. The processor 120 may use various data stored in the memory 110 to generate a secret key. The processor 120 generates a secret key by randomly combining values within a preset range based on data stored in the memory 110. As an example, the processor 120 may generate a secret key by randomly combining preset numbers such as .-1, 0, and 1. The processor 120 stores the generated secret key in the memory 110.

또한, 프로세서(120)는 랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득할 수 있다. Additionally, the processor 120 may obtain a random matrix (A) composed of randomly determined vectors.

프로세서(120)는 이산가우시안 분포 또는 상기 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 에러를 획득한 후, 에러를 모듈러 연산한 값과, 비밀 키 및 상기 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득할 수 있다. The processor 120 obtains an error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution, and then obtains a random vector (b) based on a modular operation value of the error, a secret key, and the random matrix. can do.

프로세서(120)는 랜덤 행렬(A) 및 랜덤 벡터(b)를 포함하는 공개 키를 생성할 수 있다. 프로세서(120)는 생성한 공개 키를 메모리(110)에 저장한다. Processor 120 may generate a public key including a random matrix (A) and a random vector (b). The processor 120 stores the generated public key in the memory 110.

프로세서(120)는 랜덤 행렬, 에러, 비밀 키 획득을 위하여 시드값을 이용할 수 있다. 구체적으로, 프로세서(120)는 메모리(110)에 저장된 데이터 중에서 시드 값에 대해 확장 가능 출력 함수(extendable-output function, XOF)를 적용하여 제1 시드값, 제2 시드값, 제3 시드값을 획득할 수 있다. XOF 함수는 가변 길이의 해쉬 값들을 산출할 수 있는 해쉬 함수의 일 예이다. The processor 120 may use the seed value to obtain a random matrix, error, and secret key. Specifically, the processor 120 applies an extendable-output function (XOF) to the seed value among the data stored in the memory 110 to generate the first seed value, the second seed value, and the third seed value. It can be obtained. The XOF function is an example of a hash function that can produce hash values of variable length.

프로세서(120)는 획득한 시드값 중 제1 시드값에 랜덤 행렬 샘플러 함수를 적용하여 랜덤 행렬(A)를 획득할 수 있다. 또한, 프로세서(120)는 제2 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 에러 e를 획득하고, 제3 시드값에 해밍 웨이트 샘플러 함수를 적용하여, 해밍 웨이트 h를 가지는 비조밀(sparse) 벡터인 비밀 키 s를 획득할 수 있다.The processor 120 may obtain a random matrix (A) by applying a random matrix sampler function to a first seed value among the obtained seed values. Additionally, the processor 120 applies a discrete Gaussian sampler function to the second seed value to obtain an error e with a standard deviation σ, and applies a Hamming weight sampler function to the third seed value to obtain a ratio with a Hamming weight h. The secret key s, which is a sparse vector, can be obtained.

프로세서(120)의 단계별 동작을 수학식으로 표현하면 다음과 같다. The step-by-step operation of the processor 120 can be expressed in mathematical equations as follows.

1: seed ←{0, 1}256 1: seed ←{0, 1} 256

2: (seedA, seedsk seede) ← XOF(seed)2: (seed A , seed sk seed e ) ← XOF(seed)

3: A ← expandA(seedA) ∈ 3: A ← expandA(seed A ) ∈

4 : s ← HWThs(seedsk) ∈ 4: s ← HWT hs (seed sk ) ∈

5 : e ← dGaussianσ(seede) ∈ 5: e ← dGaussian σ (seed e ) ∈

6 : b = -AT·s + e ∈ 6: b = -A T ·s + e ∈

7 : pk = (seedA, b), sk=s7: pk = (seed A , b), sk=s

이상에서 제1 내지 제7 단계의 순서는 임의로 정한 것이며, 이 중 일부 단계의 순서는 변경될 수 있고, 일부 단계는 병렬적으로 진행될 수도 있다. In the above, the order of the first to seventh steps is arbitrarily determined, and the order of some of these steps may be changed, and some steps may be performed in parallel.

프로세서(120)는 0 또는 1의 조합으로 구성된 데이터 세트들 중에서 시드값 seed를 추출할 수 있다. 프로세서(120)는 추출된 시드값 seed을 XOF 함수의 입력 값으로 사용하여 제 1 내지 제3 시드값(seedA, seedsk seede)을 각각 추출한다. 이와 같은 XOF 함수의 처리는 해쉬 함수 처리라고 지칭될 수도 있다. 또한, 반드시 XOF에 한정되는 것이 아니라, 이 밖에 다양한 해쉬 함수 처리 기법이 이용될 수도 있다. 그리고, 상술한 제 1 내지 제3 시드값(seedA, seedsk seede)은 앞선 시드값(seed)과 구분하기 위하여, 비트 분기열로 지칭될 수도 있다. The processor 120 may extract a seed value from data sets composed of a combination of 0 or 1. The processor 120 uses the extracted seed value seed as an input value of the XOF function to extract first to third seed values (seed A , seed sk seed e ), respectively. Processing of this XOF function may also be referred to as hash function processing. In addition, it is not necessarily limited to XOF, and various other hash function processing techniques may be used. In addition, the above-described first to third seed values (seed A , seed sk seed e ) may be referred to as a bit branch sequence to distinguish them from previous seed values.

프로세서(120)는 제1 시드값(seedA)을 균등 랜덤 행렬 샘플러 함수인 expandA 함수의 입력 값으로 사용하여, 행렬 A를 획득한다. 행렬 A는 각 행렬 원소가 계수가 모듈러스 q인 n차 다항식으로 구성된 행렬 에 속하며, 행과 열의 개수가 각각 k인 랜덤 행렬이 될 수 있다. The processor 120 uses the first seed value (seed A ) as an input value of the expandA function, which is a uniform random matrix sampler function, to obtain matrix A. Matrix A is a matrix where each matrix element is an nth-order polynomial whose coefficient is modulus q. It belongs to and can be a random matrix with k rows and k columns.

여기서 R은 링으로, 링(Ring)이란 기설정된 계수를 가지는 다항식의 집합으로, 원소들 사이에 덧셈 및 곱셈이 정의되어 있으며, 덧셈과 곱셈에 대해서 닫혀 있는 집합을 의미한다. 그리고, 상술한 는 MLWE 및 MLWR 에서의 격자 구조를 가질 수 있다. 여기서 격자 구조는 유클리디안 격자(Euclidean lattices) 구조일 수 있다. Here, R stands for a ring, and a ring is a set of polynomials with preset coefficients, in which addition and multiplication are defined between elements, and means a set that is closed for addition and multiplication. And, as described above may have a grid structure in MLWE and MLWR. Here, the lattice structure may be a Euclidean lattices structure.

프로세서(120)는 제2 시드값(seedsk)을 해밍 웨이트 샘플러 함수 HWThs의 입력값으로 사용하여, 비밀 키 s를 획득한다. 비밀 키 s는 계수가 -1, 0, 1인 다항식으로 구성되는 길이 k 짜리 벡터가 될 수 있다. 비밀 키 s를 구성하는 다항식의 계수들 중에서 0이 아닌 값, 즉, -1과 1의 개수를 합한 값은 해밍 웨이트(hamming weight) h가 될 수 있다. 비밀 키는 비조밀(sparse) 벡터가 될 수 있다. 공개 키 생성을 위하여 에러를 사용하는 경우, 에러의 크기가 너무 크면 암호화 및 복호화 처리에 어려움이 있으므로, 해밍 웨이트를 적용하여 에러의 크기를 제한할 수 있다. 해밍 웨이트 h는 다양한 범위 내에서 설정될 수 있다. 예를 들어, 해밍 웨이트 h는 150 ~ 300 내의 범위 내의 임의의 값(예를 들어, 190)으로 설정될 수 있다. The processor 120 uses the second seed value (seed sk ) as an input value of the Hamming weight sampler function HWT hs to obtain the secret key s. The secret key s can be a vector of length k consisting of a polynomial with coefficients of -1, 0, and 1. Among the coefficients of the polynomial constituting the secret key s, a non-zero value, that is, the sum of -1 and 1, can be the Hamming weight h. The secret key can be a sparse vector. When using an error to generate a public key, if the size of the error is too large, encryption and decryption processing are difficult, so the size of the error can be limited by applying a Hamming weight. Hamming weight h can be set within various ranges. For example, the Hamming weight h may be set to any value within the range of 150 to 300 (eg, 190).

프로세서(120)는 제3 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 에러 e를 획득할 수 있다. 에러 e는 이산 가우시안 분포 또는 그와 통계적 거리가 가까운 근사 이산 가우시안 분포로부터 산출될 수 있다. 에러 e를 획득하기 위한 이산 가우시안 샘플러 함수는 다양한 비트 연산자로 구성되어 출력과 상관없이 러닝 타임이 일정한 상수시간 알고리즘으로 구현될 수 있다. 에러 e의 표준 편차 σ는 다양한 값으로 설정될 수 있다. 예를 들어, σ는 0.5 내지 2의 범위 내에서 임의의 값으로 설정될 수 있으나, 이에 한정되는 것은 아니다. The processor 120 may obtain an error e having a standard deviation σ by applying a discrete Gaussian sampler function to the third seed value. The error e can be calculated from a discrete Gaussian distribution or an approximate discrete Gaussian distribution with a statistical distance close to it. The discrete Gaussian sampler function for obtaining the error e is composed of various bit operators and can be implemented as a constant-time algorithm whose running time is constant regardless of the output. The standard deviation σ of error e can be set to various values. For example, σ may be set to an arbitrary value within the range of 0.5 to 2, but is not limited thereto.

랜덤 행렬(A), 비밀 키(s), 에러(e)가 각각 획득되면, 프로세서(120)는 이들을 이용하여 랜덤 벡터 b를 산출한다. 상술한 제6 단계에서, 랜덤 벡터 b는 랜덤 행렬 A의 행과 열을 바꾼 전치 행렬 AT에 비밀 키 s를 승산하고, 에러 e를 가산하여 랜덤 벡터 b를 산출하는 것으로 도시하였으나, 프로세서(120)는 에러 e를 모듈러 연산한 후 가산할 수도 있다. 즉, 에러 e를 산출하기 위한 수학식은 다음과 같이 변형될 수 있다. When the random matrix (A), secret key (s), and error (e) are respectively obtained, the processor 120 uses them to calculate the random vector b. In the above-described sixth step, the random vector b is shown as calculating the random vector b by multiplying the transpose matrix A T in which the rows and columns of the random matrix A are changed by the secret key s and adding the error e. However, the processor (120 ) can also be added after performing a modular operation on the error e. In other words, the equation for calculating error e can be modified as follows.

[수학식 1][Equation 1]

b = -AT·s + e mod qb = -A T ·s + e mod q

프로세서(120)는 에러 edp 대해 모듈러스 q를 가지는 모듈러 연산을 수행한값과, 비밀 키 및 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득할 수 있다. The processor 120 may obtain a random vector (b) based on a value obtained by performing a modular operation with a modulus q for the error edp, a secret key, and a random matrix.

프로세서(120)는 랜덤 행렬 A 및 랜덤 벡터 b를 포함하는 공개 키를 생성하여, 메모리(110)에 저장하고, 통신부(130)를 통해 암호화를 수행할 외부 장치로 전송할 수 있다. The processor 120 may generate a public key including the random matrix A and the random vector b, store it in the memory 110, and transmit it to an external device to perform encryption through the communication unit 130.

다른 실시 예에 따르면, 프로세서(120)는 랜덤 행렬 A를 직접 공개 키에 포함시켜 전송하는 대신에, 랜덤 행렬 A 를 생성할 수 있는 시드값, 즉, 제1 시드값 SeedA를 랜덤 벡터 b와 함께 공개 키 pk에 포함시켜 전송할 수도 있다. 이 경우, 전송에 소요되는 소스 용량이 절감될 수 있다. According to another embodiment, instead of transmitting the random matrix A by directly including it in the public key, the processor 120 combines a seed value capable of generating the random matrix A, that is, the first seed value Seed A , with the random vector b It can also be transmitted by including it in the public key pk. In this case, the source capacity required for transmission can be reduced.

통신부(130)는 프로세서(120)의 제어에 따라 도 1의 제2 전자 장치(200)를 비롯한 다양한 외부 장치와 통신을 수행하기 위한 구성이다. 통신부(130)는 프로세서(120)에서 생성한 공개 키를 제2 전자 장치(200)로 전송하고, 제2 전자 장치(200)에서 생성한 암호문을 수신할 수도 있다. The communication unit 130 is configured to communicate with various external devices, including the second electronic device 200 of FIG. 1, under the control of the processor 120. The communication unit 130 may transmit the public key generated by the processor 120 to the second electronic device 200 and receive the encrypted text generated by the second electronic device 200.

통신부(130)는 적어도 하나의 무선 통신 모듈, 적어도 하나의 유선 통신 모듈 등을 포함할 수 있다. 각 통신 모듈은 적어도 하나의 하드웨어 칩 형태로 구현될 수 있다. 무선 통신 모듈은 와이파이 모듈, 블루투스 모듈, 적외선 통신 모듈 또는 기타 통신 모듈 중 적어도 하나의 모듈을 포함할 수 있다. 이 밖에, 통신 인터페이스는 지그비(zigbee), 3G(3rd Generation), 3GPP(3rd Generation Partnership Project), LTE(Long Term Evolution), LTE-A(LTE Advanced), 4G(4th Generation), 5G(5th Generation)등과 같은 다양한 무선 통신 규격에 따라 통신을 수행하는 적어도 하나의 통신 칩을 포함할 수 있다. 유선 통신 모듈은 예를 들어, LAN(Local Area Network) 모듈, 이더넷 모듈, 페어 케이블, 동축 케이블, 광섬유 케이블 또는 UWB(Ultra Wide-Band) 모듈 중 적어도 하나를 포함할 수 있다. The communication unit 130 may include at least one wireless communication module, at least one wired communication module, etc. Each communication module may be implemented in the form of at least one hardware chip. The wireless communication module may include at least one of a Wi-Fi module, a Bluetooth module, an infrared communication module, or other communication modules. In addition, communication interfaces include zigbee, 3G (3rd Generation), 3GPP (3rd Generation Partnership Project), LTE (Long Term Evolution), LTE-A (LTE Advanced), 4G (4th Generation), and 5G (5th Generation). ) may include at least one communication chip that performs communication according to various wireless communication standards such as ). The wired communication module may include, for example, at least one of a Local Area Network (LAN) module, an Ethernet module, a pair cable, a coaxial cable, an optical fiber cable, or an Ultra Wide-Band (UWB) module.

프로세서(120)는 공개 키를 전송 한 이후, 외부로부터 그 공개 키로 암호화한 암호문이 전송되어 통신부(130)를 통해 수신되면, 메모리(110)에 저장된 비밀 키를 이용하여 암호문을 복호한다. After transmitting the public key, when the ciphertext encrypted with the public key is transmitted from the outside and received through the communication unit 130, the processor 120 decrypts the ciphertext using the secret key stored in the memory 110.

구체적으로, 외부 장치로부터 수신되는 암호문은, 외부 장치에서 자체적으로 획득한 랜덤 벡터 r과 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 랜덤 벡터 b와 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함할 수 있다. Specifically, the ciphertext received from the external device is the first value (c1) obtained by rounding the result of the calculation based on the random vector r and the random matrix A obtained by the external device itself, the random vector b, and the random vector r. It may include a second value (c2) obtained by rounding the result calculated based on .

라운딩 처리란 암호문을 더 작은 모듈러스 영역으로 보내기 위한 처리를 의미한다. 구체적으로는, 벡터의 라운딩 처리란, 실수 연산으로 p/q를 구한 후, 그 결과인 벡터의 각 성분(실수)에 대해 가장 가까운 정수 값을 대응시키는 처리를 의미한다. p와 q가 2의 멱승으로 설정된 경우에는, 라운딩 처리에 의해서 메시지 내에서 최하위 비트가 일정 개수 제거된다. 이러한 방식으로 라운딩 처리가 이루어지게 되면, 제3자가 암호문을 획득하더라도 복호화하는데 어려워지므로, 보안성이 향상될 수 있다.Rounding processing refers to processing to send the ciphertext to a smaller modulus area. Specifically, the rounding process of a vector means the process of calculating p/q through real number operations and then matching the nearest integer value to each component (real number) of the resulting vector. When p and q are set to powers of 2, a certain number of least significant bits are removed from the message by rounding. If the rounding process is performed in this way, it becomes difficult for a third party to decrypt the ciphertext even if he or she obtains it, so security can be improved.

프로세서(120)는 다음과 같은 수학식을 이용하여 복호화를 수행할 수 있다.The processor 120 can perform decryption using the following equation.

[수학식 2][Equation 2]

수학식 2에서 μ'는 복호된 메시지를 나타낸다. t, q, p, p'등은 t | p' | p | q 관계를 만족하는 모듈러스 들을 나타낸다. 즉, 이러한 모듈러스들은 t 가 p'을 나누고, p'이 p를 나누고, p가 q를 나눌 수 있는 관계를 가지는 정수 값이 될 수 있다. 특히, 이런 관계를 가지는 2의 거듭제곱 수들로 설정될 수 있다. 암호문의 일부 성분들의 경우 최대 p'개의 값만을 가지도록 제한할 수 있다. 수학식 2에서는 라운딩 함수 처리를 수행하여 μ'를 연산하는 것까지 기재되어 있으나, 구현 예에 따라서는 라운딩 함수 처리 이후에 모듈러스 연산을 추가적으로 수행할 수도 있다. In Equation 2, μ' represents the decrypted message. t, q, p, p', etc. are t | p' | p | Represents moduli that satisfy the q relationship. In other words, these moduli can be integer values that have a relationship such that t divides p', p' divides p, and p divides q. In particular, it can be set to powers of 2 numbers that have this relationship. Some components of the ciphertext can be limited to have a maximum of p' values. In Equation 2, it is described that μ' is calculated by performing rounding function processing, but depending on the implementation example, modulus calculation may be additionally performed after rounding function processing.

이상에서는 공개 키 및 비밀 키의 생성 방법과, 복호화 방법에 대하여 구체적으로 설명하였다. 상술한 바와 같이 공개 키를 가지고 있는 장치는 그 공개 키를 이용하여 암호화를 수행할 수 있다. 도 1의 예에서 제2 전자 장치(200)가 제1 전자 장치(100)에서 생성한 공개 키를 수신한다면, 제2 전자 장치(200)는 수신된 공개 키를 이용하여 암호화를 수행할 수 있다. 이하에서는, 제2 전자 장치(200)의 구체적인 구성을 이용하여, 암호화 방법에 대하여 설명한다.In the above, the method of generating the public key and private key and the decryption method were described in detail. As described above, a device that has a public key can perform encryption using the public key. In the example of FIG. 1, if the second electronic device 200 receives the public key generated by the first electronic device 100, the second electronic device 200 may perform encryption using the received public key. . Below, the encryption method will be described using the specific configuration of the second electronic device 200.

도 3은 암호화를 수행하는 전자 장치의 구성을 나타내는 블럭도이다. 도 1에서 설명한 제2 전자 장치는 도 3의 구성으로 구현될 수 있는 바, 설명의 편의를 위하여, 도 3의 설명에서는 제2 전자 장치를 전자 장치(200)으로 기재한다. Figure 3 is a block diagram showing the configuration of an electronic device that performs encryption. The second electronic device described in FIG. 1 may be implemented with the configuration shown in FIG. 3 . For convenience of explanation, the second electronic device is described as the electronic device 200 in the description of FIG. 3 .

전자 장치(200)는 메모리(210), 프로세서(220), 통신부(230), 인터페이스(240)를 포함한다. 메모리(210), 프로세서(220), 통신부(230)의 구체적인 동작 및 예시 중에서 도 2에 대한 설명에서 기재한 부분과 중복되는 부분은 그 기재를 생략한다. The electronic device 200 includes a memory 210, a processor 220, a communication unit 230, and an interface 240. Among the specific operations and examples of the memory 210, the processor 220, and the communication unit 230, descriptions of parts that overlap with those described in the description of FIG. 2 are omitted.

인터페이스(240)는 외부 장치로 전송할 데이터를 입력 받기 위한 구성이다. 구체적으로, 인터페이스(240)는 전자 장치(200)의 본체에 구비된 각종 버튼, 터치 스크린 등과 같은 조작 인터페이스나, 각종 외부 신호를 입출력 받기 위한 입출력 인터페이스를 포함할 수 있다. 입출력 인터페이스는 각종 외부 메모리나 외부 소스(예를 들어, 웹 서버, 사용자 단말 장치 등), 각종 입력 장치(예를 들어, 키보드, 마우스, 마이크, 카메라, 조이스틱 등)과 연결되어, 각종 데이터를 입력받을 수 있다. 입출력 인터페이스는 HDMI(High Definition Multimedia Interface), MHL (Mobile High- Definition Link), USB (Universal Serial Bus), USB C-type, DP(Display Port), 썬더볼트 (Thunderbolt), VGA(Video Graphics Array)포트, RGB 포트, D-SUB(Dsubminiature) 및 DVI(Digital Visual Interface) 중 적어도 하나 이상의 인터페이스로 구현될 수 있다. 인터페이스(240) 중 적어도 일부는 통신부(230)에 포함될 수도 있다. 예를 들어, 인터페이스(240)는 외부 기기와 연결되어 유선으로 통신을 수행하는 유선 통신 인터페이스로 구현될 수도 있다. The interface 240 is configured to receive input data to be transmitted to an external device. Specifically, the interface 240 may include a manipulation interface such as various buttons and a touch screen provided on the main body of the electronic device 200, or an input/output interface for inputting and outputting various external signals. The input/output interface is connected to various external memories, external sources (e.g., web servers, user terminal devices, etc.), and various input devices (e.g., keyboard, mouse, microphone, camera, joystick, etc.) to input various data. You can receive it. Input/output interfaces include HDMI (High Definition Multimedia Interface), MHL (Mobile High-Definition Link), USB (Universal Serial Bus), USB C-type, DP (Display Port), Thunderbolt, and VGA (Video Graphics Array). It may be implemented as at least one interface among a port, RGB port, D-SUB (Dsubminiature), and DVI (Digital Visual Interface). At least some of the interfaces 240 may be included in the communication unit 230. For example, the interface 240 may be implemented as a wired communication interface that is connected to an external device and performs wired communication.

프로세서(220)는 인터페이스(240) 또는 통신부(230)을 통해서, 외부 장치로 전송할 데이터를 입력 또는 수신할 수 있다. 외부 장치로 전송할 데이터에는 텍스트 메시지, 사진, 음성 데이터, 비디오 데이터, 프로그램 등 다양한 정보가 포함될 수 있다. The processor 220 may input or receive data to be transmitted to an external device through the interface 240 or the communication unit 230. Data to be transmitted to an external device may include various information such as text messages, photos, voice data, video data, and programs.

메모리(210)는 인터페이스(240) 또는 통신부(230)를 통해 입력 또는 수신되는 각종 데이터를 저장하기 위한 구성이다. 메모리(210)에는 데이터 이외에도 암호화에 필요한 각종 함수나 소프트웨어, 데이터 등이 더 저장되어 있을 수 있다. The memory 210 is configured to store various data input or received through the interface 240 or the communication unit 230. In addition to data, the memory 210 may further store various functions, software, and data necessary for encryption.

프로세서(220)는 외부 장치, 예를 들어, 도 1의 제1 전자 장치(100)에서 생성한 공개 키에 대한 정보가 통신부(230)를 통해 수신되면, 그 공개 키를 메모리(210)에 저장할 수 있다. When information about the public key generated by an external device, for example, the first electronic device 100 of FIG. 1 is received through the communication unit 230, the processor 220 stores the public key in the memory 210. You can.

프로세서(220)는 제1 전자 장치(100)로 전송해야 할 데이터가 존재하면, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득한다. 또한, 프로세서(220)는 메모리(210)에 저장된 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득한다. If there is data to be transmitted to the first electronic device 100, the processor 220 obtains a random vector r that randomly extracts values within a preset range. Additionally, the processor 220 obtains the random matrix A and the random vector b from the public key stored in the memory 210.

프로세서(220)는 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 랜덤 벡터 b, 랜덤 벡터 r 및 전송할 데이터에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득한다. 프로세서(220)는 획득한 제1 값 및 제2 값을 포함하는 암호문을 통신부(230)를 통해 외부 장치, 즉, 제1 전자 장치(100)로 전송한다.The processor 220 generates a first value (c1) obtained by rounding the result of the operation based on the random matrix A, and a second value obtained by rounding the result of the operation based on the random vector b, the random vector r, and the data to be transmitted. Obtain (c2) respectively. The processor 220 transmits the ciphertext including the obtained first and second values to an external device, that is, the first electronic device 100, through the communication unit 230.

암호화를 수행하는 프로세서(220)의 단계별 동작을 수학식으로 표현하면 다음과 같다. The step-by-step operation of the processor 220 that performs encryption is expressed in mathematical equations as follows.

1 : A = expandA(seedA) 1 : A = expandA(seed A )

2 : if seedr is not given then seedr ← {0, 1}256 2: if seed r is not given then seed r ← {0, 1} 256

3 : r ← HWThr(seedr) ∈ 3: r ← HWT hr (seed r ) ∈

4 : 4 :

5 : 5:

6 : ct=(c1, c2)6: ct=(c 1 , c 2 )

제1 전자 장치(100)로부터 제공된 공개 키에 랜덤 벡터 A가 포함되어 있다면, 프로세서(220)는 제1 단계는 생략할 수 있다. 반면, 공개 키에 랜덤 벡터 A가 아니라 시드값 seedA이 포함되어 있으면, 프로세서(220)는 그 시드값에 랜덤 행렬 샘플러 함수 expandA를 적용하여 랜덤 행렬 A를 획득할 수 있다. If the public key provided from the first electronic device 100 includes the random vector A, the processor 220 may skip the first step. On the other hand, if the public key includes a seed value seed A rather than a random vector A, the processor 220 can obtain the random matrix A by applying the random matrix sampler function expandA to the seed value.

제3 단계에서, 프로세서(220)는 메모리(210)에 저장된 시드값 seedr에 해밍 웨이트 샘플러 함수 HWThr를 적용하여 랜덤 벡터 r을 획득할 수 있다. 만약, 시드값 seedr이 메모리(210)에 저장되어 있지 않다면, 프로세서(220)는 제2 단계를 수행하여, 0 또는 1의 조합으로 구성된 데이터 세트들 중에서 시드값 seedr을 추출할 수 있다. In the third step, the processor 220 may obtain a random vector r by applying the Hamming weight sampler function HWT hr to the seed value seed r stored in the memory 210. If the seed value seed r is not stored in the memory 210, the processor 220 may perform the second step to extract the seed value seed r from data sets composed of a combination of 0 or 1.

프로세서(220)는 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b가 획득되고, 랜덤 벡터 r이 획득되면, 제 4 및 제 5 단계의 수학식에 기초하여 제1 값 c1, 제2 값 c2을 각각 획득한다. 제 4 및 제 5 단계의 수학식에서는 c1, c2가 각각 라운딩 함수 처리에 의해 최종적으로 획득되는 것으로 기재하였으나, 구현 예에 따라서 라운딩 함수 처리 이후에 모듈러스 연산을 추가적으로 수행할 수도 있다. 예를 들어, c1 에 대해서는 mod p 연산을 추가적으로 수행할 수 있고, c2 에 대해서는 mod p' 연산을 추가적으로 수행할 수 있다. 이 밖에, 본 개시에서 설명한 다른 수학식들 중 적어도 일부에서도 구현에 따라서 모듈러스 연산이 추가적으로 수행될 수 있다. The processor 220 obtains a random matrix A and a random vector b from the public key, and when the random vector r is obtained, the first value c 1 and the second value c 2 are obtained based on the equations of the fourth and fifth steps. Obtain each. In the equations of the fourth and fifth steps, c 1 and c 2 are each described as being finally obtained through rounding function processing. However, depending on the implementation, modulus calculation may be additionally performed after rounding function processing. For example, the mod p operation can be additionally performed for c 1 , and the mod p' operation can be additionally performed for c 2 . In addition, modulus calculation may be additionally performed in at least some of the other equations described in this disclosure, depending on implementation.

제 5단계의 수학식에서 μ는 제1 전자 장치(100)로 전송할 데이터, 즉, 메시지가 될 수 있다. 제1 값 c1은 길이 k 짜리 벡터가 될 수 있고, 제2 값 c2는 하나의 다항식이 될 수 있다. In the equation of step 5, μ may be data to be transmitted to the first electronic device 100, that is, a message. The first value c 1 can be a vector with length k, and the second value c 2 can be a polynomial.

프로세서(220)는 제1 값 c1, 제2 값 c2를 포함하는 암호문을 구성하여, 통신부(230)를 통해 외부 장치, 예를 들어, 제1 전자 장치(100)로 전송한다. 상술한 바와 같이 제1 전자 장치(100)의 프로세서(120)는 비밀 키를 이용하여 암호문을 복호화할 수 있다. The processor 220 constructs an ciphertext including the first value c 1 and the second value c 2 and transmits it to an external device, for example, the first electronic device 100, through the communication unit 230. As described above, the processor 120 of the first electronic device 100 can decrypt the ciphertext using the secret key.

도 4는 본 개시의 적어도 하나의 실시 예에 따른 전자 장치의 제어 방법을 설명하기 위한 흐름도이다. 도 4에 따르면, 전자 장치는 기 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성한다(S410). 여기서, 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응된다. FIG. 4 is a flowchart illustrating a method of controlling an electronic device according to at least one embodiment of the present disclosure. According to FIG. 4, the electronic device generates a secret key by randomly combining values within a preset range based on pre-stored data (S410). Here, the sum of the remaining values excluding 0 among the values within the preset range corresponds to the Hamming weight.

전자 장치는 비밀 키 및 에러를 이용하여 공개 키를 생성할 수 있다(S420).The electronic device can generate a public key using the secret key and error (S420).

구체적으로, 전자 장치는, 랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득하는 단계, 이산가우시안 분포 또는 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 에러를 획득하는 단계, 에러를 모듈러 연산한 값과, 비밀 키 및 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득하는 단계, 랜덤 행렬(A) 또는 랜덤 행렬(A) 획득에 사용되는 시드값과 랜덤 벡터(b)를 포함하는, 공개 키를 생성하는 단계를 순차적으로 수행할 수 있다. Specifically, the electronic device includes the steps of acquiring a random matrix (A) composed of randomly determined vectors, obtaining an error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution, and performing a modular operation on the error. Obtaining a random vector (b) based on a value, a secret key and a random matrix, a random matrix (A) or a public key comprising a seed value and a random vector (b) used to obtain the random matrix (A) The steps to create can be performed sequentially.

전자 장치는 생성한 비밀 키 및 공개 키를 저장하고(S430), 그 중 공개 키를 외부 장치로 전송할 수 있다(S440). The electronic device stores the generated secret key and public key (S430), and transmits the public key to an external device (S440).

전자 장치는, 이후에, 외부 장치로부터 공개 키에 기초하여 암호화한 암호문을 수신되면, 비밀 키를 이용하여 암호문을 복호할 수 있다. 구체적으로, 암호문은 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r과 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 랜덤 벡터 b와 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함할 수 있다. Later, when the electronic device receives the ciphertext encrypted based on the public key from an external device, it can decrypt the ciphertext using the secret key. Specifically, the ciphertext is calculated based on the first value (c1), the random vector b, and the random vector r obtained by rounding the result of the calculation based on the random vector r and the random matrix A, which are randomly extracted values within a preset range. It may include a second value (c2) obtained by rounding one result value.

전자 장치는, 수신된 암호문 중 제1 값 및 비밀 키를 연산한 결과값 및 제2 값에 각각 모듈러스 연산을 수행한 후, 가산하는 방식으로 데이터를 복호할 수 있다. 비밀 키 생성, 공개 키 생성, 복호화 등의 구체적인 수행 방법에 대해서는 상술한 부분에서 구체적으로 설명한 바 있으므로 중복 설명은 생략한다. The electronic device may decrypt the data by performing a modulus operation on the first value and the result of calculating the secret key and the second value among the received ciphertext, respectively, and then adding them. Since the specific performance methods such as secret key generation, public key generation, and decryption have been described in detail in the above section, redundant explanations will be omitted.

도 4의 제어 방법은, 상술한 도 1 및 도 2에서 설명한 제1 전자 장치에 의해 수행될 수 있으나 반드시 이에 한정되는 것은 아니며, 이 밖에 다양한 구성을 가지는 전자 장치에 의해 수행될 수도 있다. The control method of FIG. 4 may be performed by the first electronic device described in FIGS. 1 and 2 above, but is not necessarily limited thereto, and may also be performed by electronic devices having various other configurations.

도 5는 도 4의 방법으로 생성한 공개 키를 이용하여 암호화를 수행하는 방법을 설명하기 위한 흐름도이다. FIG. 5 is a flowchart illustrating a method of performing encryption using a public key generated by the method of FIG. 4.

도 5에 따르면, 전자 장치는 외부 장치에서 생성한 공개 키가 수신되면, 이를 저장한다(S510). 공개 키는 외부 장치에서 에러를 이용하여 생성한 키가 될 수 있다. According to FIG. 5, when a public key generated by an external device is received, the electronic device stores it (S510). The public key may be a key generated using an error in an external device.

전자 장치는 공개 키를 제공한 외부 장치로 전송할 데이터가 획득되면(S520), 공개 키를 이용하여 데이터를 암호화하여 암호문을 생성한다(S530). 구체적으로, 전자 장치는, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하는 단계, 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계, 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 랜덤 벡터 b 및 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하는 단계, 제1 값 및 제2 값을 포함하는 암호문을 생성하는 단계를 순차적으로 수행할 수 있다. 랜덤 행렬 A가 암호문에 포함되어 있지 않은 경우에는, 전자 장치는 암호문에 포함된 시드값으로부터 랜덤 행렬 A를 직접 획득할 수도 있다. When data to be transmitted to an external device that has provided a public key is obtained (S520), the electronic device encrypts the data using the public key to generate ciphertext (S530). Specifically, the electronic device includes the steps of obtaining a random vector r that randomly extracts values within a preset range, obtaining a random matrix A and a random vector b from a public key, and calculating a result value based on the random matrix A. Obtaining a rounded first value (c1) and a second value (c2) obtained by rounding a result calculated based on a random vector b and a random vector r, respectively, comprising the first value and the second value. The steps for generating the ciphertext can be performed sequentially. If the random matrix A is not included in the ciphertext, the electronic device may directly obtain the random matrix A from the seed value included in the ciphertext.

도 5의 암호화 방법은 상술한 도 1 및 도 3에서 설명한 제2 전자 장치(200)에 의해 수행될 수 있으나, 반드시 이에 한정되는 것은 아니며, 이와 다른 구성을 가지는 전자 장치에 의해 수행될 수도 있다. 구체적인 암호화 수식 및 알고리즘에 대해서는 상술한 부분에서 구체적으로 설명한 바 있으므로 중복 설명은 생략한다. The encryption method of FIG. 5 may be performed by the second electronic device 200 described in FIGS. 1 and 3, but is not necessarily limited thereto, and may be performed by an electronic device having a different configuration. Since specific encryption formulas and algorithms have been described in detail in the above section, redundant explanations will be omitted.

도 6은 상술한 다양한 실시 예들에서 설명한 해밍 웨이트 샘플러 함수를 이용하여 해밍 웨이트 h를 가지는 터너리 폴리노미얼 벡터(ternary polynomial vector)를 샘플링하는 알고리즘을 나타낸다. Figure 6 shows an algorithm for sampling a ternary polynomial vector with a Hamming weight h using the Hamming weight sampler function described in the various embodiments described above.

해밍 웨이트 샘플러 함수(HWTh)는, 1 과 -1의 개수의 합이 해밍 웨이트 h개로 고정된 k*256 짜리 벡터(또는, 1과 -1을 계수로 가지는 k개의 255차 다항식)을 뽑기 위한 알고리즘이 될 수 있다. The Hamming weight sampler function (HWT h ) is used to extract k*256 vectors (or k 255th degree polynomials with 1 and -1 as coefficients) where the sum of 1 and -1 is fixed to h Hamming weights. It could be an algorithm.

도 6에 따르면, 해밍 웨이트 샘플러 함수를 이용하여 샘플링하는 과정은 다음과 같이 요약될 수 있다. According to FIG. 6, the sampling process using the Hamming weight sampler function can be summarized as follows.

구체적으로는, 256 비트열 시드를 추출하고, 추출된 시드로부터 버퍼값(buf : 1 또는 -1이 위치할 위치(즉, 차수 degree)를 결정하는 값)와 랜덤값(rand: 1 인지 -1인지를 결정해주는 값)을 샘플링한다. Specifically, a 256-bit string seed is extracted, and a buffer value (buf: a value that determines the position (i.e., degree) where 1 or -1 will be located) and a random value (rand: 1 or -1) are extracted from the extracted seed. Sample the value that determines perception.

다음으로, 총 h개의 0이 아닌 위치(즉, 1 또는 -1)(차수)와 값 (1 인지 -1인지)을 순차적으로 결정한 후, 버퍼값을 이용하여 1 또는 -1이 위치할 위치 (차수 degree)를 결정한다. Next, after sequentially determining a total of h non-zero positions (i.e., 1 or -1) (order) and values (whether 1 or -1), use the buffer value to determine the position where 1 or -1 will be located ( Determine the degree.

구체적으로, 버퍼값 buf가 32*h 길이의 배열이고 idx번째 값인 buf[idx]는 32 길이의 비트열 (0~2^32-1)이면, buf[idx]에 (i+1)을 곱하고 2^32로 나눠 내림하는 과정을 거쳐, 0 ~ (i+1) 사이의 값을 얻을 수 있다. i는 반복 수행(iteration)을 하며 바뀌는 값으로 256*k-h 부터 256*k-1의 값을 얻을 수 있다. Specifically, if the buffer value buf is an array of 32*h length and the idxth value, buf[idx], is a 32-length bit string (0~2^32-1), multiply buf[idx] by (i+1) By dividing by 2^32 and rounding down, you can obtain a value between 0 and (i+1). i is a value that changes through iteration and can obtain values from 256*k-h to 256*k-1.

제5 단계 res[i]=res[degree]는, 뽑힌 위치의 중복을 피하기 위해 재배열해주는 과정이고, 제6 단계는, 뽑힌 위치 res[degree]에 1을 넣을 지 -1을 넣을지 정해주는 과정이다. The 5th step, res[i]=res[degree], is a process of rearranging the selected position to avoid duplication, and the 6th step is a process of deciding whether to insert 1 or -1 into the selected position res[degree]. am.

이 후, 다음 반복 수행(iteration)을 위해 idx를 1만큼 증가시키고, 반복 수행의 결과로 총 h개의 0~256*k-1 사이의 값을 저장한 res 배열을 얻게 된다. 마지막으로, 벡터를 효율적으로 저장하기 위해 인덱스 convToldx(res), 즉, 1과 -1의 "위치" 및 "값"들을 따로 저장한다. 예를 들어, 각 장치의 프로세서(120, 220)는 메모리(110, 210)에 "첫 1의 위치", "2번째 1의 위치", ... , "마지막 1의 위치", "1 종료 및 -1 시작 표시자", "첫 -1의 위치", "2번째 -1의 위치", ... , "마지막 -1의 위치" 등과 같은 정보를 저장할 수 있다. After this, idx is increased by 1 for the next iteration, and as a result of the iteration, a res array is obtained, storing a total of h values between 0 and 256*k-1. Lastly, in order to store the vector efficiently, the index convToldx(res), that is, the “position” and “value” of 1 and -1, are stored separately. For example, the processors 120 and 220 of each device may record "position of the first 1", "position of the second 1", ..., "position of the last 1", and "end of 1" in the memory 110 and 210. and -1 start indicator", "position of the first -1", "position of the second -1", ..., "position of the last -1", etc.

도 7 및 도 8은 서로 다른 표준 편차를 가지는 이산 가우시안 샘플러 함수를 이용하는 알고리즘을 나타낸다. Figures 7 and 8 show algorithms using discrete Gaussian sampler functions with different standard deviations.

먼저 도 7은 σ = 1.0625 인 이산 가우시안 샘플러의 동작을 나타낸다. First, Figure 7 shows the operation of a discrete Gaussian sampler with σ = 1.0625.

도 7에 따르면, 이산 가우시안 샘플러는, 길이 10짜리 (랜덤) 비트열 (x=x0x1x2x3x4x5x6x7x8x9)을 입력받는다. According to Figure 7, the discrete Gaussian sampler receives a (random) bit string (x=x0x1x2x3x4x5x6x7x8x9) with a length of 10.

제1 단계로, 이산 가우시안 샘플러는, 출력값 s (최종적으로 얻게되는 이산 가우시안 샘플)를 초기화(s=s1s0=00)한다. In the first step, the discrete Gaussian sampler initializes the output value s (finally obtained discrete Gaussian sample) (s=s 1 s 0 =00).

제 2 및 제3 단계로, 이산 가우시안 샘플러는, s의 첫번째 비트를 제 0, 1, 2, 3, 4, 5, 7번째 랜덤 비트열과 8번째 랜덤 비트열의 보 (즉, 1 - x8. 1->0, 0->1)를 곱한 것에, 제 0, 3, 4, 5, 6, 8번째 랜덤 비트열을 곱한 것과 제 1, 3, 4, 5, 6, 8번째 랜덤 비트열을 곱한 것과 , 제 2, 3, 4, 5, 6, 8번째 랜덤 비트열을 곱한 것을 전부 가산하는 과정을 수행한다. In the second and third steps, the discrete Gaussian sampler divides the first bit of s into the 0th, 1st, 2nd, 3rd, 4th, 5th, 7th random bit strings and the 8th random bit string (i.e., 1 - x8.1 ->0, 0->1), multiplied by the 0th, 3rd, 4th, 5th, 6th, and 8th random bit strings, and multiplied by the 1st, 3, 4, 5, 6, and 8th random bit strings. The process of adding all the products obtained by multiplying , , 2nd, 3rd, 4th, 5th, 6th, and 8th random bit strings is performed.

다음으로, 제4단계로, s의 첫번째 비트에 추가적으로 제 2, 3, 6번째 랜덤 비트열의 보들과 8번째 비트열을 곱한것과 제 1, 3, 6번째 랜덤 비트열의 보 들과 8번째 비트열을 곱한것을 더하는 과정을 수행한다. Next, in the fourth step, the first bit of s is additionally multiplied by the 2nd, 3rd, and 6th random bit strings and the 8th bit string, and the 1st, 3rd, and 6th random bit strings and the 8th bit string are Perform the process of adding the multiplication.

다음으로, 제5 단계로, s의 첫번째 비트에 추가적으로 제 6, 7번 째 랜덤 비트열과 8번째 랜덤 비트열의 보를 곱한 것과, 제 5, 6번째 랜덤 비트열의 보들과 제 8번째 비트열을 곱한것과 제 4, 6번째 랜덤 비트열의 보 들과 8번째 비트열을 곱한 것과, 제 7번째 랜덤 비트열의 보와, 8번째 비트열을 곱한것을 더하는 과정을 수행한다.Next, in the fifth step, the first bit of s is additionally multiplied by the complement of the 6th and 7th random bit strings and the 8th random bit string, and the complements of the 5th and 6th random bit strings are multiplied by the 8th bit string. The process of adding the product of the 4th and 6th random bit strings and the 8th bit string, and the product of the 7th random bit string and the product of the 8th bit string is performed.

제6 단계는, s의 두번째 비트를 설정하는 과정을 나타낸다. The sixth step represents the process of setting the second bit of s.

제7 단계는, 최종적으로 길이 2짜리 비트열 s=(s0, s1)에 부호 (양 혹은 음)를 부여하는 과정을 나타낸다. 이러한 과정을 통해 최종적으로 s가 σ (표준편차)= 1.0625를 갖는 Discrete Gaussian sample이 될 수 있다. The seventh step represents the process of finally assigning a sign (positive or negative) to the length 2 bit string s=(s0, s1). Through this process, s can finally become a Discrete Gaussian sample with σ (standard deviation) = 1.0625.

도 8은 σ = 1.453713 인 이산 가우시안 샘플러의 동작을 나타낸다. Figure 8 shows the operation of a discrete Gaussian sampler with σ = 1.453713.

도 8에 따르면, 이산 가우시안 샘플러는, 길이 11짜리 랜덤 비트열 (x=x0x1x2x3x4x5x6x7x8x9x10)을 입력받아 output s를 초기화한다. According to Figure 8, the discrete Gaussian sampler receives a random bit string with a length of 11 (x=x0x1x2x3x4x5x6x7x8x9x10) and initializes output s.

다음으로, s의 첫번째 비트(s0), 두번째 비트(s1), 세번째 비트(s2)를 순차적으로 획득한다. 최종적으로 길이 3짜리 비트열 s=(s0, s1, s2)에 부호 (양 혹은 음)를 부여하여, σ = 1.453713 인 이산 가우시안 샘플 s를 획득할 수 있다. Next, the first bit (s 0 ), second bit (s 1 ), and third bit (s 2 ) of s are acquired sequentially. Finally, by assigning a sign (positive or negative) to the length 3 bit string s=(s0, s1, s2), a discrete Gaussian sample s with σ = 1.453713 can be obtained.

도 7 및 도 8에서는 임의의 표준 편차를 가지는 이산 가우시안 샘플러의 동작을 설명하였으나, 이에 한정되는 것은 아니며, 표준 편차의 값이나 샘플러의 동작 순서, 연산 식 등은 다양하게 변형될 수 있다. 도 7 및 도 8의 이산 가우시안 샘플러는 각 장치(100, 200)의 프로세서(120, 130)에 의해 실행될 수 있다. 7 and 8 illustrate the operation of a discrete Gaussian sampler with an arbitrary standard deviation, but it is not limited thereto, and the standard deviation value, sampler operation sequence, calculation equation, etc. may be modified in various ways. The discrete Gaussian sampler of FIGS. 7 and 8 may be executed by the processors 120 and 130 of each device 100 and 200.

이상에서는, 공개 키 암호화 알고리즘에 대하여 구체적으로 설명하였으나, 본 개시의 또다른 실시 예에 따르면, 상술한 방식으로 생성한 공개 키 및 비밀 키를 이용하여 대칭키를 생성하고, 타 전자 장치와 이를 공유하는 대칭키 알고리즘으로 구현될 수도 있다. In the above, the public key encryption algorithm has been described in detail, but according to another embodiment of the present disclosure, a symmetric key is generated using the public key and secret key generated in the above-described manner and shared with other electronic devices. It can also be implemented with a symmetric key algorithm.

구체적으로, 제1 전자 장치(100)는 제2 전자 장치(200)와의 사이에서 공유할 수 있는 동일한 새로운 키 K를 생성할 수 있다. 새로운 키 K는 세션 키로 지칭될 수도 있다. Specifically, the first electronic device 100 can generate the same new key K that can be shared with the second electronic device 200. The new key K may be referred to as a session key.

일 예로, 제1 전자 장치(100)의 프로세서(120)는 다음과 같은 단계를 순차적으로 수행하여 키를 생성할 수 있다. As an example, the processor 120 of the first electronic device 100 may generate a key by sequentially performing the following steps.

1 : (pk, sk') ← KeyGen(1λ)1 : (pk, sk') ← KeyGen(1 λ )

2 : d ← {0,1 }256 2 : d ← {0,1 } 256

3 : return pk, sk(sk', d)3: return pk, sk(sk', d)

여기서 pk는 상술한 실시 예에서 설명한 공개 키 pk = (seedA, b) or (A, b)가 될 수 있다. Here, pk may be the public key pk = (seed A , b) or (A, b) described in the above-described embodiment.

상술한 제1 단계는, 프로세서(120)가 시큐리티 파라미터를 받아 공개 키 (pk)와 비밀 키의 일부 (sk')를 만드는 단계이다. 제2 단계는, 전체 프로토콜이 실패하였을 경우 키 대신 사용할 대체 키 생성용 랜덤값 (d, 256비트열)을 뽑는 단계이다. 제3 단계에서, 프로세서(120)는 랜덤값(d)과 비밀 키의 일부(sk')를 합쳐 비밀 키(sk)를 생성한다. 여기서, 비밀 키 sk = (sk', d)이고, sk'은 sk의 일부분에 해당한다. 제1 전자 장치(100)는 생성한 공개 키 pk를 제2 전자 장치(200)로 전송한다. In the above-described first step, the processor 120 receives security parameters and creates a public key (pk) and a part of the secret key (sk'). The second step is to select a random value (d, 256-bit string) for generating a replacement key to be used in place of the key if the entire protocol fails. In the third step, the processor 120 generates a secret key (sk) by combining the random value (d) and a part of the secret key (sk'). Here, the secret key sk = (sk', d), and sk' corresponds to a part of sk. The first electronic device 100 transmits the generated public key pk to the second electronic device 200.

제2 전자 장치(200)의 프로세서(220)는 인캡슐레이션을 수행한다. 구체적인 인캡슐레이션 단계는 다음과 같이 구현될 수 있다. The processor 220 of the second electronic device 200 performs encapsulation. The specific encapsulation step can be implemented as follows.

1 : μ ← {0,1 }256 1 : μ ← {0,1 } 256

2 : (K, seed) ← G(μ, H(pk))2: (K, seed) ← G(μ, H(pk))

3 : ct ← Enc(pk, μ ; seed)3: ct ← Enc(pk, μ; seed)

4 : return ct, K4: return ct, K

여기서 제1 단계는, 공유할 키 (K)를 생성하기 위한 랜덤값 μ(256비트열)을 뽑는 단계이다. 제2 단계는, 제1 단계에서 추출한 랜덤값 μ과 공개 키에 해쉬함수 G, H를 적용하여, 공유할 키 (K)와 암호문 생성에 쓰일 시드값 (seed, 256비트열)을 만드는 단계이다. 제3 단계는, 공개 키, 제1 단계에서 추출한 랜덤값 μ, 제2 단계에서 생성한 시드값을 이용하여 암호문 ct를 만드는 단계이다. 해쉬함수 H는 공개 키(public key)를 해싱하기 위한 해쉬 함수이고, 해쉬함수 G는 공유키(sharing key) K 및 시드값을 얻기 위한 해쉬 함수(Hash function)이다. Here, the first step is to select a random value μ (256-bit string) to generate the key (K) to be shared. The second step is to apply hash functions G and H to the random value μ and public key extracted in the first step to create a key to be shared (K) and a seed value (seed, 256-bit string) to be used to generate the ciphertext. . The third step is to create ciphertext ct using the public key, the random value μ extracted in the first step, and the seed value generated in the second step. The hash function H is a hash function for hashing the public key, and the hash function G is a hash function for obtaining the sharing key K and the seed value.

본 실시 예에서는, 실제로 전송할 메시지를 사용하는 대신에, 키 K를 만들기 위해 랜덤한 μ를 뽑아서, 이를 상술한 다른 실시 예의 메시지처럼 사용하여 암호문을 생성하게 된다. In this embodiment, instead of using the actual message to be transmitted, a random μ is selected to create the key K, and this is used like the message in the other embodiments described above to generate the ciphertext.

제2 전자 장치(200)는 생성한 암호문을 제1 전자 장치(100)로 전송할 수 있다. 제1 전자 장치(100)는 암호문이 수신되면, 디캡슐레이션을 수행할 수 있다. The second electronic device 200 may transmit the generated encrypted text to the first electronic device 100. When the ciphertext is received, the first electronic device 100 may perform decapsulation.

구체적인 디캡슐레이션 단계는 다음과 같이 구현될 수 있다. The specific decapsulation step can be implemented as follows.

1 : μ' = Dec(sk', ct)1 : μ' = Dec(sk', ct)

2 : (K', seed) ← G(μ', H(pk))2: (K', seed) ← G(μ', H(pk))

3 : ct' ← Enc(pk, μ' ; seed')3: ct' ← Enc(pk, μ'; seed')

4 : 4 :

5 : if ct ≠ct' then5: if ct ≠ct' then

6 : 6:

7 : return K'7 : return K'

여기서 제1 단계는, 암호문(ct')을 비밀 키의 일부(sk')를 이용하여 복호화 (decrypt)하는 과정을 의미한다. 제2 단계는, 복호화된 값 (μ')과 공개 키에 해쉬함수 G, H를 적용하여, 공유된 키 (K')와 암호문 생성에 쓰인 시드값 (seed, 256비트열)을 복구하는 과정을 의미한다. 제3 단계는, 복호화된 값 (μ')과 복구한 시드값, 공개 키를 이용하여 암호문을 재생성(ct')하는 과정을 의미한다. Here, the first step refers to the process of decrypting the ciphertext (ct') using a part of the secret key (sk'). The second step is the process of applying hash functions G and H to the decrypted value (μ') and the public key to recover the shared key (K') and the seed value (seed, 256-bit string) used to generate the ciphertext. means. The third step refers to the process of regenerating the ciphertext (ct') using the decrypted value (μ'), the recovered seed value, and the public key.

제4 단계는, 재성성한 암호문이 받은 암호문이 다를 경우를 대비해 대체 키 를 만들어 놓는 과정을 의미한다. 제5 단계는, 재생성한 암호문 (ct')이 받은 암호문(ct)와 동일한지 확인하는 과정이고, 제6단계는, 동일하지 않을 경우 공유키 K'를 대체키 로 대체하는 과정을 의미한다. The fourth step is to use a replacement key in case the regenerated ciphertext is different from the received ciphertext. It means the process of creating. The fifth step is the process of checking whether the regenerated ciphertext (ct') is the same as the received ciphertext (ct), and the sixth step is to use the shared key K' as a replacement key if it is not the same. This means the process of replacing .

도 9는 상술한 방식으로 수행한 암호화 방식의 효율성을 설명하기 위한 실험 데이터이다. Figure 9 is experimental data to explain the efficiency of the encryption method performed in the above-described manner.

도 9에서는 종래의 공지된 암호화 방식(제1 내지 제3 방식)과, 본 개시의 암호화 방식(제4 방식)에서 사용되는 비밀 키(sk), 공개 키(pk), 암호문(ct)의 크기(bytes)와, 보안성, 암호화를 수행하기 위한 연산 사이클 수를 나타낸다. 9 shows the sizes of the secret key (sk), public key (pk), and ciphertext (ct) used in the conventionally known encryption method (first to third methods) and the encryption method (fourth method) of the present disclosure. (bytes) and the number of operation cycles to perform security and encryption.

도 9에 따르면, 제4 방식에서의 보안성 점수는 120로, NIST(National Institute of Standards and Technology) 보안 레벨 1에 거의 준하는 보안성을 가지는 것을 알 수 있다. 이에 비해, 비밀 키의 크기는 현저하게 줄어들며, 키 생성(KeyGen), 인캡슐레이션(Encap), 디캡슐레이션(Decap) 단계에서의 연산 사이클 수는 역시 타 방식에 비해 적음을 알 수 있다. 즉, 도 9를 참고하면, 본 개시의 암호화 매커니즘은 기존의 다른 암호화 매커니즘에 비해 보안성은 유지하면서 효율성을 크게 개선시키는 것을 알 수 있다. According to Figure 9, the security score in the fourth method is 120, which shows that it has security almost equivalent to NIST (National Institute of Standards and Technology) security level 1. In comparison, the size of the secret key is significantly reduced, and the number of operation cycles in the key generation (KeyGen), encapsulation (Encap), and decapsulation (Decap) stages is also smaller than other methods. That is, referring to FIG. 9, it can be seen that the encryption mechanism of the present disclosure significantly improves efficiency while maintaining security compared to other existing encryption mechanisms.

이상에서는 공개 키 생성 및 암호화가 각각 다른 장치에서 수행되는 경우를 기준으로 설명하였으나, 공개 키 생성 및 암호화, 복호화는 하나의 장치에서 수행될 수도 있다. In the above description, the public key generation and encryption are performed on different devices, but the public key generation, encryption, and decryption may also be performed on a single device.

이상에서는 다양한 실시 예들에 대해서 각각 설명하였으나, 각 실시 예들은 반드시 개별적으로만 구현되는 것은 아니며, 적어도 하나의 다른 실시 예들과 전체적으로 또는 부분적으로 결합되어 하나의 제품에 함께 구현될 수도 있다.In the above, various embodiments have been described, but each embodiment is not necessarily implemented individually, and may be combined in whole or in part with at least one other embodiment and implemented together in one product.

본 개시의 다양한 실시예들은 기기(machine)(예: 컴퓨터)로 읽을 수 있는 저장 매체(machine-readable storage media)에 저장된 명령어를 포함하는 소프트웨어로 구현될 수 있다. 기기는, 저장 매체로부터 저장된 명령어를 호출하고, 호출된 명령어에 따라 동작이 가능한 장치로서, 개시된 실시예들에 따른 전자 장치(100, 200)를 포함할 수 있다. Various embodiments of the present disclosure may be implemented as software including instructions stored in a machine-readable storage media (e.g., a computer). The device is a device capable of calling instructions stored in a storage medium and operating according to the called instructions, and may include the electronic devices 100 and 200 according to the disclosed embodiments.

구체적으로는, 기 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하는 단계, 비밀 키 및 에러를 이용하여 공개 키를 생성하는 단계, 비밀 키 및 상기 공개 키를 저장하는 단계 및 공개 키를 외부 장치로 전송하는 단계를 순차적으로 수행하기 위한 소프트웨어가 저장된 비일시적 판독 가능 저장 매체가 제공될 수 있다. Specifically, generating a secret key by randomly combining values within a preset range based on pre-stored data, generating a public key using a secret key and an error, and storing the secret key and the public key. A non-transitory readable storage medium storing software for sequentially performing the steps and transmitting the public key to an external device may be provided.

또는, 기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하는 단계, 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계, 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과, 랜덤 벡터 b, 랜덤 벡터 r 및 데이터에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하는 단계, 제1 값 및 제2 값을 포함하는 암호문을 생성하는 단계를 순차적으로 수행하기 위한 소프트웨어가 저장된 비일시적 판독 가능 저장 매체가 제공될 수도 있다. Or, obtaining a random vector r by randomly extracting values within a preset range, obtaining a random matrix A and a random vector b from a public key, and rounding the result of the operation based on the random matrix A. Obtaining a value (c1) and a second value (c2) obtained by rounding the result of calculation based on the random vector b, random vector r, and data, respectively, and generating a ciphertext including the first value and the second value. A non-transitory readable storage medium storing software for sequentially performing the generating steps may be provided.

이러한 비일시적 판독 가능 매체가 탑재된 장치는 상술한 다양한 실시 예들에서 설명한 공개 키 생성, 암호화, 복호화 등의 동작을 수행할 수 있다. A device equipped with such a non-transitory readable medium can perform operations such as public key generation, encryption, and decryption described in the various embodiments described above.

비일시적(non-transitory) 판독 가능 저장 매체에서 '비일시적'이란 저장매체가 신호(signal)를 포함하지 않으며 실재(tangible)한다는 것을 의미할 뿐 데이터가 저장매체에 반영구적 또는 임시적으로 저장됨을 구분하지 않는다.In non-transitory readable storage media, 'non-transitory' only means that the storage medium does not contain signals and is tangible, and does not distinguish whether data is stored semi-permanently or temporarily in the storage medium. No.

또는 상술한 다양한 실시예들에 따른 방법을 수행하기 위한 프로그램이 어플리케이션 스토어를 통해 온라인으로 배포될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.Alternatively, a program for performing the method according to the various embodiments described above may be distributed online through an application store. In the case of online distribution, at least a portion of the computer program product may be at least temporarily stored or created temporarily in a storage medium such as the memory of a manufacturer's server, an application store server, or a relay server.

다양한 실시예들에 따른 구성 요소(예: 모듈 또는 프로그램) 각각은 단수 또는 복수의 개체로 구성될 수 있으며, 전술한 해당 서브 구성 요소들 중 일부 서브 구성 요소가 생략되거나, 또는 다른 서브 구성 요소가 다양한 실시예에 더 포함될 수 있다. 대체적으로 또는 추가적으로, 일부 구성 요소들(예: 모듈 또는 프로그램)은 하나의 개체로 통합되어, 통합되기 이전의 각각의 해당 구성 요소에 의해 수행되는 기능을 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따른, 모듈, 프로그램 또는 다른 구성 요소에 의해 수행되는 동작들은 순차적, 병렬적, 반복적 또는 휴리스틱하게 실행되거나, 적어도 일부 동작이 다른 순서로 실행되거나, 생략되거나, 또는 다른 동작이 추가될 수 있다.Each component (e.g., module or program) according to various embodiments may be composed of a single or multiple entities, and some of the above-described sub-components may be omitted or other sub-components may be used. It may be further included in various embodiments. Alternatively or additionally, some components (e.g., modules or programs) may be integrated into a single entity and perform the same or similar functions performed by each corresponding component prior to integration. According to various embodiments, operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or at least some operations may be executed in a different order, omitted, or other operations may be added. It can be.

이상 첨부 도면을 참고하여 본 발명에 대해서 설명하였지만 본 발명의 권리범위는 후술하는 특허청구범위에 의해 결정되며 전술한 실시예 및/또는 도면에 제한되는 것으로 해석되어서는 아니된다. 그리고 특허청구범위에 기재된 발명의, 당업자에게 자명한 개량, 변경 및 수정도 본 발명의 권리범위에 포함된다는 점이 명백하게 이해되어야 한다.Although the present invention has been described above with reference to the accompanying drawings, the scope of the present invention is determined by the scope of the patent claims described later and should not be construed as being limited to the above-described embodiments and/or drawings. In addition, it should be clearly understood that improvements, changes and modifications of the invention described in the patent claims, which are obvious to those skilled in the art, are also included in the scope of rights of the present invention.

110 : 메모리 120 : 프로세서
130 : 통신부
110: memory 120: processor
130: Department of Communications

Claims (14)

전자 장치에 있어서,
통신부;
키 생성을 위한 데이터가 저장되는 메모리 ; 및
프로세서를 포함하며,
상기 프로세서는,
상기 메모리에 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하고, 상기 비밀 키 및 에러를 이용하여 공개 키를 생성하여, 상기 비밀 키 및 상기 공개 키를 상기 메모리에 저장하고,
상기 통신부를 이용하여 상기 공개 키를 외부 장치로 전송하며,
상기 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응되는, 전자 장치.
In electronic devices,
Ministry of Communications;
Memory where data for key generation is stored; and
Contains a processor,
The processor,
Generate a secret key by randomly combining values within a preset range based on the data stored in the memory, generate a public key using the secret key and an error, and store the secret key and the public key in the memory. do,
Transmitting the public key to an external device using the communication unit,
The electronic device where the sum of the remaining values excluding 0 among the values within the preset range corresponds to a Hamming weight.
제1항에 있어서,
상기 프로세서는,
랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득하고,
이산가우시안 분포 또는 상기 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 상기 에러를 획득하며,
상기 에러를 모듈러 연산한 값과, 상기 비밀 키 및 상기 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득하며,
상기 공개 키는, 상기 랜덤 행렬(A)또는 상기 랜덤 행렬(A) 획득에 사용되는 시드값과 상기 랜덤 벡터(b)를 포함하는, 전자 장치.
According to paragraph 1,
The processor,
Obtain a random matrix (A) composed of randomly determined vectors,
Obtaining the error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution,
Obtaining a random vector (b) based on the modular operation value of the error, the secret key, and the random matrix,
The public key includes the random matrix (A) or a seed value used to obtain the random matrix (A) and the random vector (b).
제2항에 있어서,
상기 프로세서는,
상기 메모리에 저장된 데이터 중에서 시드 값에 대해 확장 가능 출력 함수(extendable-output function, XOF)를 적용하여 제1 시드값, 제2 시드값, 제3 시드값을 획득하고,
상기 제1 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하고,
상기 제2 시드값에 해밍 웨이트 샘플러 함수를 적용하여, 해밍 웨이트 h를 가지는 비조밀(sparse) 벡터인 상기 비밀 키 s를 획득하며,
상기 제3 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 에러 e를 획득하는, 전자 장치.
According to paragraph 2,
The processor,
Obtaining a first seed value, a second seed value, and a third seed value by applying an extendable-output function (XOF) to the seed value among the data stored in the memory,
Obtaining the random matrix (A) by applying a random matrix sampler function to the first seed value,
Applying the Hamming weight sampler function to the second seed value to obtain the secret key s, which is a sparse vector with a Hamming weight h,
An electronic device that obtains an error e with a standard deviation σ by applying a discrete Gaussian sampler function to the third seed value.
제3항에 있어서,
기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r과 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 상기 랜덤 벡터 b와 상기 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함하는 암호문이 상기 외부 장치로부터 상기 통신부를 통해 수신되면,
상기 프로세서는,
상기 제1 값 및 상기 비밀 키를 연산한 결과값 및 상기 제2 값에 각각 모듈러스 연산을 수행한 후, 가산하여 메시지를 복호하는, 전자 장치.
According to paragraph 3,
A first value (c1) obtained by rounding the result of calculation based on a random vector r randomly extracting values within a preset range and the random matrix A, and a result of calculation based on the random vector b and the random vector r. When the ciphertext containing the second value (c2) obtained by rounding the value is received from the external device through the communication unit,
The processor,
An electronic device that decrypts a message by performing a modulus operation on the first value, a result of calculating the secret key, and the second value, respectively, and then adding them.
전자 장치에 있어서,
통신부;
외부 장치로 전송할 데이터를 입력 받기 위한 인터페이스;
상기 데이터를 저장하기 위한 메모리 ; 및
프로세서를 포함하며,
상기 프로세서는,
외부 장치에서 에러를 이용하여 생성한 공개 키에 대한 정보가 상기 통신부를 통해 수신되면,
기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하고,
상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하고,
상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과, 상기 랜덤 벡터 b, 상기 랜덤 벡터 r 및 상기 데이터에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하며,
상기 제1 값 및 상기 제2 값을 포함하는 암호문을 상기 통신부를 통해 상기 외부 장치로 전송하는, 전자 장치.
In electronic devices,
Ministry of Communications;
An interface for receiving data to be transmitted to an external device;
memory for storing the data; and
Contains a processor,
The processor,
When information about the public key generated using an error in an external device is received through the communication unit,
Obtain a random vector r, which randomly extracts values within a preset range,
Obtain a random matrix A and a random vector b from the public key,
A first value (c1) obtained by rounding the result value calculated based on the random matrix A, and a second value obtained by rounding the result value calculated based on the random vector b, the random vector r, and the data ( obtain c2) respectively,
An electronic device that transmits encrypted text including the first value and the second value to the external device through the communication unit.
제5항에 있어서,
상기 프로세서는,
상기 공개 키에 상기 랜덤 행렬 A가 포함되어 있으면 상기 랜덤 행렬 A를 추출하고,
상기 공개 키에 시드값이 포함되어 있으면 상기 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하는, 전자 장치.
According to clause 5,
The processor,
If the public key includes the random matrix A, extract the random matrix A,
If the public key includes a seed value, the electronic device obtains the random matrix (A) by applying a random matrix sampler function to the seed value.
제6항에 있어서,
상기 프로세서는,
상기 메모리에 저장된 시드값에 해밍 웨이트 샘플러 함수를 적용하여 상기 랜덤 벡터 r을 획득하는, 전자 장치.
According to clause 6,
The processor,
An electronic device that obtains the random vector r by applying a Hamming weight sampler function to the seed value stored in the memory.
전자 장치의 제어 방법에 있어서,
기 저장된 데이터에 기초하여 기 설정된 범위 내의 값들을 랜덤하게 조합하여 비밀 키를 생성하는 단계;
상기 비밀 키 및 에러를 이용하여 공개 키를 생성하는 단계;
상기 비밀 키 및 상기 공개 키를 저장하는 단계; 및
상기 공개 키를 외부 장치로 전송하는 단계를 포함하며,
상기 기 설정된 범위 내의 값들 중 0을 제외한 나머지 값들의 개수의 합은 해밍 웨이트(hamming weight)에 대응되는, 제어 방법.
In a method of controlling an electronic device,
Generating a secret key by randomly combining values within a preset range based on pre-stored data;
generating a public key using the private key and an error;
storing the private key and the public key; and
Including transmitting the public key to an external device,
A control method, wherein the sum of the remaining values excluding 0 among the values within the preset range corresponds to a Hamming weight.
제8항에 있어서,
상기 공개 키를 생성하는 단계는,
랜덤하게 결정된 벡터들로 구성되는 랜덤 행렬(A)을 획득하는 단계;
이산가우시안 분포 또는 상기 이산 가우시안 분포와 통계적 거리가 가까운 분포로부터 상기 에러를 획득하는 단계;
상기 에러를 모듈러 연산한 값과, 상기 비밀 키 및 상기 랜덤 행렬에 기초하여 랜덤 벡터(b)를 획득하는 단계;
상기 랜덤 행렬(A) 또는 상기 랜덤 행렬(A) 획득에 사용되는 시드값과 상기 랜덤 벡터(b)를 포함하는, 상기 공개 키를 생성하는 단계;를 포함하는, 제어 방법.
According to clause 8,
The step of generating the public key is,
Obtaining a random matrix (A) composed of randomly determined vectors;
Obtaining the error from a discrete Gaussian distribution or a distribution with a statistical distance close to the discrete Gaussian distribution;
Obtaining a random vector (b) based on a modular operation of the error, the secret key, and the random matrix;
A control method including; generating the public key including the random matrix (A) or a seed value used to obtain the random matrix (A) and the random vector (b).
제9항에 있어서,
상기 공개 키를 생성하는 단계는,
기 저장된 시드 값에 대해 확장 가능 출력 함수(extendable-output function, XOF)를 적용하여 제1 시드값, 제2 시드값, 제3 시드값을 획득하는 단계;
상기 제1 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하는 단계;
상기 제3 시드값에 이산 가우시안 샘플러 함수를 적용하여, 표준 편차σ를 가지는 상기 에러 e를 획득하는 단계;를 포함하며,
상기 비밀 키를 생성하는 단계는,
상기 제2 시드값에 해밍 웨이트 샘플러 함수를 적용하여, 해밍 웨이트 h를 가지는 비조밀(sparse) 벡터인 상기 비밀 키 s를 획득하는, 제어 방법.
According to clause 9,
The step of generating the public key is,
Obtaining a first seed value, a second seed value, and a third seed value by applying an extendable-output function (XOF) to the previously stored seed value;
Obtaining the random matrix (A) by applying a random matrix sampler function to the first seed value;
Applying a discrete Gaussian sampler function to the third seed value to obtain the error e having a standard deviation σ,
The step of generating the secret key is,
A control method for obtaining the secret key s, which is a sparse vector with a Hamming weight h, by applying a Hamming weight sampler function to the second seed value.
제10항에 있어서,
기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r과 상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과 상기 랜덤 벡터 b와 상기 랜덤 벡터 r에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 포함하는 암호문이 상기 외부 장치로부터 수신되면, 상기 제1 값 및 상기 비밀 키를 연산한 결과값 및 상기 제2 값에 각각 모듈러스 연산을 수행한 후, 가산하여 메시지를 복호하는 단계;를 더 포함하는, 제어 방법.
According to clause 10,
A first value (c1) obtained by rounding the result of calculation based on a random vector r randomly extracting values within a preset range and the random matrix A, and a result of calculation based on the random vector b and the random vector r. When ciphertext including a second value (c2) obtained by rounding the value is received from the external device, a modulus operation is performed on the first value, the result of calculating the secret key, and the second value, respectively, A control method further comprising: decoding the message by adding.
전자 장치의 암호화 방법에 있어서,
외부 장치에서 에러를 이용하여 생성한 공개 키에 대한 정보를 수신하여 저장하는 단계;
기 설정된 범위 내의 값들을 랜덤하게 추출한 랜덤 벡터 r을 획득하는 단계;
상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계;
상기 랜덤 행렬 A에 기초하여 연산한 결과값을 라운딩 처리한 제1 값(c1)과,
상기 랜덤 벡터 b, 상기 랜덤 벡터 r 및 메시지에 기초하여 연산한 결과값을 라운딩 처리한 제2 값(c2)을 각각 획득하는 단계;
상기 제1 값 및 상기 제2 값을 포함하는 암호문을 생성하여 상기 외부 장치로 전송하는 단계;를 포함하는 암호화 방법.
In an encryption method for an electronic device,
Receiving and storing information about a public key generated using an error in an external device;
Obtaining a random vector r that randomly extracts values within a preset range;
Obtaining a random matrix A and a random vector b from the public key;
A first value (c1) obtained by rounding the result calculated based on the random matrix A,
Obtaining a second value (c2) obtained by rounding the result of calculation based on the random vector b, the random vector r, and the message;
An encryption method comprising: generating ciphertext including the first value and the second value and transmitting it to the external device.
제12항에 있어서,
상기 공개 키로부터 랜덤 행렬 A 및 랜덤 벡터 b를 획득하는 단계는,
상기 공개 키에 상기 랜덤 행렬 A가 포함되어 있으면 상기 랜덤 행렬 A를 추출하는 단계; 및
상기 공개 키에 시드값이 포함되어 있으면 상기 시드값에 랜덤 행렬 샘플러 함수를 적용하여 상기 랜덤 행렬(A)를 획득하는 단계;를 포함하는 암호화 방법.
According to clause 12,
The step of obtaining a random matrix A and a random vector b from the public key is,
extracting the random matrix A if the public key includes the random matrix A; and
If the public key includes a seed value, obtaining the random matrix (A) by applying a random matrix sampler function to the seed value.
제13항에 있어서,
상기 랜덤 벡터 r을 획득하는 단계는,
기 저장된 시드값에 해밍 웨이트 샘플러 함수를 적용하여 상기 랜덤 벡터 r을 획득하는, 암호화 방법.


According to clause 13,
The step of obtaining the random vector r is,
An encryption method of obtaining the random vector r by applying a Hamming weight sampler function to a previously stored seed value.


KR1020230168643A 2022-11-30 2023-11-28 Electronic device for encrypting data by public key and methods thereof KR20240081407A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/522,648 US20240178992A1 (en) 2022-11-30 2023-11-29 Electronic device for encrypting data by public key and methods thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020220164724 2022-11-30
KR20220164724 2022-11-30

Publications (1)

Publication Number Publication Date
KR20240081407A true KR20240081407A (en) 2024-06-07

Family

ID=91480442

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230168643A KR20240081407A (en) 2022-11-30 2023-11-28 Electronic device for encrypting data by public key and methods thereof

Country Status (1)

Country Link
KR (1) KR20240081407A (en)

Similar Documents

Publication Publication Date Title
CN109150499B (en) Method and device for dynamically encrypting data, computer equipment and storage medium
US10009170B2 (en) Apparatus and method for providing Feistel-based variable length block cipher
CN108989016B (en) Preventing relay attacks in white-box implementations
US9274979B2 (en) System, method, and computer program product for optimizing data encryption and decryption by implementing asymmetric AES-CBC channels
KR102019159B1 (en) Apparatus and methdo for giving the compressed encryption functionality to integer-based homomorphic encryption schemes
CN111832056B (en) Method and system for generating two-dimensional code
US20150134971A1 (en) Apparatus and method for decrypting encrypted file
JP6575532B2 (en) Encryption device, decryption device, encryption processing system, encryption method, decryption method, encryption program, and decryption program
WO2014044137A1 (en) Communication encryption and decryption method, device and system
JP6884284B2 (en) White box calculation of keyed message authentication code
US10404468B2 (en) Technologies for CCM encryption with 64-bit block ciphers
CN108599934A (en) It is a kind of to test safe and secret Enhancement Method for quantum key distribution
JP6735926B2 (en) Encryption device, decryption device, encryption method, decryption method, encryption program, and decryption program
US11329799B2 (en) Calculation device for encryption using public key and encryption method thereof
US8891760B2 (en) System for checking acceptance of string by automaton
CN112054896B (en) White box encryption method, white box encryption device, terminal and storage medium
US11658806B2 (en) Identity-based hash proof system configuration apparatus, identity-based encryption apparatus, identity-based hash proof system configuration method and program
CN113055184B (en) Data encryption and decryption method and device
US11042488B2 (en) Diversifying a base symmetric key based on a public key
KR20240081407A (en) Electronic device for encrypting data by public key and methods thereof
US20180024813A1 (en) Pseudo-random number generation device and computer readable medium
US20240178992A1 (en) Electronic device for encrypting data by public key and methods thereof
KR20220121221A (en) Apparatus for conversion of homomorphic encrypted messase and method thereof
KR20230095750A (en) Whitebox cryptographic method and device based on block cipher mode of operation using one-way function
CN118075037B (en) Data encryption method, device, equipment and storage medium