Skip to content

Commit

Permalink
Translate (#54)
Browse files Browse the repository at this point in the history
* Add reference of Notations.md

* Translate Documents

* translate Polynomial theorem.md

* delete ZKP images in i18n/ko

* Translate Privacy-Enhancing-Technologies.md

* Translate MPC docs

* Translate FHE docs
  • Loading branch information
yijun-lee authored Aug 3, 2024
1 parent 95a04b0 commit ca0819e
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 190 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## BFV (Brakerski-Fan-Vercauteren) 스킴
## BFV (Brakerski-Fan-Vercauteren) Scheme

BFV 스킴은 [[BGV]]와 유사하지만, [[Learning with Errors(LWE)]] 문제에 기반하고 있습니다. Fan과 Vercauteren이 BGV 스킴을 개선하여 제안한 것입니다.
The BFV scheme is similar to the [[BGV]] scheme but is based on the [[Learning with Errors (LWE)]] problem. It was proposed by Fan and Vercauteren as an improvement to the BGV scheme.

### 주요 구성 요소
### Key Components

1. **비밀키 생성 (Secret Key Generation)**: 비밀키 $s$는 다항식 링 $\mathbb{Z}_q[X]/(X^N + 1)$에서 선택됩니다.
2. **공개키 생성 (Public Key Generation)**: 공개키는 $(a, b = -a \cdot s + e)$로 구성됩니다.
3. **암호화 (Encryption)**: 메시지 $m \in \mathbb{Z}_t[X]/(X^N + 1)$을 암호화하기 위해 랜덤 다항식 $r$을 선택하고, $c = (a \cdot r + e_1, b \cdot r + e_2 + \Delta \cdot m)$로 암호문을 생성합니다.
4. **복호화 (Decryption)**: 암호문 $c$를 복호화하여 $m' = \left\lceil \frac{c_2 + s \cdot c_1}{\Delta} \right\rfloor \pmod{t}$를 계산합니다. 여기서 $\Delta$는 스케일링 인자입니다.
1. **Secret Key Generation**: The secret key $s$ is chosen from the polynomial ring $\mathbb{Z}_q[X]/(X^N + 1)$.
2. **Public Key Generation**: The public key is composed of $(a, b = -a \cdot s + e)$.
3. **Encryption**: To encrypt a message $m \in \mathbb{Z}_t[X]/(X^N + 1)$, a random polynomial $r$ is selected, and the ciphertext $c = (a \cdot r + e_1, b \cdot r + e_2 + \Delta \cdot m)$ is generated.
4. **Decryption**: To decrypt the ciphertext $c$, compute $m' = \left\lceil \frac{c_2 + s \cdot c_1}{\Delta} \right\rfloor \pmod{t}$. Here, $\Delta$ is the scaling factor.

### 동형 연산
### Homomorphic Operations

BFV 스킴도 덧셈과 곱셈에 대해 동형성을 가집니다.
The BFV scheme also supports homomorphism for addition and multiplication.

- **동형 덧셈**: $c = c' + c'' = (c'_1 + c''_1, c'_2 + c''_2)$
- **동형 곱셈**: $c = c' \cdot c''$
- **Homomorphic Addition**: $c = c' + c'' = (c'_1 + c''_1, c'_2 + c''_2)$
- **Homomorphic Multiplication**: $c = c' \cdot c''$
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## BGV (Brakerski-Gentry-Vaikuntanathan) 스킴
## BGV (Brakerski-Gentry-Vaikuntanathan) Scheme

BGV 스킴은 브라커스키, 젠트리, 바이쿤타나탄이 개발한 스킴으로, [[Ring Learning with Errors(RLWE)]] 문제에 기반한 동형암호 스킴입니다.
The BGV scheme, developed by Brakerski, Gentry, and Vaikuntanathan, is a homomorphic encryption scheme based on the [[Ring Learning with Errors (RLWE)]] problem.

### 주요 구성 요소
### Key Components

1. **비밀키 생성 (Secret Key Generation)**: 비밀키 $s$는 다항식 링 $\mathbb{Z}_q[X]/(X^N + 1)$에서 선택됩니다.
2. **공개키 생성 (Public Key Generation)**: 공개키는 비밀키를 사용하여 생성되며, 두 개의 다항식 $(a, b = -a \cdot s + e)$로 구성됩니다. 여기서 $a$는 무작위로 선택된 다항식이고, $e$는 작은 잡음(오차)입니다.
3. **암호화 (Encryption)**: 메시지 $m \in \mathbb{Z}_t[X]/(X^N + 1)$를 암호화하기 위해 랜덤 다항식 $r$을 선택하고, 암호문 $c = (c_1, c_2) = (a \cdot r + e_1, b \cdot r + e_2 + m)$을 생성합니다.
4. **복호화 (Decryption)**: 암호문 $c$를 복호화하기 위해 $m' = c_2 + s \cdot c_1 \pmod{q}$을 계산합니다. 여기서 $m' \approx m$이 됩니다.
1. **Secret Key Generation**: The secret key $s$ is chosen from the polynomial ring $\mathbb{Z}_q[X]/(X^N + 1)$.
2. **Public Key Generation**: The public key is generated using the secret key and consists of two polynomials $(a, b = -a \cdot s + e)$, where $a$ is a randomly chosen polynomial and $e$ is a small noise (error).
3. **Encryption**: To encrypt a message $m \in \mathbb{Z}_t[X]/(X^N + 1)$, a random polynomial $r$ is selected, and the ciphertext $c = (c_1, c_2) = (a \cdot r + e_1, b \cdot r + e_2 + m)$ is generated.
4. **Decryption**: To decrypt the ciphertext $c$, compute $m' = c_2 + s \cdot c_1 \pmod{q}$. Here, $m' \approx m$.

### 동형 연산
### Homomorphic Operations

BGV 스킴은 덧셈과 곱셈 모두에 대해 동형성을 가집니다.
The BGV scheme supports homomorphism for both addition and multiplication.

- **동형 덧셈**: 두 암호문 $c' = (c'_1, c'_2)$$c'' = (c''_1, c''_2)$에 대해 $c = c' + c'' = (c'_1 + c''_1, c'_2 + c''_2)$로 수행되며, 이는 $m = m' + m''$에 대응합니다.
- **동형 곱셈**: 두 암호문 $c' = (c'_1, c'_2)$$c'' = (c''_1, c''_2)$에 대해 $c = c' \cdot c'' = (c'_1 \cdot c''_1, c'_2 \cdot c''_2)$로 수행되며, 이는 $m = m' \cdot m''$에 대응합니다.
- **Homomorphic Addition**: For two ciphertexts $c' = (c'_1, c'_2)$ and $c'' = (c''_1, c''_2)$, addition is performed as $c = c' + c'' = (c'_1 + c''_1, c'_2 + c''_2)$, which corresponds to $m = m' + m''$.
- **Homomorphic Multiplication**: For two ciphertexts $c' = (c'_1, c'_2)$ and $c'' = (c''_1, c''_2)$, multiplication is performed as $c = c' \cdot c'' = (c'_1 \cdot c''_1, c'_2 \cdot c''_2)$, which corresponds to $m = m' \cdot m''$.
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
# Bootstrapping in Homomorphic Encryption
**Bootstrapping**은 암호화된 상태에서 시크릿 키를 사용하여 노이즈가 많은 암호문을 노이즈가 적은 암호문으로 변환하는 과정입니다. 이를 통해 암호화된 데이터를 동형적으로 복호화하여 노이즈를 줄이고, 추가적인 동형 연산을 가능하게 합니다. 부트스트래핑은 많은 계산 자원이 필요하며, 동형 암호화(FHE) 기술의 핵심적인 요소입니다.

## 문제: Modulus 감소
FHE에서는 각 동형 곱셈이 Modulus를 소모하며, Modulus는 한정된 자원입니다.
Modulus가 소진되면 더 이상의 곱셈이 불가능해집니다.
부트스트래핑은 Modulus를 "리프팅"하여 이 문제를 해결합니다.
**Bootstrapping** is the process of converting a noisy ciphertext into a less noisy ciphertext using a secret key while it remains encrypted. This process allows the noise in encrypted data to be reduced through homomorphic decryption, enabling further homomorphic operations. Bootstrapping is a resource-intensive process and is a crucial component of fully homomorphic encryption (FHE) technology.

## 부트스트래핑의 정의
$ct = (b, a) \in R_q^2$가 평문 $m \in R$을 암호화한 CKKS 암호문이라고 할 때, 부트스트래핑 $BTS : R_q^2 \to R_Q^2$는 암호문의 Modulus를 증가시키면서 기본 평문을 대략적으로 유지합니다.
즉, $BTS(ct) \in R_Q^2$는 평문 $pt' \approx pt$를 암호화합니다.
## Problem: Modulus Exhaustion

In FHE, each homomorphic multiplication consumes some of the modulus, which is a limited resource. Once the modulus is exhausted, no further multiplications are possible. Bootstrapping solves this issue by "lifting" the modulus.

## Definition of Bootstrapping

Given a CKKS ciphertext $ct = (b, a) \in R_q^2$ that encrypts a plaintext $m \in R$, bootstrapping $BTS : R_q^2 \to R_Q^2$ increases the modulus of the ciphertext while approximately maintaining the original plaintext. Thus, $BTS(ct) \in R_Q^2$ encrypts a plaintext $pt' \approx pt$.

## Steps of Bootstrapping

## 부트스트래핑의 단계
1. **Slots-to-Coefficients (StC):**
- 암호문 슬롯을 다항식 계수로 변환합니다.
- 출력: $ct' = Enc(\Delta \cdot z(X)) \in R_{q0}^2$.
- Convert ciphertext slots into polynomial coefficients.
- Output: $ct' = Enc(\Delta \cdot z(X)) \in R_{q0}^2$.

2. **Modulus Raising (ModRaise):**
- 기본 Modulus $q0$의 작은 배수를 추가하여 Modulus를 증가시킵니다.
- 출력: $ct'' = Enc(\Delta \cdot z(X) + q0 \cdot I(X))$ 여기서 $I(X) \in R$은 작은 값입니다.
- Increase the modulus by adding small multiples of the original modulus $q0$.
- Output: $ct'' = Enc(\Delta \cdot z(X) + q0 \cdot I(X))$, where $I(X) \in R$ is a small value.

3. **Coefficients-to-Slots (CtS):**
- 다항식 계수를 다시 슬롯으로 변환합니다.
- 출력: $ct''' = Enc \circ Ecd(z + (q0/\Delta) \cdot I)$.
- Convert polynomial coefficients back into slots.
- Output: $ct''' = Enc \circ Ecd(z + (q0/\Delta) \cdot I)$.

4. **Homomorphic Modular Reduction (EvalMod):**
- 추가된 배수 $I$를 제거하여 원하는 결과를 얻습니다.
- 출력: $Enc \circ Ecd(z) \in R_Q^2$
- Remove the added multiples $I$ to obtain the desired result.
- Output: $Enc \circ Ecd(z) \in R_Q^2$.

## Modulus Raising
$ct = (b, a) \in R_q^2$가 평문 $pt \in R$을 암호화한다고 가정합니다.
$[b]_q$와 $[a]_q$를 $b$와 $a$의 대표값으로 선택합니다.
그러면 다음과 같은 관계가 성립합니다:

Suppose $ct = (b, a) \in R_q^2$ encrypts a plaintext $pt \in R$. Let $[b]_q$ and $[a]_q$ be the representatives of $b$ and $a$. The following relationship holds:
- $ [b]_q + [a]_q \cdot s \equiv_q pt $
- 따라서, $ [b]_q + [a]_q \cdot s = pt + q \cdot I $
- $I \in R$이며 $\|I\|_\infty \leq (h + 1)/2$입니다.
Modulus Raising을 통해 $ct$는 $pt + q \cdot I$를 암호화한 요소로 간주됩니다.
- Thus, $ [b]_q + [a]_q \cdot s = pt + q \cdot I $
- $I \in R$, and $\|I\|_\infty \leq (h + 1)/2$.

Through Modulus Raising, $ct$ is regarded as encrypting $pt + q \cdot I$.

## Homomorphic Discrete Fourier Transform (DFT)
DFT 매트릭스 $U$는 다음과 같이 분해할 수 있습니다:

The DFT matrix $U$ can be decomposed as:
- $ U = D_{\log(N)-1} D_{\log(N)-2} \cdots D_1 P $

여기서 $D_i$는 버터플라이 매트릭스이며, $P$는 순열 매트릭스입니다.
효율성을 위해 정확한 DFT 대신 $P$를 제외한 비트 반전 DFT $U P^{-1}$를 사용합니다.
Where $D_i$ is a butterfly matrix, and $P$ is a permutation matrix. For efficiency, the bit-reversed DFT $U P^{-1}$, excluding $P$, is used instead of the exact DFT.

## Approximate Modular Reduction
모듈러 감소 함수를 근사하기 위해 다항식을 사용합니다.
일반적인 접근 방식은 삼각 함수와 다항식 근사 알고리즘을 사용하는 것입니다. 예를 들어:
- $ \text{Modular Reduction by 1 and } \sin(2\pi x)/2\pi $
이 함수들은 정수 포인트 근처에서 유사하게 작동하여 Modular 1과 사인 함수 사이의 간극을 줄이는 데 도움이 됩니다.

Polynomials are used to approximate the modular reduction function. A common approach is to use trigonometric functions and polynomial approximation algorithms. For example:
- **Modular Reduction by 1 and** $\sin(2\pi x)/2\pi$

These functions operate similarly near integer points, helping to close the gap between Modular 1 and the sine function.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## CGGI (Cheon-Gentry-Goldwasser-Ishai) 스킴
## CGGI (Cheon-Gentry-Goldwasser-Ishai) Scheme

CGGI 스킴은 Cheon, Gentry, Goldwasser, Ishai가 제안한 스킴으로, [[Bootstrapping]]을 통해 효율성을 높인 동형암호 스킴입니다.
The CGGI scheme, proposed by Cheon, Gentry, Goldwasser, and Ishai, is a homomorphic encryption scheme that enhances efficiency through [[bootstrapping]].

### 주요 구성 요소
### Key Components

1. **비밀키 생성 (Secret Key Generation)**: 비밀키는 LWE 기반 문제에서 생성됩니다.
2. **공개키 생성 (Public Key Generation)**: 공개키는 비밀키와 LWE 샘플로 구성됩니다.
3. **암호화 (Encryption)**: 메시지를 암호화하여 LWE 암호문을 생성합니다.
4. **복호화 (Decryption)**: 암호문을 복호화하여 원래 메시지를 복원합니다.
1. **Secret Key Generation**: The secret key is generated based on the LWE (Learning with Errors) problem.
2. **Public Key Generation**: The public key is composed of the secret key and LWE samples.
3. **Encryption**: Encrypts messages to generate LWE ciphertexts.
4. **Decryption**: Decrypts the ciphertexts to restore the original message.

### 동형 연산
### Homomorphic Operations

CGGI 스킴은 효율적인 부트스트래핑을 통해 복잡한 연산을 지원합니다.
The CGGI scheme supports complex operations efficiently through effective bootstrapping.

- **동형 덧셈**: LWE 샘플의 덧셈으로 수행됩니다.
- **동형 곱셈**: LWE 샘플의 곱셈으로 수행되며, 부트스트래핑을 통해 효율성을 유지합니다.
- **Homomorphic Addition**: Performed through the addition of LWE samples.
- **Homomorphic Multiplication**: Executed through the multiplication of LWE samples while maintaining efficiency via bootstrapping.
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
# CKKS 암호화 기법
## 정의
CKKS (Cheon-Kim-Kim-Song)는 복잡한 실수 계산을 효율적으로 수행할 수 있도록 설계된 완전 동형 암호화(FHE) 기법입니다. 이는 고정밀 실수 연산을 지원하고, 다수의 데이터 요소를 한 번에 처리할 수 있는 병렬 연산 기능(SIMD)을 제공합니다. CKKS는 기계 학습과 통계학에서 주로 사용되며, 이들 분야에서의 많은 연산이 근사 연산이기 때문에 다른 암호화 방식보다 더 유리합니다.
# CKKS Encryption Scheme

## CKKS의 주요 특징
### 인코딩과 디코딩
- CKKS에서는 메시지를 암호화하기 전에 메시지를 복소수 벡터 형태로 인코딩합니다. 이 인코딩 과정은 메시지를 복소수 공간($CN/2$)에서 다항식 공간($R[X]/(X^N+1)$)으로 변환합니다. 인코딩 함수는 $Ecd(z) = \lfloor \Delta \cdot iDFT(z) \rceil$이며, 디코딩 함수는 $Dcd(p(X)) = \frac{1}{\Delta} \cdot DFT(p(X))$입니다. 여기서 $\Delta$는 스케일링 팩터입니다.
- 인코딩 과정 중에는 rounding errors가 발생할 수 있으며, 이를 줄이기 위해 적절한 $\Delta$ 값을 선택합니다.
## Definition

### 암호화와 복호화
- CKKS의 암호화는 [[Ring Learning with Errors(RLWE)]] 문제를 기반으로 합니다. 메시지를 다항식 공간에서 암호화하여 사이퍼텍스트를 생성합니다. 암호화된 사이퍼텍스트는 $(b, a)$ 형태로 표현되며, 여기서 $b$와 $a$는 각각 랜덤 다항식과 에러를 포함합니다.
- 복호화는 이 사이퍼텍스트를 사용하여 원래 메시지를 복원하는 과정입니다. 복호화 함수는 $[b + a \cdot s]_{q0}$로 정의되며, 여기서 $s$는 비밀 키입니다.
The CKKS (Cheon-Kim-Kim-Song) scheme is a fully homomorphic encryption (FHE) technique designed to efficiently perform complex real number computations. It supports high-precision real number operations and provides parallel processing capabilities (SIMD) that allow multiple data elements to be processed simultaneously. CKKS is primarily used in machine learning and statistics, where many operations are approximate, making it more advantageous than other encryption schemes.

### 기본 연산
- CKKS는 덧셈과 곱셈과 같은 기본적인 동형 연산을 지원합니다. 두 사이퍼텍스트 $(b1, a1)$와 $(b2, a2)$의 덧셈은 $(b1 + b2, a1 + a2)$로 정의되며, 곱셈은 $(b1b2, a1b2 + a2b1, a1a2)$로 정의됩니다. 이러한 연산은 암호화된 상태에서 직접 수행되며, 결과는 여전히 암호화된 상태로 유지됩니다.
## Key Features of CKKS

### Key Switching과 Relinearization
- Key Switching은 암호화된 메시지를 다른 비밀 키로 다시 암호화하는 과정입니다. 이를 통해 비밀 키의 변경 없이도 암호화된 데이터를 안전하게 공유할 수 있습니다.
- Relinearization은 사이퍼텍스트의 길이를 줄이는 과정으로, 이는 연산 중 키의 크기 증가 문제를 해결하는 데 사용됩니다. 이를 통해 연산 효율성을 유지하면서 동형 연산을 계속 수행할 수 있습니다.
### Encoding and Decoding

- In CKKS, messages are encoded into complex vector form before encryption. This encoding process transforms messages from the complex space ($\mathbb{C}^{N/2}$) to the polynomial space ($R[X]/(X^N+1)$). The encoding function is given by $Ecd(z) = \lfloor \Delta \cdot iDFT(z) \rceil$, and the decoding function is $Dcd(p(X)) = \frac{1}{\Delta} \cdot DFT(p(X))$. Here, $\Delta$ is a scaling factor.
- Rounding errors can occur during the encoding process, and an appropriate $\Delta$ value is chosen to minimize these errors.

### Encryption and Decryption

- CKKS encryption is based on the [[Ring Learning with Errors (RLWE)]] problem. Messages are encrypted in the polynomial space to generate ciphertexts. The encrypted ciphertext is represented as $(b, a)$, where $b$ and $a$ include a random polynomial and an error, respectively.
- Decryption is the process of using this ciphertext to restore the original message. The decryption function is defined as $[b + a \cdot s]_{q0}$, where $s$ is the secret key.

### Basic Operations

- CKKS supports basic homomorphic operations such as addition and multiplication. The addition of two ciphertexts $(b1, a1)$ and $(b2, a2)$ is defined as $(b1 + b2, a1 + a2)$, and multiplication is defined as $(b1b2, a1b2 + a2b1, a1a2)$. These operations are performed directly on encrypted data, and the result remains encrypted.

### Key Switching and Relinearization

- Key Switching is the process of re-encrypting encrypted messages with a different secret key. This allows encrypted data to be safely shared without changing the secret key.
- Relinearization is the process of reducing the length of the ciphertext, which is used to address the problem of key size increase during operations. This allows for continued homomorphic operations while maintaining computational efficiency.

### Rescaling
- Rescaling은 곱셈 연산 후 증가한 스케일링 팩터를 줄이는 과정입니다. 이는 $\Delta^2$로 증가한 스케일링 팩터를 다시 $\Delta$ 수준으로 낮추어 계산 정확도를 유지합니다.

## 응용 분야
- **기계 학습:** CKKS는 기계 학습에서 사용되는 다수의 연산이 근사 연산이라는 점에서 매우 적합합니다. 다수의 데이터 포인트를 병렬로 처리할 수 있어 효율성을 극대화할 수 있습니다.
- **통계 분석:** 통계학에서도 대규모 데이터셋에 대한 복잡한 실수 연산을 안전하게 수행할 수 있어 유용합니다. CKKS는 이러한 연산을 암호화된 상태에서 수행함으로써 데이터 프라이버시를 보장합니다.
- Rescaling is the process of reducing the increased scaling factor after multiplication operations. It reduces the scaling factor, which increased to $\Delta^2$, back to the $\Delta$ level to maintain computational accuracy.

## Applications

- **Machine Learning:** CKKS is very suitable for machine learning, where many operations are approximate. It maximizes efficiency by processing multiple data points in parallel.
- **Statistical Analysis:** It is also useful in statistics for securely performing complex real-number operations on large datasets. CKKS guarantees data privacy by performing these operations while the data remains encrypted.
Loading

0 comments on commit ca0819e

Please sign in to comment.