-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Translate Cryptography docs en -> ko * Translate Cryptography docs ko -> en
- Loading branch information
Showing
27 changed files
with
698 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
## Intro | ||
## Introduction | ||
|
||
공개키 암호(혹은 비대칭키 암호)는 각자 공개키와 비밀키로 구성된 한 쌍의 키를 가지고 있고, 비밀키를 공유하지 않고 각자의 공개키만으로 암호화와 복호화가 가능한 암호이다. | ||
Public key cryptography (also known as asymmetric key cryptography) is a system where each participant possesses a pair of keys: a public key and a private key. Encryption and decryption are possible using only the public keys, without sharing private keys. | ||
|
||
공개키 암호는 기존 대칭키 암호의 취약점을 보완하고자 고안되었다. 대칭키 암호에서는 서로 키를 교환해야 하는데 이 과정에서 키가 탈취당하는 위험이 있다. 그러나 공개키 암호는 각자의 비밀키를 교환하지 않기 때문에 그러한 리스크를 없앨 수 있다. | ||
Public key cryptography was developed to address the vulnerabilities of traditional symmetric key cryptography. In symmetric key cryptography, there is a risk of the key being intercepted during exchange, since both parties need to exchange keys. However, in public key cryptography, the risk is eliminated because private keys are not exchanged. | ||
|
||
또한, 대칭키 암호는 통신의 참여자 수가 늘어날수록 요구되는 키의 개수가 기하급수적으로 증가한다. 가령, 통신의 참여자가 $n$명인 경우, 대칭키 암호는 각각의 참여자들끼리의 통신마다 키가 생성되어야 하기 때문에 $n(n-1)\over 2$ 개의 키가 필요하지만, 공개키 암호의 경우 각자가 한 쌍의 키만 가지면 되므로 $2n$개의 키만 있으면 된다. | ||
Moreover, the number of keys required in symmetric key cryptography increases exponentially as the number of participants increases. For instance, if there are \( n \) participants, symmetric key cryptography requires \(\frac{n(n-1)}{2}\) keys, as a key needs to be generated for each communication between participants. In contrast, in public key cryptography, each participant only needs one pair of keys, so only \( 2n \) keys are needed. | ||
|
||
## Public key system | ||
## Public Key System | ||
|
||
공개키 암호은 기존의 암호학 상식을 뛰어넘는 혁신적인 발상으로 1976년 _Diffie_와 _Hellman_이 발표한 논문 [*New directions in cryptograpy](https://ee.stanford.edu/~hellman/publications/24.pdf)* 에서 최초로 제안되었다. | ||
Public key cryptography was an innovative concept that went beyond the traditional understanding of cryptography. It was first proposed in the 1976 paper [*New Directions in Cryptography*](https://ee.stanford.edu/~hellman/publications/24.pdf) by Diffie and Hellman. | ||
|
||
다음은 공개키 암호의 이해를 돕기위해 나타낸 비유적인 과정이다. | ||
The following is a metaphorical process to help understand public key cryptography. | ||
|
||
![[public_key(1).png]] | ||
![Public Key Process Step 1](public_key(1).png) | ||
|
||
앨리스(Alice)는 어떤 메시지를 밥(Bob)에게 공개키 암호방식을 이용하여 보내려고 한다. 앨리스와 밥은 각자의 프라이빗키와 퍼블릭키 한 쌍씩을 가지고있다. 이때, 퍼블릭키를 자물쇠, 프라이빗키를 열쇠라고 생각해보자. | ||
Alice wants to send a message to Bob using a public key cryptography system. Alice and Bob each have a pair of private and public keys. Let's think of the public key as a lock and the private key as a key. | ||
|
||
![[public_key(2).png]] | ||
![Public Key Process Step 2](public_key(2).png) | ||
|
||
앨리스는 평문을 상자에 담아 자신의 자물쇠(앨리스의 퍼블릭키)로 잠근 뒤 밥에게 보낸다. | ||
Alice puts the plaintext in a box, locks it with her lock (Alice’s public key), and sends it to Bob. | ||
|
||
![[public_key(3).png]] | ||
![Public Key Process Step 3](public_key(3).png) | ||
|
||
밥은 앨리스에게 받은 상자에 자신의 자물쇠(밥의 퍼블릭키)도 잠그고 다시 앨리스에게 보낸다.(즉, 상자는 현재 앨리스와 밥의 자물쇠 두개가 모두 잠겨있는 상태이다.) | ||
Bob locks the box he received from Alice with his lock (Bob’s public key) and sends it back to Alice. (At this point, the box is locked with both Alice's and Bob's locks.) | ||
|
||
![[public_key(4).png]] | ||
![Public Key Process Step 4](public_key(4).png) | ||
|
||
앨리스는 두개의 자물쇠로 잠겨있는 상자에서 자신의 열쇠(프라이빗키)를 이용해 자신의 자물쇠만 잠금해제한뒤 다시 밥에게 보낸다. | ||
Alice uses her key (private key) to unlock her lock from the box and sends it back to Bob. | ||
|
||
![[public_key(5).png]] | ||
![Public Key Process Step 5](public_key(5).png) | ||
|
||
마지막으로 상자에는 밥의 자물쇠만 잠겨있으므로 자신의 자물쇠만 해제하면 상자안의 평문을 볼 수 있다. | ||
Finally, Bob unlocks his lock and can see the plaintext inside the box. | ||
|
||
위 과정에서 앨리스와 밥은 서로의 프라이빗키를 교환하지 않고 평문을 안전하게 전달하였다. 이러한 컨셉을 이용한 것이 공개키 암호이다. 즉, 기존의 암호는 하나의 자물쇠를 서로 같은 키를 공유하여 암호문을 전달했다면, 공개키 암호는 위와 같이 서로 다른 자물쇠와 키를 사용한다는 개념이다. | ||
Throughout this process, Alice and Bob securely exchanged plaintext without sharing their private keys. This concept is the foundation of public key cryptography. Unlike traditional cryptography, which involves a single lock and shared key, public key cryptography uses different locks and keys as demonstrated above. | ||
|
||
다만, 이는 이해를 돕기위한 간략한 예시이고, 실제 통신에서 쓰이는 공개키 암호는 다양한 방식의 암호학적 프로토콜로 구성되어있다. | ||
This is a simplified example for understanding, and the public key cryptography used in actual communication involves various cryptographic protocols. | ||
|
||
## Types of Public Key System | ||
## Types of Public Key Systems | ||
|
||
공개키 암호에는 여러 종류의 프로토콜이 있다. | ||
There are several types of protocols in public key cryptography. | ||
|
||
1. [[RSA]] | ||
1. **RSA** | ||
|
||
RSA는 가장 널리 사용되는 공개키 암호 중 하나이다. RSA는 큰 소수를 사용하여 키를 생성하고, IFP(Integer Factorization Problem, 합성수의 소인수분해 문제)에 기반한 보안성을 가지고 있다 주로 데이터 암호화와 디지털 서명에 사용된다. | ||
RSA is one of the most widely used public key cryptosystems. RSA generates keys using large prime numbers and is based on the security of the Integer Factorization Problem (IFP). It is mainly used for data encryption and digital signatures. | ||
|
||
2. [[Diffie-Hellman]] | ||
2. **Diffie-Hellman** | ||
|
||
Diffie-Hellman 키 교환은 두 사용자가 공개적으로 키를 교환하여 공통의 비밀 키를 생성할 수 있도록 하는 프로토콜이다. 두 사용자는 서로의 공개 키를 사용하여 비밀 키를 생성하지만, 이 과정에서 비밀 키 자체는 교환되지 않는다. | ||
The Diffie-Hellman key exchange is a protocol that allows two users to generate a shared secret key through public key exchange. Users generate the secret key using each other's public keys, but the secret key itself is not exchanged. | ||
|
||
3. [[ElGamal]] | ||
3. **ElGamal** | ||
|
||
Elgamal 암호는 Diffie-Hellman 키 교환 방식에 기초하여 만들어졌으며, 메세지의 암호화와 디지털 서명에 사용할 수 있다. Elgamal의 보안성은 DLP(Discrete Logarithm Problem), 이산 로그 문제에 기반한다. | ||
ElGamal encryption is based on the Diffie-Hellman key exchange and can be used for message encryption and digital signatures. The security of ElGamal relies on the Discrete Logarithm Problem (DLP). | ||
|
||
4. [[Elliptic Curves#Elliptic Curve Cryptography]] | ||
4. **Elliptic Curves / Elliptic Curve Cryptography (ECC)** | ||
|
||
ECC(타원 곡선 암호)는 이산 로그 문제 중 타원 곡선에 기반한 [[ECDLP]](Elliptic Curve Discrete Logarithm Problem)을 기반으로 하는 시스템이다. 다른 프로토콜에 비해 비교적 작은 길이의 키를 사용하면서 높은 수준의 보안성을 제공하기 때문에 제한된 자원을 가진 모바일이나 블록체인과 같은 환경에서 널리 사용된다. | ||
ECC (Elliptic Curve Cryptography) is a system based on the Elliptic Curve Discrete Logarithm Problem (ECDLP), which is a type of discrete logarithm problem on elliptic curves. It provides a high level of security with relatively short key lengths compared to other protocols, making it popular in environments with limited resources, such as mobile devices and blockchain. | ||
|
||
## Comparison with [[Symmetric key encryption]] | ||
Refer to [[Symmetric key encryption#Comparison with Asymmetric key encryption]] | ||
## Comparison with Symmetric Key Encryption | ||
|
||
Refer to the section "Comparison with Asymmetric Key Encryption" under Symmetric Key Encryption. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Diffie-Hellman 시스템은 두 사용자가 공개적으로 키를 교환하여 공통의 비밀 키를 생성할 수 있도록 하는 키 교환 프로토콜이다. Whitfield Diffie와 Martin Hellman이 1976년에 개발한 시스템으로 대칭키 암호 시스템에서 키 교환 문제를 해결하기 위해 고안되었다. 두 사용자는 서로의 공개 키를 사용하여 비밀 키를 생성하지만, 이 과정에서 비밀 키 자체는 교환되지 않는다. Diffie-Hellman은 [[Discrete logarithm problem]](DLP)에 기반한 보안성을 가지고 있다. | ||
The Diffie-Hellman system is a key exchange protocol that allows two users to generate a shared secret key by exchanging keys publicly. Developed by Whitfield Diffie and Martin Hellman in 1976, this system was designed to solve the key exchange problem in symmetric key cryptosystems. Although the users generate the secret key using each other's public keys, the secret key itself is never exchanged. The security of Diffie-Hellman is based on the [Discrete Logarithm Problem](DLP). | ||
|
||
다음은 Diffie-Hellman 프로토콜의 키 교환 방식을 나타내는 그림이다. | ||
![[diffie_hellman(1).png]] | ||
1. Alice와 Bob의 프라이빗키는 각각 $Z_p^*$의 원소(Alice: a, Bob: b)이고 퍼블릭키는 사전에 공유된 generator $g$에 각각 $g^a, g^b$ 연산을 한 결과이다. | ||
2. 서로의 퍼블릭키를 교환하고 각자의 프라이빗키를 위 그림과 같이 적용하면 서로 같은 $g^{ab}$라는 결과가 나오고 이것이 Alice와 Bob의 SHK(공유키)가 된다. (KDF: Dey Derivation Function으로서 해싱과 비트연산을 적용하여 암호키를 생성하는 함수) | ||
3. 여기서 Eve가 $A,B$ 값을 알아도 SHK를 알아낼 수 없다. 즉, $a$를 알면 공유받은 $B$로부터 $B^a = g^{ab}$ 를 쉽게 구할 수 있지만 $g^a, g^b$값을 안다고 해도 이것으로부터 $g^{ab}$값을 알아내는 것은 매우 어렵다. | ||
Below is a diagram illustrating the key exchange process of the Diffie-Hellman protocol. | ||
|
||
![Diffie-Hellman Key Exchange Process](diffie_hellman(1).png) | ||
|
||
1. **Private and Public Keys**: Alice and Bob each have private keys that are elements of \(Z_p^*\) (Alice's private key is \(a\), and Bob's private key is \(b\)). Their public keys are the results of computing \(g^a\) and \(g^b\) using a pre-shared generator \(g\). | ||
|
||
2. **Exchange and Derivation of Shared Key**: They exchange their public keys. By applying their own private keys as shown in the diagram, both arrive at the same result, \(g^{ab}\), which becomes their shared secret key (SHK). The Key Derivation Function (KDF) is used to apply hashing and bit operations to generate the cryptographic key from the shared key. | ||
|
||
3. **Security Against Interception**: Even if Eve, a potential eavesdropper, knows the values of \(A\) and \(B\), she cannot deduce the SHK. While knowing \(a\) allows one to easily compute \(B^a = g^{ab}\) from the shared \(B\), it is extremely difficult to compute \(g^{ab}\) from just knowing \(g^a\) and \(g^b\) without the private keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ECDSA는 [[ECDLP]]를 활용하는 키교환 방식으로 비트코인, 이더리움 등의 블록체인과 공인인증서 등에서 가장 널리 쓰이는 디지털서명 알고리즘이다. | ||
ECDSA is a key exchange method that utilizes the [Elliptic Curve Discrete Logarithm Problem (ECDLP)] and is the most widely used digital signature algorithm in blockchain technologies like Bitcoin and Ethereum, as well as in digital certificates. | ||
|
||
아래 그림은 ECDSA의 세가지 알고리즘을 보이고 있다. 개인키와 전자서명 $r,s$ , 메시지 해시 등은 모두 scalar 값이며 이 값들을 $G$ 혹은 공개키와 다수의 곱연산을 하게된다. | ||
The diagram below illustrates the three main algorithms of ECDSA. The private key, digital signature components r and s , and the message hash are all scalar values, and these values are subjected to multiple multiplication operations with G (the base point) or the public key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
ELGamal 시스템은 [[Discrete logarithm problem]]를 활용한다. | ||
The ElGamal system utilizes the [Discrete Logarithm Problem]. | ||
|
||
Elgamal 암호의 키생성: | ||
Key Generation in ElGamal Encryption: | ||
|
||
- 큰 소수 $p$를 선정하고 $Zp$ 위의 원시원소 $g$와 $p$ 를 공개한다. | ||
- $Zp$위의 임의의 원소 $d$를 선택하여 $e \equiv g^d \mod p$ 를 계산한다. ($e$ : 공개키, $d$ : 개인키) | ||
• A large prime number p is selected, and a primitive root g on Z_p and p are made public. | ||
• An arbitrary element d on Z_p is chosen, and \( e \equiv g^d \mod p \) is calculated. ( e is the public key, and d is the private key) | ||
|
||
메시지 $M$의 암호화 과정: | ||
Encryption Process of Message M : | ||
|
||
- $r \in _R Zp$ ($Zp$ 상에서 임의의 난수 $r$ 을 생성) | ||
- 수신자의 공개키 $e$ 로 $K \equiv e^r \mod p$ 를 계산한다. | ||
- $C_1 \equiv g^r \mod p, \; C_2 \equiv KM \mod p$ 를 계산한다. | ||
- 암호문은 $C=(C_1, C2)$ 이다. | ||
• r \in_R Z_p (Generate a random number r on Z_p ) | ||
• Calculate \( K \equiv e^r \mod p \) using the recipient’s public key e . | ||
• Compute \( C_1 \equiv g^r \mod p \) and \( C_2 \equiv KM \mod p \). | ||
• The ciphertext is C = (C_1, C_2) . | ||
|
||
복호화 과정: | ||
Decryption Process: | ||
|
||
- 개인키 $d$ 를 이용하여 $K \equiv {C_1}^d \mod p$ 를 계산한다. | ||
- 위에서 구한 $K$를 이용하여 $M \equiv C_2/K \mod p$ 를 계산하여 복호화한다. | ||
• Use the private key d to calculate \( K \equiv {C_1}^d \mod p \). | ||
• Using the K obtained above, decrypt by calculating \( M \equiv C_2/K \mod p \). | ||
|
||
> RSA는 같은 메시지를 암호화하면 항상 같은 암호문이 생성되는 반면, Elgamal 시스템은 난수를 이용하기 때문에 같은 메시지를 암호화해도 매번 다른 암호문이 생성된다. 따라서 상용시스템에서는 [_RSA-OAEP_](https://ko.wikipedia.org/wiki/OAEP)를 사용한다. 또한, Elgamal 시스템은 RSA보다 작은 개인키 사이즈로도 안전성이 보장된다는 장점이 있다. | ||
In RSA, encrypting the same message always produces the same ciphertext, whereas the ElGamal system uses random numbers, resulting in different ciphertexts for the same message each time it is encrypted. Therefore, RSA-OAEP is used in commercial systems. Additionally, the ElGamal system offers security with smaller private key sizes compared to RSA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
## Intuition | ||
|
||
$y = sx$인 직선을 고려하자. 여기서 $s$는 비밀 키이다. 이 직선 위의 점 $(a_i, b_i)$가 주어지면, 비밀 $s$를 쉽게 복원할 수 있다. Learning With Errors (LWE) 문제는 세 가지 조건을 추가하여 이 문제를 확장한 것이다: | ||
Consider a line y = sx , where s is the secret key. If a point (a_i, b_i) on this line is given, it is easy to recover the secret s . The Learning With Errors (LWE) problem extends this problem by adding three conditions: | ||
|
||
1. 유한체 $Z_q$ 위에서. | ||
1. Over a finite field \mathbb{Z}_q . | ||
2. Both a_i and s are vectors ( s \cdot x denotes the dot product). | ||
3. A line with errors ( b_i = a_i \cdot s + e_i ). | ||
|
||
2. $a_i$와 $s$는 벡터이다 ($s \cdot x$는 내적이다). | ||
LWE is computationally difficult, assuming the hardness of certain lattice problems (e.g., GapSVP and SIVP). | ||
|
||
3. 오류가 있는 직선 ($b_i = a_i \cdot s + e_i$). | ||
## Definition | ||
|
||
LWE는 몇 가지 격자 문제(예: GapSVP 및 SIVP)의 난이도를 가정할 때 계산하기 어렵다. | ||
Let q be a prime, and n \in \mathbb{Z}_{>0} . Let a_i \in \mathbb{Z}_q^n be a set of uniformly random vectors, e_i \in \mathbb{Z}_q be a set of small random errors, and s \in \mathbb{Z}_q^n be a small secret vector. Then, b_i = a_i \cdot s + e_i \in \mathbb{Z}_q . Given polynomially many pairs (b_i, a_i), find s . | ||
|
||
## 정의 | ||
|
||
$q$가 소수이고 $n \in \mathbb{Z}_{>0}$라고 하자. $a_i \in \mathbb{Z}_q^n$는 균등한 랜덤 벡터 집합이고, $e_i \in \mathbb{Z}_q$는 작은 랜덤 미지수 집합이며, $s \in \mathbb{Z}_q^n$는 작은 미지수 벡터이고, $b_i = a_i \cdot s + e_i \in \mathbb{Z}_q$이다. 다항식 개수만큼의 쌍 $(b_i, a_i)$가 주어졌을 때, $s$를 찾아라. | ||
|
||
LWE의 보안은 $q$, $n$, $e$와 $s$의 분포에 의존한다. $q$가 작고, $n$이 크고, $e$와 $s$가 클수록 더 나은 보안을 제공한다. 보안을 측정하기 위해 lattice-estimator를 사용할 수 있다. | ||
The security of LWE depends on the parameters q , n , and the distributions of e and s . Smaller q , larger n , and larger e and s provide better security. The lattice-estimator can be used to measure security. |
8 changes: 5 additions & 3 deletions
8
content/Basic Cryptography/Module Learning with Errors(MLWE).md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
## 정의 | ||
$\Phi$가 차수 $d$인 기약 다항식이라고 하자. $a \in (\mathbb{Z}_q[X]/\Phi(X))^k$는 균등 랜덤 다항식이고, $e \in \mathbb{Z}_q[X]/\Phi(X)$는 작은 오류 다항식이며, $s \in (\mathbb{Z}_q[X]/\Phi(X))^k$는 작은 비밀 다항식이다. 쌍 $(as + e, a)$는 MLWE 쌍이다. | ||
## Definition | ||
|
||
Let $\Phi$ be an irreducible polynomial of degree $d$. Let $a \in (\mathbb{Z}_q[X]/\Phi(X))^k$ be a uniformly random polynomial, $e \in \mathbb{Z}_q[X]/\Phi(X)$ be a small error polynomial, and $s \in (\mathbb{Z}_q[X]/\Phi(X))^k$ be a small secret polynomial. The pair $(as + e, a)$ is an MLWE pair. | ||
|
||
## Remarks on MLWE | ||
[[Learning with Errors(LWE)]]는 $d = 1$인 MLWE이다. RLWE는 $k = 1$인 MLWE이다. NIST PQC 1차 라운드 수상자 중 유일한 PKE/KEM인 CRYSTALS-Kyber는 MLWE 기반 키 캡슐화 스킴이다. | ||
|
||
[[Learning with Errors (LWE)]] is MLWE with $d = 1$. RLWE is MLWE with $k = 1$. CRYSTALS-Kyber, the only PKE/KEM among the NIST PQC round 1 winners, is an MLWE-based key encapsulation scheme. |
Oops, something went wrong.