66
저작자표시-비영리-동일조건변경허락 2.0 대한민국 이용자는 아래의 조건을 따르는 경우에 한하여 자유롭게 l 이 저작물을 복제, 배포, 전송, 전시, 공연 및 방송할 수 있습니다. l 이차적 저작물을 작성할 수 있습니다. 다음과 같은 조건을 따라야 합니다: l 귀하는, 이 저작물의 재이용이나 배포의 경우, 이 저작물에 적용된 이용허락조건 을 명확하게 나타내어야 합니다. l 저작권자로부터 별도의 허가를 받으면 이러한 조건들은 적용되지 않습니다. 저작권법에 따른 이용자의 권리는 위의 내용에 의하여 영향을 받지 않습니다. 이것은 이용허락규약 ( Legal Code) 을 이해하기 쉽게 요약한 것입니다. Disclaimer 저작자표시. 귀하는 원저작자를 표시하여야 합니다. 비영리. 귀하는 이 저작물을 영리 목적으로 이용할 수 없습니다. 동일조건변경허락. 귀하가 이 저작물을 개작, 변형 또는 가공했을 경우 에는, 이 저작물과 동일한 이용허락조건하에서만 배포할 수 있습니다.

Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

저 시-비 리-동 조건 경허락 2.0 한민

는 아래 조건 르는 경 에 한하여 게

l 저 물 복제, 포, 전송, 전시, 공연 송할 수 습니다.

l 차적 저 물 성할 수 습니다.

다 과 같 조건 라야 합니다:

l 하는, 저 물 나 포 경 , 저 물에 적 허락조건 확하게 나타내어야 합니다.

l 저 터 허가를 러한 조건들 적 지 않습니다.

저 에 른 리는 내 에 하여 향 지 않습니다.

것 허락규약(Legal Code) 해하 쉽게 약한 것 니다.

Disclaimer

저 시. 하는 원저 를 시하여야 합니다.

비 리. 하는 저 물 리 적 할 수 없습니다.

동 조건 경허락. 하가 저 물 개 , 형 또는 가공했 경에는, 저 물과 동 한 허락조건하에서만 포할 수 습니다.

Page 2: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

이학석사 학위논문

Implementation of Ring-basedHomomorphic Encryption

( 환-기반 준동형 암호의 구현)

2014년 2월

서울대학교 대학원

수리과학부

전 민 영

Page 3: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Implementation of Ring-basedHomomorphic Encryption

( 환-기반 준동형 암호의 구현)

지도교수 천 정 희

이 논문을 이학석사 학위논문으로 제출함

2013년 12월

서울대학교 대학원

수리과학부

전 민 영

전 민 영의 이학석사 학위논문을 인준함

2013년 12월

위 원 장 (인)

부 위 원 장 (인)

위 원 (인)

Page 4: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Implementation of Ring-basedHomomorphic Encryption

A dissertationsubmitted in partial fulfillment

of the requirements for the degree ofMaster of Science

to the faculty of the Graduate School ofSeoul National University

by

Min Young Jun

Dissertation Director : Professor Jung Hee Cheon

Department of Mathematical SciencesSeoul National University

February 2014

Page 5: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

© 2013 Min Young Jun

All rights reserved.

Page 6: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Abstract

Fully homomorphic encryption(FHE) was introduced by Rivest, Adleman,and Dertouzos that can homomorphically evaluate encrypted data. However,it turned out to be insecure. After then, it has been presented lots of im-proved, modified FHE schemes for security and efficiency. One of them, aFHE of Lopez-Alt, Tromer, and Vaikuntanathan based on NTRU encryptionscheme of Hoffstein, Pipher, and Silverman, is more efficient than the otherschemes for a long time. Bos et al. suggest the more efficient FHE scheme,which is the fastest, than Lopez-Alt et al. They remove the DSPR assump-tion and modulus switching procedure. Thus, in this paper, we look into thescheme and implement its practical version and optimization. We provideexperimental results and analyze them as regards efficiency compared withoriginal one whose parameters are presented by authors.

Key words: BLLN, NTRU, FHE, ImplementationStudent Number: No. 2011-23211

i

Page 7: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Contents

Abstract i

1 Introduction 1

2 Preliminaries 32.1 Basic Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 The Ring-LWE Problem . . . . . . . . . . . . . . . . . . . . . 42.3 The DSPR Problem with LTV . . . . . . . . . . . . . . . . . . 5

3 Ring-based FHE Scheme 83.1 Leveled Somewhat Homomorphic Encryption . . . . . . . . . 8

3.1.1 BLLN Scheme . . . . . . . . . . . . . . . . . . . . . . 83.1.2 Security of the Scheme . . . . . . . . . . . . . . . . . . 13

3.2 Fully Homomorphic Encryption . . . . . . . . . . . . . . . . . 13

4 Implementation 164.1 Parameter Selection . . . . . . . . . . . . . . . . . . . . . . . 164.2 Implementation of the Scheme . . . . . . . . . . . . . . . . . . 17

4.2.1 Optimization . . . . . . . . . . . . . . . . . . . . . . . 18

5 Conclusion 22

Abstract (in Korean) 25

Acknowledgement (in Korean) 26

ii

Page 8: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 1

Introduction

Homomorphic encryption is a cryptosystem that one could add or multi-ply ciphertexts and another could decrypt the result. Partially homomor-phic cryptosystem can evaluate ciphertexts using only one operation withoutdecryption of them. e.g. RSA, ElGamal, Paillier. On the other hand, fullyhomomorphic encryption(FHE) introduced by Rivest, Adleman, and Der-touzos [12], which is not secure under the plaintext attack, can evaluate bothaddition and multiplication. Until 2009, the cryptosystem of Boneh, Goh andNissim [6] is the best homomorphic encryption that evaluates a number ofadditions and one multiplication.

In 2009, Craig Gentry suggested the first fully homomorphic encryptionusing ideal lattices, which can evaluate a unlimited number of additions andmultiplications of ciphertexts that consist of polynomials over a ring [4, 5]. Itis more secure than former one. Since the noise of ciphertext increase duringevaluations, he present how to modify the scheme so as to reduce the noisecalled bootstrapping process. Then the scheme can be converted into a fullyhomomorphic encryption. However, it is not efficient to apply the real world.After then, it has been presented that lots of improved, modified and anotherfully homomorphic encryption schemes which do not use ideal lattices.

FHE based on NTRU encryption of Hoffstein, Pipher, and Silverman [7]was presented by Lopez-Alt, Tromer, and Vaikuntanathan [9], which is more

1

Page 9: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 1. INTRODUCTION

efficient and secure than the others. Bos et al. [1] suggest the more efficientFHE scheme, which is the fastest of existing schemes, than Lopez-Alt et al.Their scheme removes the decisional small polynomial ratio assumption, itavoids modulus switching that makes the noise size diminish and its cipher-text is represented by a single ring element. They also provide a practicalversion with parameters and certain implementation results. In this paper,we investigate the BLLN scheme, implement it and analyze what makes thescheme faster and how faster than the other parameters of optimization pro-cedure.

In chapter 2, we provide a basic notation and some of the assumption com-posed of the RLWE and DSPR with LTV as aspects of security. In chapter 3,we introduce the BLLN scheme including how to be a leveled somewhat ho-momorphic encryption and fully homomorphic encryption. It might be seemto have two part according to the way of homomorphic multiplication. Inchapter 4, we set up parameters by proving security, implement it and carryout an optimization by defining and experimenting the Y ASHE.Discard.Furthermore, we present their results as tables and analyze them with opti-mization.

2

Page 10: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 2

Preliminaries

Fully homomorphic encryption can evaluate the addition and multiplica-tion homomorphically between ciphertexts as Enc(m1 +m2) = Enc(m1) +

Enc(m2) and Enc(m1 ·m2) = Enc(m1) ·Enc(m2) where Enc(mi) is the en-cryption of a message mi. According to some properties, it could be dividedinto somewhat homomorphic encryption, leveled fully homomorphic encryp-tion, and fully homomorphic encryption. Somewhat homomorphic encryp-tion is a special form of fully homomorphic encryption whose noise increasesduring the evaluating process where each ciphertext has low-degree homo-morphic operations. Leveled fully homomorphic encryption can evaluate theciphertexts with high-degree L, which sometimes called depth, and fully ho-momorphic encryption can evaluate them regardless of depth or degree.

2.1 Basic NotationWe will use a quotient ring R = Z[x]/(Φn(x)), where Φn(x) = xn + 1 is an-th cyclotomic polynomial with n a power of two. Denote a ℓ∞ norm of fby ∥f∥∞ = maxi|ai| : f =

∑n−1i=0 aix

i ∈ R.

Lemma 2.1.1 ( [5, 10]). Let n ∈ N, let ϕ(x) be a n-th cyclotomic polynomialof degree n and let R = Z[x]/(ϕ(x)). For any t, s ∈ R,

3

Page 11: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

∥s · t(modϕ(x))∥ ≤√n · ∥s∥ · ∥t∥

∥s · t(modϕ(x))∥∞ ≤√n · ∥s∥∞ · ∥t∥∞.

We say that δ = sup∥f · g∥∞/(∥f∥∞∥g∥∞) : f, g ∈ R is an expansionfactor of R which is equal to n by lemma 2.1.1. For a polynomial f ∈ R,denote the [f ]q ∈ R/qR = Zq/(x

n+1) by reducing coefficients into Zq whichhave the range (− q

2, q

2] for some integer q . For v, w ∈ Rn, the dot product is

defined by ⟨v,w⟩ =∑n

i=1 ui ·wi ∈ R where ui and wi are the ith componentof that. It also holds for the quotient ring Rq.

A discrete Gaussian distribution DZn,σ over Zn with parameter σ is aprobability distribution that assigns a probability proportional to exp(−π∥x∥2/σ2)

to each x ∈ Zn. It is a product distribution of n independent copies ofDZ,σ with mean 0 and standard deviation σ over the integers [8, 11]. It out-puts a (r

√n)-bounded polynomial with high probability. The distribution

χ = DZn,σ supported over R is called B-bounded if we have a B-boundedpolynomial for all f sampled from χ, i.e. ∥f∥∞ < B [9].

In this paper, we use a truncated Gaussian distribution χ that is B-bounded and statistically close to the discrete Gaussian. It takes samplewhose norm is less than B so as to restrict the noise bound and growthduring the homomorphic operations [9, 11].

2.2 The Ring-LWE ProblemIt has been suggested that lots of FHE schemes based on the RLWE assump-tion and reductions of the worst case to average case. Lyubaskevsky, Peikertand Regev describe the Ring learning with error problem (Ring-LWE) [11].It distinguishes which distribution is used for sampling and generates certainsamples. It is an extension of the learning with error problem called LWEthat based on a field rather than polynomial.

Definition 2.2.1 (Ring-LWE). For given security parameter λ, n = n(λ) ∈Z, let ϕ(x) = ϕn(x) ∈ Z[x] be a polynomial of degree n, let q = q(λ) ≥ 2

4

Page 12: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

be an integer, let R = Z/(ϕ(x)) and R/qR. Let χ = χ(λ) be a distributionover R. The Ring − LWEn,q,χ problem is to distinguish the following twodistributions. In the first distribution one samples (ai, bi) uniformly from R2

q .In second distribution one samples (ai, bi = ai · s + ei) ∈ R2

q where s fixedfor all samples is uniformly sampled from Rq, ai’s are uniformly from Rq andei’s are from an error distribution χ. The Ring-LWE assumption is that theRing-LWE problem is hard.

The shortest vector problem over the ideal lattice which is worst-caseproblem can be reduced to the Ring-LWE problem which is average-case.

Theorem 2.2.2 (Worst-case to Average-case Reduction [9, 11]). LetΦn(x) = xn + 1 be a n-th cyclotomic polynomial of degree which is a powerof two. Let R = Z/(xn + 1), q ≡ 1(mod2n) be a prime integer and χ be aB = ω(

√nlogn)-bounded distribution. Then there is a randomized reduction

from nω(1) · (q/B)-approximate worst-case SVP for ideal lattice over R toRing − LWEn,q,χ.

This theorem is useful for setting parameters.

2.3 The DSPR Problem with LTVA. Lopez-Alt, E. Tromer, and V. Vaikuntanathan [9] present a scheme whichis based on NTRU with modifications and multikey homomorphism. It isprovably secure based on standard problems in ideal lattices. The parame-ters, which is n, q, ϕ(x) of the degree n and χ, depend on security parameterλ. Its message space is 0, 1 and all operations are evaluated on the quotientring Rq = Zq/(ϕ(x)). We simply introduce LTV scheme as follows.

Key Generation: Sample f0, g from key distribution χ, then compute f =

[2f0 + 1]q such that f ≡ 1 (mod 2). If f is not invertible modulo q,re-sample f0. Let h = [2gf−1]q for inverse of f modulo q in R, then setthe secret key f and public key h.

5

Page 13: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

Encryption: Take a message m from 0, 1. Ciphertext is generated bycomputing c = [m + 2e + hs]q over the ring R with s, e sampled fromerror distribution χ.

Decryption: Compute m′ = [[fc]q]2 ∈ R with the secret key f .

It easy to check that as long as there is no wrap-around modulo q. Compute

[fc]q = [fm+ 2fe+ fhs]q = [fm+ 2fe+ 2gs]q.

If there is no wrap-around modulo q then

[fc]q(mod2) = [fm+ 2fe+ 2gs]q = [fm]q(mod2) = m.

This scheme is secure under the assumption of decisional small polynomialratio problem.We simply call it DSPR problem.

Definition 2.3.1 (DSPR Problem [1, 9]). For given security λ, let Φ(x) ∈Z[x] be a polynomial of degree n ∈ Z, let q ∈ Z be a prime integer. LetR = Z/(ϕ(x)), Rq = R/qR and let χ is a distribution over the ring R. allof them depend on λ. The DSPRn,q,χ problem is to distinguish between thefollowing two distributions. In first distribution, one samples h uniformlyat random over Rq. In second distribution, one samples h = a/b where a

and b are from the distribution χ. The DSPRn,q,χ assumption is that theDSPRn,q,χ problem is hard.

It holds only if σ >√q · poly(n) for cyclotomic polynomial ϕ(x) which

makes secure against unbounded adversaries.

Stehle and Steinfeld [13] propose a theorem for modified NTRU thatchanges the value 2 which could indicates the size of the message space tothe value t where the t is in the R×

q , and 2e to te.

Theorem 2.3.2 ( [1, 13]). Let Φn(x) = xn+1 be a n-th cyclotomic polynomialof degree which is a power of two ≥ 4 and it splits into k = k(q) irreduciblefactors modulo a prime q ≥ 5. Let R = Z[x]/(xn + 1) and Rq = R/qR.Let U(R×

q ) be the uniform distribution on R×q which is the set of invertible

6

Page 14: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

elements in Rq. Let χ = D×Zn,σ be the spherical discrete Gaussian distribution

on Rq, restricted to R×q . Let ϵ ∈ (0, 1/3), t ∈ R×

q . Let a and b are dependedon t with some distributions. Then the statistical distance a/b (mod q) andU(R×

q ) is bounded by

D =

220n · q−

⌊ϵk⌋k · 2n if σ ≥ 2n ·

√log(8nq) · q 1

2+ϵ

220n · q−2ϵn if σ ≥√

2n log(8nq) · q 1+kϵ2 and q ≥ (2n)

k1−2kϵ .

Then the DSPR problem is hard in Rq.

7

Page 15: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 3

Ring-based FHE Scheme

In this section we investigate the main scheme suggested by Bos et al. [1].In section 3.2, a leveled somewhat homomorphic encryption of the schemeis presented and subsection 3.1.1 describes the basic encryption, decryptionsystem and how the homomorphic operations are evaluated. In subsection3.1.2, its security is proven with some assumptions. In section 3.2, we providehow the scheme can be converted to a fully homomorphic encryption.

3.1 Leveled Somewhat Homomorphic Encryp-tion

Bos et al. present a couple of leveled somewhat homomorphic encryptionaccording to homomorphic multiplication with two different evaluation keys.This keys affect the complexity of the scheme such that we could estimatewhich method of homomorphic multiplication is fast. We present two partsof the scheme in parallel. They call them “Y ASHE” and “Y ASHE ′”. A subnotation “1” stands for Y ASHE and “2” stands for Y ASHE ′.

3.1.1 BLLN SchemeIn this subsection, we describe two parts of the scheme. The first part is abasic cryptosystem including how the encrypted messages can be decryptable

8

Page 16: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and the second part explains how the homomophic operation can be com-puted according to the noise bound by some calculations. The basic cryp-tosystem is composed of the key generation, encryption and decryption asfollows.

Key Generation: Sample f0, g from key distribution χkey, then computef = [tf0 + 1]q for 1 < t < q. If f is not invertible modulo q, re-samplef0. Let h = [tgf−1]q for inverse of f modulo q in R, then we can gener-ate a basic key set f, h which is comprised of a secret key and publickey respectively. Actually, the secret keys are f and f−1.The evaluation key set evk1, evk2 that is used for homomorphic mul-tiplication is computed by

evk1 = [f−1Pω,q (Dω,q (f)⊗Dω,q (f)) + e + h · s]q ∈ Rℓ3ω,q ,

evk2 = [Pω,q (f) + e + h · s]q ∈ Rℓω,q

where ℓω,q = ⌊logw q⌋+ 2,

Dω,q : R→ Rℓω,q , f 7→ ([f0]ω, [f1]ω, · · · , [fℓω,q−1]ω) = ([fi]ω)ℓω,q−1i=0

Pω,q : R→ Rℓω,q , f 7→ ([f ]q, [fω]q, · · · , [fωℓω,q−1]q) = ([fωi]q)ℓω,q−1i=0

for f =∑ℓω,q−1

i=0 fiωi with fi ∈ R.

If ω = 2, then these functions are called BitDecomp and PowerOFTwo [2].

As the function Dω,q and Pω,q are defined, the dot product between twovectors Dω,q(f) and Pω,q(g) is equal to the scalar product of f and g moduloq for some f, g ∈ R. This follows from the fact that

< Dω,q(f), Pω,q(g) >=

ℓω,q−1∑i=0

[fi]ω[gωi]q ≡ g

ℓω,q−1∑i=0

[fi]ωωi ≡ f · g (modq).

Encryption: For given integer t, we take a message from the space R/tR

whose element is of the form m + tR. Simply, it can be written by[m]t. Ciphertext that is the encryption of the message is computed by[⌊

q

t

⌋[m]t + e+ hs

]q

∈ R for s, e sampled from error distribution χerr.

9

Page 17: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

Decryption: Compute m =

[⌊t

q[fc]q

⌉]t

∈ R to obtain the message with

the secret key f .

The scheme is correctly decryptable when there exist v ∈ R such that∥v∥∞ <

(–q (mod t))

2for [fc]q = [[m]t + v]q, where =

⌊q

t

⌋. For some

a ∈ R,

t

q[fc]q =

t

q [m]t + v · t

q+ ta

= [m]t −q (mod t)

q[m]t + v · t

q+ ta.

If ∥v∥∞ <(–q (mod t))

2, then

∥∥∥∥ − q (mod t)

q[m]t + v · t

q

∥∥∥∥∞

<1

2. So, we

could be correctly decrypt the ciphertext.

The homomorphic operations consisted of addition and multiplication aredefined as follows.

Homomorphic Addition: Let c1, c2 ∈ R be encrypted message m1,m2 ∈R/tR. Compute an addition [c1 + c2]q that is a encrypted messagem1 +m2 modulo t by adding coefficients of ciphertext componentwise.

Although the size of inherent noise increases during this operation, which hasa sum of vi and r ∈ R where the r satisfies the equation as [m1]t + [m2]t =

[m1 + m2]t + r, ∥r∥∞ ≤ 1 and the ciphertext ci has a form of [mi]t + vi, itcould be decryptable.

Homomorphic Multiplication: Compute a ciphertext with multiplicationof two ciphertexts. Passing by a key-switching procedure, we obtain afinal ciphertext called an intermediate ciphertext, which might be cor-rectly decryptable, is obtained.

According to the method of multiplication, two ways of homomorphicencryption are presented with different ciphertexts c1,mul and c2,mul, inter-mediate ciphertexts. Through the key-switching procedure, the intermediate

10

Page 18: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

ciphertext becomes a ciphertext decrypted under an original secret key f

instead of f 2. The evaluation key evki is used for this procedure. If this stepis omitted, the ciphertext could not be decryptable since its noise is too largeto decrypt. Hence the key-switching process is essential and the intermediateciphertext exists at all times.

The ciphertext c1,mul which is a multiplication of two ciphertexts c1 andc2 is computed by

c1,mul =

[⌊t

qPω,q (c1)⊗ Pω,q (c2)

⌉]q

∈ Rℓ2ω,q ,

where the ⊗ is a tensor product which reduces the monomials ℓ2ω,q to(ℓω,q

2

).

The way of the key-switching is obtained by

[⟨Dω,q (c1,mul) , evk1⟩]q = [⟨Dω,q (c1,mul) , f−1Pω,q (Dω,q (f)⊗Dω,q (f)) + e + h · s⟩]q

= [f−1⟨Dω,q (c1,mul) , Pω,q (Dω,q (f)⊗Dω,q (f))⟩+ ⟨Dω,q (c1,mul) , e⟩+ h · ⟨Dω,q (c1,mul) , s⟩]q.

In this case, the final ciphertext c1,mul composed of a vector of polynomialsis

c1,mul = [⟨Dω,q (c1,mul) , evk1⟩]qthat could be correctly decryptable under the secret key f if

[fc1,mul]q = [⟨Dω,q (c1,mul) , Pω,q (Dω,q (f)⊗Dω,q (f))⟩+ f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q

= [(t/q) · ⟨Pω,q (c1)⊗ Pω,q (c2) , Dω,q (f)⊗Dω,q (f)⟩− rc + f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q

= [[m1m2]t + v1,mul + f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q= [[m1m2]t + v1,mul]q

where

rc =t

q⟨Pω,q(c1)⊗ Pω,q(c2), Dω,q(f)⊗Dω,q(f)⟩ − ⟨c1,mul, Dω,q(f)⊗Dω,q(f)⟩

=

⟨(t

qPω,q (c1)⊗ Pω,q (c2)

)−⌊t

qPω,q (c1)⊗ Pω,q (c2)

⌉, Dω,q (f)⊗Dω,q (f)

⟩,

11

Page 19: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and v1,mul satisfies under the condition of decryption.

Another ciphertext of the multiplication c2,mul which is a multiplicationof the ciphertexts c1 and c2 is computed by

c2,mul =

[⌊t

qc1c2

⌉]q

∈ R,

and the key-switching process is followed by

[⟨Dω,q (c2,mul) , evk2⟩]q = [⟨Dω,q (c2,mul) , Pω,q (f) + e + h · s⟩]q= [⟨Dω,q (c2,mul) , Pω,q (f)⟩+ ⟨Dω,q (c2,mul) , e⟩

+ h · ⟨Dω,q (c2,mul) , s⟩]q.

The final ciphertext c2,mul composed of a simply single polynomial is

c2,mul = [⟨Dω,q (c2,mul) , evk2⟩]q

that could be correctly decryptable under the secret key f if

[fc2,mul]q = [f⟨Dω,q (c2,mul) , Pω,q (f)⟩+ f⟨Dω,q (c2,mul) , e⟩+ gt⟨Dω,q (c2,mul) , s⟩]q= [f⟨Dω,q ((t/q)c1c2) , Pω,q (f)⟩ − f · rc + f⟨Dω,q (c2,mul) , e⟩

+ gt⟨Dω,q (c2,mul) , s⟩]q= [[m1m2]t + v2,mul + f⟨Dω,q (c2,mul) , e⟩+ gt⟨Dω,q (c2,mul) , s⟩]q= [[m1m2]t + v2,mul]q

where

f · rc = f ·⟨(

Dω,q

(t

qc1c2

))−⌊Dω,q

(t

qc1c2

)⌉, Pω,q (f)

⟩=

t

qf 2 · c1c2 − f 2·

⌊t

qc1c2

⌉and v2,mul satisfies under the condition of decryption.

12

Page 20: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

3.1.2 Security of the SchemeThe security of the scheme Y ASHE using the first way of multiplication isbased on the IND-CPA under a “circular security” assumption and the RLWEassumption. The second scheme Y ASHE ′ is based on the DSPR problemunder the circular security and RLWE assumptions. For the circular security,replace f by distinct secret key fj of evki,j for i ∈ 1, 2 whose number “1”and “2” stand for the Y ASHE and Y ASHE ′ respectively and j which is alevel with 1 ≤ j ≤ L, i.e. for given

evk1,j = [f−1j Pω,q (Dω,q (fj−1)⊗Dω,q (fj−1)) + e + hj · s]q ∈ Rℓ3ω,q ,

evk2,j = [Pω,q

(f 2j−1

)+ e + hj · s]q ∈ Rℓω,q ,

the final ciphertext ci,mul, which is the output of key-switching step withinput ciphertext ci,mul, is correctly decryptable under the secret key fj whereci,mul is a multiplication of two j − 1th level ciphertexts.

3.2 Fully Homomorphic EncryptionTo obtain a fully homomorphic encryption from the somewhat homomorphicencryption, we have to decrease the noise of homomorphic evaluation. It it istoo large, then the homomorphic properties has gone. A modulus switching orbootstrapping is a general way to reduce the noise of homomorphic computa-tions. The noise growth during the homomorphic addition could be neglectedcompared with homomorphic multiplication. Therefore we just consider themultiplication. For given fci = [mi]t + vi(mod q) with the ciphertext ci,the noise vi has the bound V as

∥vi∥∞ < 2δtBkeyBerr +1

2q (mod t) δtBkey

< 2δtBerr +1

2δt2 = δt

(2Berr +

1

2t

)= V,

13

Page 21: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and the inherent noise vi,mult of homomorphic multiplication is

∥v1,mult∥∞ < δt(2 + δℓω,tBkeyω)V +

δt2

2(3 + δℓω,tBkey

)

+1

8(δℓω,tBkey

ω)2 +1

2+ δ2tℓ3ω,qωBerrBkey

= δt(2 + δℓω,tω)V +δt2

2(3 + δℓω,t) +

1

8(δℓω,tω)

2 +1

2+ δ2tℓ3ω,qωBerr,

∥v2,mult∥∞ < δt(4 + δtBkey)V + δ2t2Bkey(Bkey + t) + δ2tℓω,qωBerrBkey

= δt(4 + δt)V + δ2t2(1 + t) + δ2tℓω,qωBerr.

Hence the noise increase from O(δt2) of ∥vi∥∞ to O(δ3t4) of ∥vi,mul∥∞.

To make a fully homomorphic encryption of Y ASHE with an arbitrarylevel L1, set up parameters with the hypothesis of the theorem by Stehleand Steinfeld and RLWE assumption, i.e., for ϵ ∈ (0, 1) and k ∈ (1/2, 1),let q = 2d

ϵ be a prime and let Φn(x) = xn + 1 be a cyclotomic polynomialof degree n which splits into k irreducible factors modulo q. Let χkey be adiscrete Gaussian distribution on Rq with deviation σkey ≥ 2n

√log(8nq) · qk,

let χerr be an asymptotically ω(√2n log(2n))-bounded Gaussian distribution

on R. The inherent noise of a ciphertext regarding the depth L1 circuit, or-ganized in a leveled homomorphic multiplicative tree structure without anyadditions, is bounded by CL1

1 Vj + L1CL1−11 C2 where

C1 = δt(2 + δℓω,tBkeyω) = O(poly(n) log(q)) since δ = n,

C2 =δt2

2(3 + δℓω,tBkey

ω) +1

8(δℓω,tBkey

ω)2 +1

2+ δ2tℓ3ω,qωBerrBkey

= O(poly(n) log(q)3qk) and V = O(poly(n) · qk) for some k ∈ (1/2, 1)

by iterating the bound of ∥v1,mult∥ L1 times as assumed that the inherentnoise terms of all ciphertexts are considered to have the roughly same sizeVj = C1V +L1C2 for each level j > 0. To guarantee correctness of the scheme,following equality should be satisfied as

q = Ω(L1 · poly(n)L1+1 · log(q)L1+2 · qk)

and any circuit of depth can be estimated by

L1 = O

((1− k) log(q)

log(log(q)) + log(n)

).

14

Page 22: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

When the level L1 is greater than a depth Ldec = O(log(log(q))+ log(n)) overF2 of the decryption circuit, it could be converted into a fully homomorphicencryption scheme from Gentry’s Bootstrapping Theorem [5].

To obtain a fully homomorphic encryption of Y ASHE ′ with a level L2,select parameters in order to satisfy the hypothesis of the RLWE and DSPRassumptions, i.e. let q ≡ 1 (mod2n) be a prime and let Φn(x) = xn + 1 bea cyclotomic polynomial of degree n which is a power of 2. Let χkey be adiscrete Gaussian distribution over the ring R, let χerr be an asymptoticallyω(

√2n log(2n))-bounded Gaussian distribution on R. By evaluating the in-

herent noise bound of a ciphertext during the homomorphic operations of thedepth L2, an overall noise bound can be deduced by iterating the ℓ∞ normof v2,mult. It has the bound by

C ′L21 · V + L2C

′L2−11 C ′

2 (3.2.1)

where

C ′1 =

(1 +

4

δtBkey

)δ2t2Bkey = O(poly(n)) since δ = n, (3.2.2)

C ′2 = δ2tBkey(t(Bkey + t) + ℓω,qωBerr) (3.2.3)

= O(poly(n) log(q) · qk) for some k ∈ (1/2, 1).

To guarantee correctness of this scheme, we have that

q = Ω(L2 · poly(n)L2+1 · log(q) · qk).

Therefore YASHE’ can evaluate any circuit of depth

L2 = O

((1− k) log(q)

log(n)

).

When the level L2 is greater than the depth Ldec, it can be converted intoa fully homomorphic encryption scheme from Gentry’s Bootstrapping Theo-rem [5].

15

Page 23: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 4

Implementation

In this chapter, the intermediate ciphertext c2,mul of Y ASHE ′ is comprisedof a single polynomial rather than a vector of polynomials of the intermedi-ate ciphertext c1,mul used for Y ASHE. Since the evaluation key of Y ASHE ′

consists of ℓω,q polynomials instead of ℓ3ω,q of Y ASHE which results in a sim-ple key switching procedure, the Y ASHE ′ is more practical than Y ASHE.Thus, we provide concrete parameters of Y ASHE ′ in section 4.1 and animplementation result of it with special function Y ASHE.Discard to opti-mize in section 4.2. Finally, we analyze the results including what makes theimplementation fast and how to set parameters with optimization.

4.1 Parameter SelectionSince Y ASHE ′ is secure under the Ring-LWE assumption and the DSPRassumption, we have parameters from these assumptions. The attack againstRLWE, which can be seen a variant of the LWE, can be considered in thesame manner of the LWE. Therefore the distinguishing attack [8] on LWEcan also be applied to the RLWE problem. The distinguishing attack is tofind the shortest nonzero vector in the dual lattice of λq(A)

λ⊥q (A) := y ∈ Zm | y · A ≡ 0 (mod q)

where A is derived from a sample of LWE as (A, b = A · s + e), A← Zm×nq ,

s← Znq, which is a secret, and e← χn

σ where the χσ is a normal distribution

16

Page 24: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

with mean 0 and standard deviation σ on Z. If we find the shortest vectorof it, one can distinguish the distribution of LWE samples from uniformlydistribution. The advantage of the distinguishing attack is very close to ϵ =

exp(−π · (∥y∥ · s/q)2). For security, it is sufficient to take a ℓ∞ norm of theshortest vector y less than α · q/σ where α =

√log(1/ϵ)/π. Actually, the

size of the norm has the minimum of q and δmqn/m where δ is called theroot-Hermite factor by [8]. In case of δmqn/m, the optimal value of m is√

n log(q)/log(δ). By BKZ algorithm, we have a relation between the run-time in seconds and root-Hermite factor as λ = 1.8/log2 δ − 110. Then, therelation

α · q/σ < 22√

n log2 (q) log2 (δ) (4.1.1)

is obtained. Let q be a 127-bit prime and n = 212 which is a degree ofpolynomial ϕn(x) of quotient ring R = Z/(Φn(x)), all of which depends onsecurity parameter λ. Fix the key distribution assumed to be bounded byBkey = 1 for evaluating the key switching step and the error distributionbounded by Berr = 6σerr where σerr = 8 with Ring-LWE assumption. Theseparameters with ω = 232 are presented and used for implementation of thescheme by Bos et al. [1]. The maximum of the depth L is 2 through thecomputation of the noise bound with L2.

4.2 Implementation of the SchemeWe implemented the scheme Y ASHE ′ in C++ with NTL library while Boset al. [1] implemented directly in C which does not depend on any othernumber theory library. For given parameters of the section 4.1, we obtain therunning times of the scheme on average values over 100 tests and implementit on an Intel Core i7, 3.4 GHz, 16GB RAM. The result of implementationat level 1 is that key generation runs in 152 ms, encryption runs in 21 ms,addition of ciphertexts in 44 µs, multiplication of ciphertexts including thekey-switching in 29 ms, and decryption runs in 7 ms.

17

Page 25: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

4.2.1 OptimizationBefore optimization, we define the Y ASHE.Discard function of Bos et al. [1],which has a input ciphertext c and output ciphertext c′ as

c′ = YASHE.Discardω(c, i) = ⌊ω−ic⌋.

It is a truncating function by removing an insignificant multiple of ω-wordsof the ciphertext c. If ωi-words are thrown away, ωic is equal to c except leasti-th bit which is zero. If fc = m+ v(modq), then ωic′f = m+ v′(modq)with ∥v′∥∞ ≤ ∥v∥∞ +

1

2δωi∥f∥∞. Therefore, both cihpertext length and the

number of components of the evaluation key are reduced per multiplicationof the key-switching procedure. Since the noise increase with size 1

2δωi∥f∥∞,

the inherent noise ∥v′∥∞ of level L is bounded by C ′L1 · V ′ +LC ′L−1

1 C ′2 where

C ′1, C

′2, and V are the same as (3.2.2), (3.2.3) and

∥v′∥∞ ≤ ∥v∥∞ +1

2δωi∥f∥∞

≤ V +1

2δωi∥f∥∞ ≤ V +

1

2δωi(1 + t) = V ′. (4.2.1)

If C ′L1 ·V ′+LC ′L−1

1 C ′2 is bounded by

2then it could be correctly decrypt-

able.

To sum up all conditions of the noise bound, we get approximately in-equalities that represent relations of n, ω, q, t and ℓ by

n2t3n

2ωi ≤ q

2t⇒ n3t4ωi ≤ q if i ≥ 1

n2t2(ℓω,q · ω ·Berr) ≤q

2t⇒ 2n2t3(ℓω,q · ω ·Berr) ≤ q

log (q)− 3

2√

log (q) log (δ)≤√n, ⌊logω (q)⌋+ 2 = ℓω,q.

These are convenience for evaluating the noise fast regarding parameters.The first and second equality is derived from (4.2.1), (3.2.2) and (3.2.3), andthe third equality is induced from (4.1.1).

18

Page 26: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

For given parameters from section 4.1, we present data of the scheme im-plemented by comparing the result which is already presented before startingthe section 4.2 with using the Y ASHE.Discard function. In given param-eters, we percieve that the value i has the maximum 1 which means thatω-words can be discarded and one evaluation key diminish. Look into thetable 4.1 that shows the running time of multiplication by millisecond.

KeyGen Encrypt Add Mult Decrypti=0 143 21 0.044 29 7i=1 136 20 0.044 28 6

Table 4.1: Running times of logω = 32, t = 1024 for unit [ms]

We can see that the multiplication time decreases about 3 percent andkey generation time decreases about 4 percent compared with i = 0 that dosenot use the discarding function. Particularly, the addition time is the short-est than the others about 1000 times. Unless q and n change, the timings ofencryption, decryption and addition do not fluctuate.

According the parameter ω, the number of elements of the evaluationkey varies such that the running time changes. We derived the fact that thenumber of components is a reciprocal proportion to ω as the way of keygeneration. Therefore, we implement it by changing logω = 32 to logω = 48

to make more efficient. The variation of ω cause the components of evaluationkey to drop to ℓ248,q = 4 from ℓ232,q = 5. However, we can not use ω morethan 264 to reduce them because the inherent noise of multiplication increasetoo large to decrypt. The result of implementation with logω = 48 usingY ASHE.Discard function is shown by Table 4.2.

KeyGen Encrypt Add Mult Decrypti=0 117 19 0.044 24 6i=1 116 20 0.044 23 5

Table 4.2: Running times of logω = 48, t = 1024 for unit [ms]

In this case, the effect of the function is very slight as the running time

19

Page 27: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

of key generation decreases about 0.85 percent and that of multiplication de-creases about 4 percent. But there is some effects on ω as the one decreasesabout 14 ∼ 18 percent and the other decreases about 17 percent from table4.1 and table 4.2.

Furthermore, we implement it by changing the parameter t which decidesmessage space as the ring R256 instead of R1024. Table 4.3 shows the exper-imental result of that parameter. It uses logω = 48 rather than logω = 32

because we already know the former makes this scheme faster than the latter.

KeyGen Encrypt Add mul Decrypti=0 121 20 0.044 25 6i=1 113 20 0.044 23 6

Table 4.3: Running times of logω = 48, t = 256 for unit [ms]

The variation of t does not have any effects on running time from table4.2 and table 4.3. But the time of key generation decreases about 6 percentand that of multiplication decreases about 8 percent by using this function.

In the similar manner, we use logω = 64 to reduce procedure of key-switching, which can only use ℓω,q = 3 components of evaluation key withoutdiscarding words. If not, we should use ℓω,q = 4 components. To make thescheme faster, we may consider Y ASHE.Discard function. However, usingthis function makes it impossible to decrypt correctly since the inherent noiseis too large to decrypt. Its experimental result is provided by table 4.4.

KeyGen Encrypt Add Mul Decrypti=0 97 19 0.044 22 6

Table 4.4: Running times of logω = 64, t = 256 for unit [ms]

The data of the table is about 19 percent of key generation and about12 percent of multiplication faster than the result of the table 4.3 without

20

Page 28: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

discarding words.

From some experimental results, we can deduced that the value ω, whichaffects the process of key-switching with the number of components of eval-uation key, and the fact that whether Y ASHE.Discard function is used ornot are the important factors for deciding the running times. When the pairof n and q consist of very small size, the maximal depth (or level ) Lmax

is very low. Since bootstrapping requires the depth L to be about 50, weadditively implement the scheme under this circumstances, which should beset as the optimal parameter q = 2048 bit prime, t = 2, n = 216, ω = 293,i = 1, and ℓ = 8.

KeyGen Encrypt Mul Decrypti=1 8.5 0.3 296 0.09

Table 4.5: Running times of L = 50, logω = 293, t = 2 for unit [s]

21

Page 29: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 5

Conclusion

For fixed parameter q that is a 127 bit prime and polynomial degree n = 212,we provide the experimental data by implementing the BLLN scheme. Then,we performed optimization by adjusting parameters and using particularfunction Y ASHE.Discard. Its results is presented by tables. When the pa-rameter t, which determines message space, is fixed by 1024, the runningtimes are reduced about 18 percent of key generation and about 20 percentof multiplication. When t is 256, the one decreases about 19 percent and theother decreases about 12 percent. As a result, we can see which parametersmake the scheme faster and how to choose these parameters we want to im-plement it as well as we can estimate how faster it is, depending on sometechnique of optimization.

22

Page 30: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Bibliography

[1] J. Bos, K. Lauter, J. Loftus, and M. Naehrig. Improved security fora ring-based fully homomorphic encryption scheme. Cryptology ePrintArchive, Report 2013/075, 2013. http://eprint.iacr.org/2013/075/.

[2] Z. Brakerski. Fully homomorphic encryption without modulus switch-ing from classical GapSVP. In Advances in Cryptology - Crypto 2012,volume 7417 of Lecture Notes in Computer Science, pages 868-886.Springer, 2012.

[3] Z. Brakerski, C. Gentry, and V. Vaikuntanathan. Fully homomorphicencryption without bootstrapping. In ITCS, pages 309-325, 2012.

[4] C. Gentry. A fully homomorphic encryption scheme, Stanford UniversityPhD thesis, 2009, http://crypto.stanford.edu/craig/craig-thesis.pdf.

[5] C. Gentry. Fully homomorphic encryption using ideal lattices. In MichaelMitzenmacher, editor, STOC, pages 169-178. ACM, 2009.

[6] S. Goldwasser and S. Micali. Probabilistic encryption and how to playmental poker keeping secret all partial information, in Proceedings ofthe 14th ACM Symposium on Theory of Computing|STOC 1982, ACM(1982), 365-377.

[7] J. Hoffstein, J. Pipher, and J. H. Silverman. NTRU: A ring-based publickey cryptosystem. In J. Buhler, editor, ANTS, volume 1423 of LectureNotes in Computer Science, pages 267-288. Springer, 1998.

[8] R. Lindner and C. Peikert. Better key sizes (and attacks) for LWE-based encryption. In Proceedings of the 11th international conference on

23

Page 31: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

BIBLIOGRAPHY

Topics in cryptology:CT-RSA 2011, CT-RSA’11, pages 319-339, Berlin,Heidelberg, 2011. Springer Verlag.

[9] A. Lopez-Alt, E. Tromer, and V. Vaikuntanathan. On-the-fly multipartycomputation on the cloud via multikey fully homomorphic encryption.In STOC, pages 1219-1234, 2012.

[10] V. Lyubashevsky and D. Micciancio. Generalized compact knapsacks arecollision resistant. In Michele Bugliesi, Bart Preneel, Vladimiro Sassone,and Ingo Wegener, editors, ICALP (2), volume 4052 of Lecture Notesin Computer Science, pages 144-155. Springer, 2006.

[11] V. Lyubashvesky, C. Peikert, and O. Regev. on ideal lattices and learningwith errors over rings. In EUROCRYPT, volume6110 of Lecture notesin Computer Science, page 1-23, 2010.

[12] R. Rivest, L. Adleman, and M. Dertouzos. On Data Banks and Pri-vacy Homomorphisms, in Foundations of Secure Computation, Aca-demic Press, New York (1978), 169-180.

[13] D. Stehle and R. Steinfeld. Making NTRU as secure as worst-case prob-lems over ideal lattices. In Advances in Cryptology - EUROCRYPT2011 - 30th Annual International Conference on the Theory and Appli-cations of Cryptographic Techniques, volume 6632 of Lecture Notes inComputer Science, page 27. Springer, 2011.

24

Page 32: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

국문초록

Rivest외 3명은암호화된상태에서계산가능한완전동형암호를제시하였다.그러나이암호체계는안전하지않는것으로판명되어이후이를변형하거나개선된 수많은 동형암호들이 소개되었다. 그 중 Lopez-Alt 외 3명이 제안한완전동형암호는 NTRU 암호체계에 기반한 것으로 다른 암호체계보다 더효율적이다. Bos 외 3명은 그들의 스킴보다 효율성면에서 개선된 암호화알고리즘을 개발하였다. 이는 Lopez-Alt 외 3명의 암호체계에 기반된 DSPR문제와 Modulus switching 단계를 제거한 결과로 본 논문은 이들이 제안한암호알고리즘을 살펴봄과 동시에 구현 및 최적화한 결과를 분석하여 제시한다.

주요어휘: BLLN,NTRU,동형암호,구현학번: No. 2011-23211

Page 33: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

감사의 글

학위 기간동안 부족한 제자를 보살펴주시고 아낌없는 조언과 가르침을 주신천정희 선생님께 감사의 말씀드립니다. 선생님께 학문에 대한 열정과 삶의지혜를 배웠습니다. 그리고 석사 논문 심사를 해주신 이기암 교수님, 오병권교수님께 감사드립니다.논문작성에 있어서 많은 조언과 도움을 주신 이문성 박사님께 감사드립

니다. 논문 교정을 함께 해준 미란언니, 현숙언니, chocolat au lait를 사주며격려를 아끼지 않았던 충훈 오빠, 심사준비에 도움을 준 형태오빠, 한솔언니그리고 길지 않은 시간을 함께 보낸 연구실 선후배 동료들에게 감사합니다.대학원에서 서로를 의지하며 보낸 대학원 동기들, 혜림이, 누리언니, 도영이,지연이, 미림이, 경민오빠, 찬우오빠에게도 감사합니다.무엇보다도 저에게 가장 큰 힘이 되어주신 부모님, 학위과정에서의 조언

과 격려를 많이 해주신 친척분들과 제가 가장 아끼는 동생에게도 감사의 말전합니다. 마지막으로학부교수님들을비롯하여이자리까지올수있게해준모든 분들께 감사를 표합니다.

Page 34: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

저 시-비 리-동 조건 경허락 2.0 한민

는 아래 조건 르는 경 에 한하여 게

l 저 물 복제, 포, 전송, 전시, 공연 송할 수 습니다.

l 차적 저 물 성할 수 습니다.

다 과 같 조건 라야 합니다:

l 하는, 저 물 나 포 경 , 저 물에 적 허락조건 확하게 나타내어야 합니다.

l 저 터 허가를 러한 조건들 적 지 않습니다.

저 에 른 리는 내 에 하여 향 지 않습니다.

것 허락규약(Legal Code) 해하 쉽게 약한 것 니다.

Disclaimer

저 시. 하는 원저 를 시하여야 합니다.

비 리. 하는 저 물 리 적 할 수 없습니다.

동 조건 경허락. 하가 저 물 개 , 형 또는 가공했 경에는, 저 물과 동 한 허락조건하에서만 포할 수 습니다.

Page 35: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

이학석사 학위논문

Implementation of Ring-basedHomomorphic Encryption

( 환-기반 준동형 암호의 구현)

2014년 2월

서울대학교 대학원

수리과학부

전 민 영

Page 36: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Implementation of Ring-basedHomomorphic Encryption

( 환-기반 준동형 암호의 구현)

지도교수 천 정 희

이 논문을 이학석사 학위논문으로 제출함

2013년 12월

서울대학교 대학원

수리과학부

전 민 영

전 민 영의 이학석사 학위논문을 인준함

2013년 12월

위 원 장 (인)

부 위 원 장 (인)

위 원 (인)

Page 37: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Implementation of Ring-basedHomomorphic Encryption

A dissertationsubmitted in partial fulfillment

of the requirements for the degree ofMaster of Science

to the faculty of the Graduate School ofSeoul National University

by

Min Young Jun

Dissertation Director : Professor Jung Hee Cheon

Department of Mathematical SciencesSeoul National University

February 2014

Page 38: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

© 2013 Min Young Jun

All rights reserved.

Page 39: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Abstract

Fully homomorphic encryption(FHE) was introduced by Rivest, Adleman,and Dertouzos that can homomorphically evaluate encrypted data. However,it turned out to be insecure. After then, it has been presented lots of im-proved, modified FHE schemes for security and efficiency. One of them, aFHE of Lopez-Alt, Tromer, and Vaikuntanathan based on NTRU encryptionscheme of Hoffstein, Pipher, and Silverman, is more efficient than the otherschemes for a long time. Bos et al. suggest the more efficient FHE scheme,which is the fastest, than Lopez-Alt et al. They remove the DSPR assump-tion and modulus switching procedure. Thus, in this paper, we look into thescheme and implement its practical version and optimization. We provideexperimental results and analyze them as regards efficiency compared withoriginal one whose parameters are presented by authors.

Key words: BLLN, NTRU, FHE, ImplementationStudent Number: No. 2011-23211

i

Page 40: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Contents

Abstract i

1 Introduction 1

2 Preliminaries 32.1 Basic Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 The Ring-LWE Problem . . . . . . . . . . . . . . . . . . . . . 42.3 The DSPR Problem with LTV . . . . . . . . . . . . . . . . . . 5

3 Ring-based FHE Scheme 83.1 Leveled Somewhat Homomorphic Encryption . . . . . . . . . 8

3.1.1 BLLN Scheme . . . . . . . . . . . . . . . . . . . . . . 83.1.2 Security of the Scheme . . . . . . . . . . . . . . . . . . 13

3.2 Fully Homomorphic Encryption . . . . . . . . . . . . . . . . . 13

4 Implementation 164.1 Parameter Selection . . . . . . . . . . . . . . . . . . . . . . . 164.2 Implementation of the Scheme . . . . . . . . . . . . . . . . . . 17

4.2.1 Optimization . . . . . . . . . . . . . . . . . . . . . . . 18

5 Conclusion 22

Abstract (in Korean) 25

Acknowledgement (in Korean) 26

ii

Page 41: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 1

Introduction

Homomorphic encryption is a cryptosystem that one could add or multi-ply ciphertexts and another could decrypt the result. Partially homomor-phic cryptosystem can evaluate ciphertexts using only one operation withoutdecryption of them. e.g. RSA, ElGamal, Paillier. On the other hand, fullyhomomorphic encryption(FHE) introduced by Rivest, Adleman, and Der-touzos [12], which is not secure under the plaintext attack, can evaluate bothaddition and multiplication. Until 2009, the cryptosystem of Boneh, Goh andNissim [6] is the best homomorphic encryption that evaluates a number ofadditions and one multiplication.

In 2009, Craig Gentry suggested the first fully homomorphic encryptionusing ideal lattices, which can evaluate a unlimited number of additions andmultiplications of ciphertexts that consist of polynomials over a ring [4, 5]. Itis more secure than former one. Since the noise of ciphertext increase duringevaluations, he present how to modify the scheme so as to reduce the noisecalled bootstrapping process. Then the scheme can be converted into a fullyhomomorphic encryption. However, it is not efficient to apply the real world.After then, it has been presented that lots of improved, modified and anotherfully homomorphic encryption schemes which do not use ideal lattices.

FHE based on NTRU encryption of Hoffstein, Pipher, and Silverman [7]was presented by Lopez-Alt, Tromer, and Vaikuntanathan [9], which is more

1

Page 42: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 1. INTRODUCTION

efficient and secure than the others. Bos et al. [1] suggest the more efficientFHE scheme, which is the fastest of existing schemes, than Lopez-Alt et al.Their scheme removes the decisional small polynomial ratio assumption, itavoids modulus switching that makes the noise size diminish and its cipher-text is represented by a single ring element. They also provide a practicalversion with parameters and certain implementation results. In this paper,we investigate the BLLN scheme, implement it and analyze what makes thescheme faster and how faster than the other parameters of optimization pro-cedure.

In chapter 2, we provide a basic notation and some of the assumption com-posed of the RLWE and DSPR with LTV as aspects of security. In chapter 3,we introduce the BLLN scheme including how to be a leveled somewhat ho-momorphic encryption and fully homomorphic encryption. It might be seemto have two part according to the way of homomorphic multiplication. Inchapter 4, we set up parameters by proving security, implement it and carryout an optimization by defining and experimenting the Y ASHE.Discard.Furthermore, we present their results as tables and analyze them with opti-mization.

2

Page 43: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 2

Preliminaries

Fully homomorphic encryption can evaluate the addition and multiplica-tion homomorphically between ciphertexts as Enc(m1 +m2) = Enc(m1) +

Enc(m2) and Enc(m1 ·m2) = Enc(m1) ·Enc(m2) where Enc(mi) is the en-cryption of a message mi. According to some properties, it could be dividedinto somewhat homomorphic encryption, leveled fully homomorphic encryp-tion, and fully homomorphic encryption. Somewhat homomorphic encryp-tion is a special form of fully homomorphic encryption whose noise increasesduring the evaluating process where each ciphertext has low-degree homo-morphic operations. Leveled fully homomorphic encryption can evaluate theciphertexts with high-degree L, which sometimes called depth, and fully ho-momorphic encryption can evaluate them regardless of depth or degree.

2.1 Basic NotationWe will use a quotient ring R = Z[x]/(Φn(x)), where Φn(x) = xn + 1 is an-th cyclotomic polynomial with n a power of two. Denote a ℓ∞ norm of fby ∥f∥∞ = maxi|ai| : f =

∑n−1i=0 aix

i ∈ R.

Lemma 2.1.1 ( [5, 10]). Let n ∈ N, let ϕ(x) be a n-th cyclotomic polynomialof degree n and let R = Z[x]/(ϕ(x)). For any t, s ∈ R,

3

Page 44: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

∥s · t(modϕ(x))∥ ≤√n · ∥s∥ · ∥t∥

∥s · t(modϕ(x))∥∞ ≤√n · ∥s∥∞ · ∥t∥∞.

We say that δ = sup∥f · g∥∞/(∥f∥∞∥g∥∞) : f, g ∈ R is an expansionfactor of R which is equal to n by lemma 2.1.1. For a polynomial f ∈ R,denote the [f ]q ∈ R/qR = Zq/(x

n+1) by reducing coefficients into Zq whichhave the range (− q

2, q

2] for some integer q . For v, w ∈ Rn, the dot product is

defined by ⟨v,w⟩ =∑n

i=1 ui ·wi ∈ R where ui and wi are the ith componentof that. It also holds for the quotient ring Rq.

A discrete Gaussian distribution DZn,σ over Zn with parameter σ is aprobability distribution that assigns a probability proportional to exp(−π∥x∥2/σ2)

to each x ∈ Zn. It is a product distribution of n independent copies ofDZ,σ with mean 0 and standard deviation σ over the integers [8, 11]. It out-puts a (r

√n)-bounded polynomial with high probability. The distribution

χ = DZn,σ supported over R is called B-bounded if we have a B-boundedpolynomial for all f sampled from χ, i.e. ∥f∥∞ < B [9].

In this paper, we use a truncated Gaussian distribution χ that is B-bounded and statistically close to the discrete Gaussian. It takes samplewhose norm is less than B so as to restrict the noise bound and growthduring the homomorphic operations [9, 11].

2.2 The Ring-LWE ProblemIt has been suggested that lots of FHE schemes based on the RLWE assump-tion and reductions of the worst case to average case. Lyubaskevsky, Peikertand Regev describe the Ring learning with error problem (Ring-LWE) [11].It distinguishes which distribution is used for sampling and generates certainsamples. It is an extension of the learning with error problem called LWEthat based on a field rather than polynomial.

Definition 2.2.1 (Ring-LWE). For given security parameter λ, n = n(λ) ∈Z, let ϕ(x) = ϕn(x) ∈ Z[x] be a polynomial of degree n, let q = q(λ) ≥ 2

4

Page 45: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

be an integer, let R = Z/(ϕ(x)) and R/qR. Let χ = χ(λ) be a distributionover R. The Ring − LWEn,q,χ problem is to distinguish the following twodistributions. In the first distribution one samples (ai, bi) uniformly from R2

q .In second distribution one samples (ai, bi = ai · s + ei) ∈ R2

q where s fixedfor all samples is uniformly sampled from Rq, ai’s are uniformly from Rq andei’s are from an error distribution χ. The Ring-LWE assumption is that theRing-LWE problem is hard.

The shortest vector problem over the ideal lattice which is worst-caseproblem can be reduced to the Ring-LWE problem which is average-case.

Theorem 2.2.2 (Worst-case to Average-case Reduction [9, 11]). LetΦn(x) = xn + 1 be a n-th cyclotomic polynomial of degree which is a powerof two. Let R = Z/(xn + 1), q ≡ 1(mod2n) be a prime integer and χ be aB = ω(

√nlogn)-bounded distribution. Then there is a randomized reduction

from nω(1) · (q/B)-approximate worst-case SVP for ideal lattice over R toRing − LWEn,q,χ.

This theorem is useful for setting parameters.

2.3 The DSPR Problem with LTVA. Lopez-Alt, E. Tromer, and V. Vaikuntanathan [9] present a scheme whichis based on NTRU with modifications and multikey homomorphism. It isprovably secure based on standard problems in ideal lattices. The parame-ters, which is n, q, ϕ(x) of the degree n and χ, depend on security parameterλ. Its message space is 0, 1 and all operations are evaluated on the quotientring Rq = Zq/(ϕ(x)). We simply introduce LTV scheme as follows.

Key Generation: Sample f0, g from key distribution χ, then compute f =

[2f0 + 1]q such that f ≡ 1 (mod 2). If f is not invertible modulo q,re-sample f0. Let h = [2gf−1]q for inverse of f modulo q in R, then setthe secret key f and public key h.

5

Page 46: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

Encryption: Take a message m from 0, 1. Ciphertext is generated bycomputing c = [m + 2e + hs]q over the ring R with s, e sampled fromerror distribution χ.

Decryption: Compute m′ = [[fc]q]2 ∈ R with the secret key f .

It easy to check that as long as there is no wrap-around modulo q. Compute

[fc]q = [fm+ 2fe+ fhs]q = [fm+ 2fe+ 2gs]q.

If there is no wrap-around modulo q then

[fc]q(mod2) = [fm+ 2fe+ 2gs]q = [fm]q(mod2) = m.

This scheme is secure under the assumption of decisional small polynomialratio problem.We simply call it DSPR problem.

Definition 2.3.1 (DSPR Problem [1, 9]). For given security λ, let Φ(x) ∈Z[x] be a polynomial of degree n ∈ Z, let q ∈ Z be a prime integer. LetR = Z/(ϕ(x)), Rq = R/qR and let χ is a distribution over the ring R. allof them depend on λ. The DSPRn,q,χ problem is to distinguish between thefollowing two distributions. In first distribution, one samples h uniformlyat random over Rq. In second distribution, one samples h = a/b where a

and b are from the distribution χ. The DSPRn,q,χ assumption is that theDSPRn,q,χ problem is hard.

It holds only if σ >√q · poly(n) for cyclotomic polynomial ϕ(x) which

makes secure against unbounded adversaries.

Stehle and Steinfeld [13] propose a theorem for modified NTRU thatchanges the value 2 which could indicates the size of the message space tothe value t where the t is in the R×

q , and 2e to te.

Theorem 2.3.2 ( [1, 13]). Let Φn(x) = xn+1 be a n-th cyclotomic polynomialof degree which is a power of two ≥ 4 and it splits into k = k(q) irreduciblefactors modulo a prime q ≥ 5. Let R = Z[x]/(xn + 1) and Rq = R/qR.Let U(R×

q ) be the uniform distribution on R×q which is the set of invertible

6

Page 47: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 2. PRELIMINARIES

elements in Rq. Let χ = D×Zn,σ be the spherical discrete Gaussian distribution

on Rq, restricted to R×q . Let ϵ ∈ (0, 1/3), t ∈ R×

q . Let a and b are dependedon t with some distributions. Then the statistical distance a/b (mod q) andU(R×

q ) is bounded by

D =

220n · q−

⌊ϵk⌋k · 2n if σ ≥ 2n ·

√log(8nq) · q 1

2+ϵ

220n · q−2ϵn if σ ≥√

2n log(8nq) · q 1+kϵ2 and q ≥ (2n)

k1−2kϵ .

Then the DSPR problem is hard in Rq.

7

Page 48: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 3

Ring-based FHE Scheme

In this section we investigate the main scheme suggested by Bos et al. [1].In section 3.2, a leveled somewhat homomorphic encryption of the schemeis presented and subsection 3.1.1 describes the basic encryption, decryptionsystem and how the homomorphic operations are evaluated. In subsection3.1.2, its security is proven with some assumptions. In section 3.2, we providehow the scheme can be converted to a fully homomorphic encryption.

3.1 Leveled Somewhat Homomorphic Encryp-tion

Bos et al. present a couple of leveled somewhat homomorphic encryptionaccording to homomorphic multiplication with two different evaluation keys.This keys affect the complexity of the scheme such that we could estimatewhich method of homomorphic multiplication is fast. We present two partsof the scheme in parallel. They call them “Y ASHE” and “Y ASHE ′”. A subnotation “1” stands for Y ASHE and “2” stands for Y ASHE ′.

3.1.1 BLLN SchemeIn this subsection, we describe two parts of the scheme. The first part is abasic cryptosystem including how the encrypted messages can be decryptable

8

Page 49: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and the second part explains how the homomophic operation can be com-puted according to the noise bound by some calculations. The basic cryp-tosystem is composed of the key generation, encryption and decryption asfollows.

Key Generation: Sample f0, g from key distribution χkey, then computef = [tf0 + 1]q for 1 < t < q. If f is not invertible modulo q, re-samplef0. Let h = [tgf−1]q for inverse of f modulo q in R, then we can gener-ate a basic key set f, h which is comprised of a secret key and publickey respectively. Actually, the secret keys are f and f−1.The evaluation key set evk1, evk2 that is used for homomorphic mul-tiplication is computed by

evk1 = [f−1Pω,q (Dω,q (f)⊗Dω,q (f)) + e + h · s]q ∈ Rℓ3ω,q ,

evk2 = [Pω,q (f) + e + h · s]q ∈ Rℓω,q

where ℓω,q = ⌊logw q⌋+ 2,

Dω,q : R→ Rℓω,q , f 7→ ([f0]ω, [f1]ω, · · · , [fℓω,q−1]ω) = ([fi]ω)ℓω,q−1i=0

Pω,q : R→ Rℓω,q , f 7→ ([f ]q, [fω]q, · · · , [fωℓω,q−1]q) = ([fωi]q)ℓω,q−1i=0

for f =∑ℓω,q−1

i=0 fiωi with fi ∈ R.

If ω = 2, then these functions are called BitDecomp and PowerOFTwo [2].

As the function Dω,q and Pω,q are defined, the dot product between twovectors Dω,q(f) and Pω,q(g) is equal to the scalar product of f and g moduloq for some f, g ∈ R. This follows from the fact that

< Dω,q(f), Pω,q(g) >=

ℓω,q−1∑i=0

[fi]ω[gωi]q ≡ g

ℓω,q−1∑i=0

[fi]ωωi ≡ f · g (modq).

Encryption: For given integer t, we take a message from the space R/tR

whose element is of the form m + tR. Simply, it can be written by[m]t. Ciphertext that is the encryption of the message is computed by[⌊

q

t

⌋[m]t + e+ hs

]q

∈ R for s, e sampled from error distribution χerr.

9

Page 50: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

Decryption: Compute m =

[⌊t

q[fc]q

⌉]t

∈ R to obtain the message with

the secret key f .

The scheme is correctly decryptable when there exist v ∈ R such that∥v∥∞ <

(–q (mod t))

2for [fc]q = [[m]t + v]q, where =

⌊q

t

⌋. For some

a ∈ R,

t

q[fc]q =

t

q [m]t + v · t

q+ ta

= [m]t −q (mod t)

q[m]t + v · t

q+ ta.

If ∥v∥∞ <(–q (mod t))

2, then

∥∥∥∥ − q (mod t)

q[m]t + v · t

q

∥∥∥∥∞

<1

2. So, we

could be correctly decrypt the ciphertext.

The homomorphic operations consisted of addition and multiplication aredefined as follows.

Homomorphic Addition: Let c1, c2 ∈ R be encrypted message m1,m2 ∈R/tR. Compute an addition [c1 + c2]q that is a encrypted messagem1 +m2 modulo t by adding coefficients of ciphertext componentwise.

Although the size of inherent noise increases during this operation, which hasa sum of vi and r ∈ R where the r satisfies the equation as [m1]t + [m2]t =

[m1 + m2]t + r, ∥r∥∞ ≤ 1 and the ciphertext ci has a form of [mi]t + vi, itcould be decryptable.

Homomorphic Multiplication: Compute a ciphertext with multiplicationof two ciphertexts. Passing by a key-switching procedure, we obtain afinal ciphertext called an intermediate ciphertext, which might be cor-rectly decryptable, is obtained.

According to the method of multiplication, two ways of homomorphicencryption are presented with different ciphertexts c1,mul and c2,mul, inter-mediate ciphertexts. Through the key-switching procedure, the intermediate

10

Page 51: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

ciphertext becomes a ciphertext decrypted under an original secret key f

instead of f 2. The evaluation key evki is used for this procedure. If this stepis omitted, the ciphertext could not be decryptable since its noise is too largeto decrypt. Hence the key-switching process is essential and the intermediateciphertext exists at all times.

The ciphertext c1,mul which is a multiplication of two ciphertexts c1 andc2 is computed by

c1,mul =

[⌊t

qPω,q (c1)⊗ Pω,q (c2)

⌉]q

∈ Rℓ2ω,q ,

where the ⊗ is a tensor product which reduces the monomials ℓ2ω,q to(ℓω,q

2

).

The way of the key-switching is obtained by

[⟨Dω,q (c1,mul) , evk1⟩]q = [⟨Dω,q (c1,mul) , f−1Pω,q (Dω,q (f)⊗Dω,q (f)) + e + h · s⟩]q

= [f−1⟨Dω,q (c1,mul) , Pω,q (Dω,q (f)⊗Dω,q (f))⟩+ ⟨Dω,q (c1,mul) , e⟩+ h · ⟨Dω,q (c1,mul) , s⟩]q.

In this case, the final ciphertext c1,mul composed of a vector of polynomialsis

c1,mul = [⟨Dω,q (c1,mul) , evk1⟩]qthat could be correctly decryptable under the secret key f if

[fc1,mul]q = [⟨Dω,q (c1,mul) , Pω,q (Dω,q (f)⊗Dω,q (f))⟩+ f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q

= [(t/q) · ⟨Pω,q (c1)⊗ Pω,q (c2) , Dω,q (f)⊗Dω,q (f)⟩− rc + f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q

= [[m1m2]t + v1,mul + f⟨Dω,q (c1,mul) , e⟩+ gt⟨Dω,q (c1,mul) , s⟩]q= [[m1m2]t + v1,mul]q

where

rc =t

q⟨Pω,q(c1)⊗ Pω,q(c2), Dω,q(f)⊗Dω,q(f)⟩ − ⟨c1,mul, Dω,q(f)⊗Dω,q(f)⟩

=

⟨(t

qPω,q (c1)⊗ Pω,q (c2)

)−⌊t

qPω,q (c1)⊗ Pω,q (c2)

⌉, Dω,q (f)⊗Dω,q (f)

⟩,

11

Page 52: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and v1,mul satisfies under the condition of decryption.

Another ciphertext of the multiplication c2,mul which is a multiplicationof the ciphertexts c1 and c2 is computed by

c2,mul =

[⌊t

qc1c2

⌉]q

∈ R,

and the key-switching process is followed by

[⟨Dω,q (c2,mul) , evk2⟩]q = [⟨Dω,q (c2,mul) , Pω,q (f) + e + h · s⟩]q= [⟨Dω,q (c2,mul) , Pω,q (f)⟩+ ⟨Dω,q (c2,mul) , e⟩

+ h · ⟨Dω,q (c2,mul) , s⟩]q.

The final ciphertext c2,mul composed of a simply single polynomial is

c2,mul = [⟨Dω,q (c2,mul) , evk2⟩]q

that could be correctly decryptable under the secret key f if

[fc2,mul]q = [f⟨Dω,q (c2,mul) , Pω,q (f)⟩+ f⟨Dω,q (c2,mul) , e⟩+ gt⟨Dω,q (c2,mul) , s⟩]q= [f⟨Dω,q ((t/q)c1c2) , Pω,q (f)⟩ − f · rc + f⟨Dω,q (c2,mul) , e⟩

+ gt⟨Dω,q (c2,mul) , s⟩]q= [[m1m2]t + v2,mul + f⟨Dω,q (c2,mul) , e⟩+ gt⟨Dω,q (c2,mul) , s⟩]q= [[m1m2]t + v2,mul]q

where

f · rc = f ·⟨(

Dω,q

(t

qc1c2

))−⌊Dω,q

(t

qc1c2

)⌉, Pω,q (f)

⟩=

t

qf 2 · c1c2 − f 2·

⌊t

qc1c2

⌉and v2,mul satisfies under the condition of decryption.

12

Page 53: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

3.1.2 Security of the SchemeThe security of the scheme Y ASHE using the first way of multiplication isbased on the IND-CPA under a “circular security” assumption and the RLWEassumption. The second scheme Y ASHE ′ is based on the DSPR problemunder the circular security and RLWE assumptions. For the circular security,replace f by distinct secret key fj of evki,j for i ∈ 1, 2 whose number “1”and “2” stand for the Y ASHE and Y ASHE ′ respectively and j which is alevel with 1 ≤ j ≤ L, i.e. for given

evk1,j = [f−1j Pω,q (Dω,q (fj−1)⊗Dω,q (fj−1)) + e + hj · s]q ∈ Rℓ3ω,q ,

evk2,j = [Pω,q

(f 2j−1

)+ e + hj · s]q ∈ Rℓω,q ,

the final ciphertext ci,mul, which is the output of key-switching step withinput ciphertext ci,mul, is correctly decryptable under the secret key fj whereci,mul is a multiplication of two j − 1th level ciphertexts.

3.2 Fully Homomorphic EncryptionTo obtain a fully homomorphic encryption from the somewhat homomorphicencryption, we have to decrease the noise of homomorphic evaluation. It it istoo large, then the homomorphic properties has gone. A modulus switching orbootstrapping is a general way to reduce the noise of homomorphic computa-tions. The noise growth during the homomorphic addition could be neglectedcompared with homomorphic multiplication. Therefore we just consider themultiplication. For given fci = [mi]t + vi(mod q) with the ciphertext ci,the noise vi has the bound V as

∥vi∥∞ < 2δtBkeyBerr +1

2q (mod t) δtBkey

< 2δtBerr +1

2δt2 = δt

(2Berr +

1

2t

)= V,

13

Page 54: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

and the inherent noise vi,mult of homomorphic multiplication is

∥v1,mult∥∞ < δt(2 + δℓω,tBkeyω)V +

δt2

2(3 + δℓω,tBkey

)

+1

8(δℓω,tBkey

ω)2 +1

2+ δ2tℓ3ω,qωBerrBkey

= δt(2 + δℓω,tω)V +δt2

2(3 + δℓω,t) +

1

8(δℓω,tω)

2 +1

2+ δ2tℓ3ω,qωBerr,

∥v2,mult∥∞ < δt(4 + δtBkey)V + δ2t2Bkey(Bkey + t) + δ2tℓω,qωBerrBkey

= δt(4 + δt)V + δ2t2(1 + t) + δ2tℓω,qωBerr.

Hence the noise increase from O(δt2) of ∥vi∥∞ to O(δ3t4) of ∥vi,mul∥∞.

To make a fully homomorphic encryption of Y ASHE with an arbitrarylevel L1, set up parameters with the hypothesis of the theorem by Stehleand Steinfeld and RLWE assumption, i.e., for ϵ ∈ (0, 1) and k ∈ (1/2, 1),let q = 2d

ϵ be a prime and let Φn(x) = xn + 1 be a cyclotomic polynomialof degree n which splits into k irreducible factors modulo q. Let χkey be adiscrete Gaussian distribution on Rq with deviation σkey ≥ 2n

√log(8nq) · qk,

let χerr be an asymptotically ω(√2n log(2n))-bounded Gaussian distribution

on R. The inherent noise of a ciphertext regarding the depth L1 circuit, or-ganized in a leveled homomorphic multiplicative tree structure without anyadditions, is bounded by CL1

1 Vj + L1CL1−11 C2 where

C1 = δt(2 + δℓω,tBkeyω) = O(poly(n) log(q)) since δ = n,

C2 =δt2

2(3 + δℓω,tBkey

ω) +1

8(δℓω,tBkey

ω)2 +1

2+ δ2tℓ3ω,qωBerrBkey

= O(poly(n) log(q)3qk) and V = O(poly(n) · qk) for some k ∈ (1/2, 1)

by iterating the bound of ∥v1,mult∥ L1 times as assumed that the inherentnoise terms of all ciphertexts are considered to have the roughly same sizeVj = C1V +L1C2 for each level j > 0. To guarantee correctness of the scheme,following equality should be satisfied as

q = Ω(L1 · poly(n)L1+1 · log(q)L1+2 · qk)

and any circuit of depth can be estimated by

L1 = O

((1− k) log(q)

log(log(q)) + log(n)

).

14

Page 55: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 3. RING-BASED FHE SCHEME

When the level L1 is greater than a depth Ldec = O(log(log(q))+ log(n)) overF2 of the decryption circuit, it could be converted into a fully homomorphicencryption scheme from Gentry’s Bootstrapping Theorem [5].

To obtain a fully homomorphic encryption of Y ASHE ′ with a level L2,select parameters in order to satisfy the hypothesis of the RLWE and DSPRassumptions, i.e. let q ≡ 1 (mod2n) be a prime and let Φn(x) = xn + 1 bea cyclotomic polynomial of degree n which is a power of 2. Let χkey be adiscrete Gaussian distribution over the ring R, let χerr be an asymptoticallyω(

√2n log(2n))-bounded Gaussian distribution on R. By evaluating the in-

herent noise bound of a ciphertext during the homomorphic operations of thedepth L2, an overall noise bound can be deduced by iterating the ℓ∞ normof v2,mult. It has the bound by

C ′L21 · V + L2C

′L2−11 C ′

2 (3.2.1)

where

C ′1 =

(1 +

4

δtBkey

)δ2t2Bkey = O(poly(n)) since δ = n, (3.2.2)

C ′2 = δ2tBkey(t(Bkey + t) + ℓω,qωBerr) (3.2.3)

= O(poly(n) log(q) · qk) for some k ∈ (1/2, 1).

To guarantee correctness of this scheme, we have that

q = Ω(L2 · poly(n)L2+1 · log(q) · qk).

Therefore YASHE’ can evaluate any circuit of depth

L2 = O

((1− k) log(q)

log(n)

).

When the level L2 is greater than the depth Ldec, it can be converted intoa fully homomorphic encryption scheme from Gentry’s Bootstrapping Theo-rem [5].

15

Page 56: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 4

Implementation

In this chapter, the intermediate ciphertext c2,mul of Y ASHE ′ is comprisedof a single polynomial rather than a vector of polynomials of the intermedi-ate ciphertext c1,mul used for Y ASHE. Since the evaluation key of Y ASHE ′

consists of ℓω,q polynomials instead of ℓ3ω,q of Y ASHE which results in a sim-ple key switching procedure, the Y ASHE ′ is more practical than Y ASHE.Thus, we provide concrete parameters of Y ASHE ′ in section 4.1 and animplementation result of it with special function Y ASHE.Discard to opti-mize in section 4.2. Finally, we analyze the results including what makes theimplementation fast and how to set parameters with optimization.

4.1 Parameter SelectionSince Y ASHE ′ is secure under the Ring-LWE assumption and the DSPRassumption, we have parameters from these assumptions. The attack againstRLWE, which can be seen a variant of the LWE, can be considered in thesame manner of the LWE. Therefore the distinguishing attack [8] on LWEcan also be applied to the RLWE problem. The distinguishing attack is tofind the shortest nonzero vector in the dual lattice of λq(A)

λ⊥q (A) := y ∈ Zm | y · A ≡ 0 (mod q)

where A is derived from a sample of LWE as (A, b = A · s + e), A← Zm×nq ,

s← Znq, which is a secret, and e← χn

σ where the χσ is a normal distribution

16

Page 57: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

with mean 0 and standard deviation σ on Z. If we find the shortest vectorof it, one can distinguish the distribution of LWE samples from uniformlydistribution. The advantage of the distinguishing attack is very close to ϵ =

exp(−π · (∥y∥ · s/q)2). For security, it is sufficient to take a ℓ∞ norm of theshortest vector y less than α · q/σ where α =

√log(1/ϵ)/π. Actually, the

size of the norm has the minimum of q and δmqn/m where δ is called theroot-Hermite factor by [8]. In case of δmqn/m, the optimal value of m is√

n log(q)/log(δ). By BKZ algorithm, we have a relation between the run-time in seconds and root-Hermite factor as λ = 1.8/log2 δ − 110. Then, therelation

α · q/σ < 22√

n log2 (q) log2 (δ) (4.1.1)

is obtained. Let q be a 127-bit prime and n = 212 which is a degree ofpolynomial ϕn(x) of quotient ring R = Z/(Φn(x)), all of which depends onsecurity parameter λ. Fix the key distribution assumed to be bounded byBkey = 1 for evaluating the key switching step and the error distributionbounded by Berr = 6σerr where σerr = 8 with Ring-LWE assumption. Theseparameters with ω = 232 are presented and used for implementation of thescheme by Bos et al. [1]. The maximum of the depth L is 2 through thecomputation of the noise bound with L2.

4.2 Implementation of the SchemeWe implemented the scheme Y ASHE ′ in C++ with NTL library while Boset al. [1] implemented directly in C which does not depend on any othernumber theory library. For given parameters of the section 4.1, we obtain therunning times of the scheme on average values over 100 tests and implementit on an Intel Core i7, 3.4 GHz, 16GB RAM. The result of implementationat level 1 is that key generation runs in 152 ms, encryption runs in 21 ms,addition of ciphertexts in 44 µs, multiplication of ciphertexts including thekey-switching in 29 ms, and decryption runs in 7 ms.

17

Page 58: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

4.2.1 OptimizationBefore optimization, we define the Y ASHE.Discard function of Bos et al. [1],which has a input ciphertext c and output ciphertext c′ as

c′ = YASHE.Discardω(c, i) = ⌊ω−ic⌋.

It is a truncating function by removing an insignificant multiple of ω-wordsof the ciphertext c. If ωi-words are thrown away, ωic is equal to c except leasti-th bit which is zero. If fc = m+ v(modq), then ωic′f = m+ v′(modq)with ∥v′∥∞ ≤ ∥v∥∞ +

1

2δωi∥f∥∞. Therefore, both cihpertext length and the

number of components of the evaluation key are reduced per multiplicationof the key-switching procedure. Since the noise increase with size 1

2δωi∥f∥∞,

the inherent noise ∥v′∥∞ of level L is bounded by C ′L1 · V ′ +LC ′L−1

1 C ′2 where

C ′1, C

′2, and V are the same as (3.2.2), (3.2.3) and

∥v′∥∞ ≤ ∥v∥∞ +1

2δωi∥f∥∞

≤ V +1

2δωi∥f∥∞ ≤ V +

1

2δωi(1 + t) = V ′. (4.2.1)

If C ′L1 ·V ′+LC ′L−1

1 C ′2 is bounded by

2then it could be correctly decrypt-

able.

To sum up all conditions of the noise bound, we get approximately in-equalities that represent relations of n, ω, q, t and ℓ by

n2t3n

2ωi ≤ q

2t⇒ n3t4ωi ≤ q if i ≥ 1

n2t2(ℓω,q · ω ·Berr) ≤q

2t⇒ 2n2t3(ℓω,q · ω ·Berr) ≤ q

log (q)− 3

2√

log (q) log (δ)≤√n, ⌊logω (q)⌋+ 2 = ℓω,q.

These are convenience for evaluating the noise fast regarding parameters.The first and second equality is derived from (4.2.1), (3.2.2) and (3.2.3), andthe third equality is induced from (4.1.1).

18

Page 59: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

For given parameters from section 4.1, we present data of the scheme im-plemented by comparing the result which is already presented before startingthe section 4.2 with using the Y ASHE.Discard function. In given param-eters, we percieve that the value i has the maximum 1 which means thatω-words can be discarded and one evaluation key diminish. Look into thetable 4.1 that shows the running time of multiplication by millisecond.

KeyGen Encrypt Add Mult Decrypti=0 143 21 0.044 29 7i=1 136 20 0.044 28 6

Table 4.1: Running times of logω = 32, t = 1024 for unit [ms]

We can see that the multiplication time decreases about 3 percent andkey generation time decreases about 4 percent compared with i = 0 that dosenot use the discarding function. Particularly, the addition time is the short-est than the others about 1000 times. Unless q and n change, the timings ofencryption, decryption and addition do not fluctuate.

According the parameter ω, the number of elements of the evaluationkey varies such that the running time changes. We derived the fact that thenumber of components is a reciprocal proportion to ω as the way of keygeneration. Therefore, we implement it by changing logω = 32 to logω = 48

to make more efficient. The variation of ω cause the components of evaluationkey to drop to ℓ248,q = 4 from ℓ232,q = 5. However, we can not use ω morethan 264 to reduce them because the inherent noise of multiplication increasetoo large to decrypt. The result of implementation with logω = 48 usingY ASHE.Discard function is shown by Table 4.2.

KeyGen Encrypt Add Mult Decrypti=0 117 19 0.044 24 6i=1 116 20 0.044 23 5

Table 4.2: Running times of logω = 48, t = 1024 for unit [ms]

In this case, the effect of the function is very slight as the running time

19

Page 60: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

of key generation decreases about 0.85 percent and that of multiplication de-creases about 4 percent. But there is some effects on ω as the one decreasesabout 14 ∼ 18 percent and the other decreases about 17 percent from table4.1 and table 4.2.

Furthermore, we implement it by changing the parameter t which decidesmessage space as the ring R256 instead of R1024. Table 4.3 shows the exper-imental result of that parameter. It uses logω = 48 rather than logω = 32

because we already know the former makes this scheme faster than the latter.

KeyGen Encrypt Add mul Decrypti=0 121 20 0.044 25 6i=1 113 20 0.044 23 6

Table 4.3: Running times of logω = 48, t = 256 for unit [ms]

The variation of t does not have any effects on running time from table4.2 and table 4.3. But the time of key generation decreases about 6 percentand that of multiplication decreases about 8 percent by using this function.

In the similar manner, we use logω = 64 to reduce procedure of key-switching, which can only use ℓω,q = 3 components of evaluation key withoutdiscarding words. If not, we should use ℓω,q = 4 components. To make thescheme faster, we may consider Y ASHE.Discard function. However, usingthis function makes it impossible to decrypt correctly since the inherent noiseis too large to decrypt. Its experimental result is provided by table 4.4.

KeyGen Encrypt Add Mul Decrypti=0 97 19 0.044 22 6

Table 4.4: Running times of logω = 64, t = 256 for unit [ms]

The data of the table is about 19 percent of key generation and about12 percent of multiplication faster than the result of the table 4.3 without

20

Page 61: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

CHAPTER 4. IMPLEMENTATION

discarding words.

From some experimental results, we can deduced that the value ω, whichaffects the process of key-switching with the number of components of eval-uation key, and the fact that whether Y ASHE.Discard function is used ornot are the important factors for deciding the running times. When the pairof n and q consist of very small size, the maximal depth (or level ) Lmax

is very low. Since bootstrapping requires the depth L to be about 50, weadditively implement the scheme under this circumstances, which should beset as the optimal parameter q = 2048 bit prime, t = 2, n = 216, ω = 293,i = 1, and ℓ = 8.

KeyGen Encrypt Mul Decrypti=1 8.5 0.3 296 0.09

Table 4.5: Running times of L = 50, logω = 293, t = 2 for unit [s]

21

Page 62: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Chapter 5

Conclusion

For fixed parameter q that is a 127 bit prime and polynomial degree n = 212,we provide the experimental data by implementing the BLLN scheme. Then,we performed optimization by adjusting parameters and using particularfunction Y ASHE.Discard. Its results is presented by tables. When the pa-rameter t, which determines message space, is fixed by 1024, the runningtimes are reduced about 18 percent of key generation and about 20 percentof multiplication. When t is 256, the one decreases about 19 percent and theother decreases about 12 percent. As a result, we can see which parametersmake the scheme faster and how to choose these parameters we want to im-plement it as well as we can estimate how faster it is, depending on sometechnique of optimization.

22

Page 63: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

Bibliography

[1] J. Bos, K. Lauter, J. Loftus, and M. Naehrig. Improved security fora ring-based fully homomorphic encryption scheme. Cryptology ePrintArchive, Report 2013/075, 2013. http://eprint.iacr.org/2013/075/.

[2] Z. Brakerski. Fully homomorphic encryption without modulus switch-ing from classical GapSVP. In Advances in Cryptology - Crypto 2012,volume 7417 of Lecture Notes in Computer Science, pages 868-886.Springer, 2012.

[3] Z. Brakerski, C. Gentry, and V. Vaikuntanathan. Fully homomorphicencryption without bootstrapping. In ITCS, pages 309-325, 2012.

[4] C. Gentry. A fully homomorphic encryption scheme, Stanford UniversityPhD thesis, 2009, http://crypto.stanford.edu/craig/craig-thesis.pdf.

[5] C. Gentry. Fully homomorphic encryption using ideal lattices. In MichaelMitzenmacher, editor, STOC, pages 169-178. ACM, 2009.

[6] S. Goldwasser and S. Micali. Probabilistic encryption and how to playmental poker keeping secret all partial information, in Proceedings ofthe 14th ACM Symposium on Theory of Computing|STOC 1982, ACM(1982), 365-377.

[7] J. Hoffstein, J. Pipher, and J. H. Silverman. NTRU: A ring-based publickey cryptosystem. In J. Buhler, editor, ANTS, volume 1423 of LectureNotes in Computer Science, pages 267-288. Springer, 1998.

[8] R. Lindner and C. Peikert. Better key sizes (and attacks) for LWE-based encryption. In Proceedings of the 11th international conference on

23

Page 64: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

BIBLIOGRAPHY

Topics in cryptology:CT-RSA 2011, CT-RSA’11, pages 319-339, Berlin,Heidelberg, 2011. Springer Verlag.

[9] A. Lopez-Alt, E. Tromer, and V. Vaikuntanathan. On-the-fly multipartycomputation on the cloud via multikey fully homomorphic encryption.In STOC, pages 1219-1234, 2012.

[10] V. Lyubashevsky and D. Micciancio. Generalized compact knapsacks arecollision resistant. In Michele Bugliesi, Bart Preneel, Vladimiro Sassone,and Ingo Wegener, editors, ICALP (2), volume 4052 of Lecture Notesin Computer Science, pages 144-155. Springer, 2006.

[11] V. Lyubashvesky, C. Peikert, and O. Regev. on ideal lattices and learningwith errors over rings. In EUROCRYPT, volume6110 of Lecture notesin Computer Science, page 1-23, 2010.

[12] R. Rivest, L. Adleman, and M. Dertouzos. On Data Banks and Pri-vacy Homomorphisms, in Foundations of Secure Computation, Aca-demic Press, New York (1978), 169-180.

[13] D. Stehle and R. Steinfeld. Making NTRU as secure as worst-case prob-lems over ideal lattices. In Advances in Cryptology - EUROCRYPT2011 - 30th Annual International Conference on the Theory and Appli-cations of Cryptographic Techniques, volume 6632 of Lecture Notes inComputer Science, page 27. Springer, 2011.

24

Page 65: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

국문초록

Rivest외 3명은암호화된상태에서계산가능한완전동형암호를제시하였다.그러나이암호체계는안전하지않는것으로판명되어이후이를변형하거나개선된 수많은 동형암호들이 소개되었다. 그 중 Lopez-Alt 외 3명이 제안한완전동형암호는 NTRU 암호체계에 기반한 것으로 다른 암호체계보다 더효율적이다. Bos 외 3명은 그들의 스킴보다 효율성면에서 개선된 암호화알고리즘을 개발하였다. 이는 Lopez-Alt 외 3명의 암호체계에 기반된 DSPR문제와 Modulus switching 단계를 제거한 결과로 본 논문은 이들이 제안한암호알고리즘을 살펴봄과 동시에 구현 및 최적화한 결과를 분석하여 제시한다.

주요어휘: BLLN,NTRU,동형암호,구현학번: No. 2011-23211

Page 66: Implementation of Ring-based Homomorphic Encryptions-space.snu.ac.kr/bitstream/10371/131475/1/000000017337.pdf · 2019-11-14 · Abstract Fully homomorphic encryption(FHE) was introduced

감사의 글

학위 기간동안 부족한 제자를 보살펴주시고 아낌없는 조언과 가르침을 주신천정희 선생님께 감사의 말씀드립니다. 선생님께 학문에 대한 열정과 삶의지혜를 배웠습니다. 그리고 석사 논문 심사를 해주신 이기암 교수님, 오병권교수님께 감사드립니다.논문작성에 있어서 많은 조언과 도움을 주신 이문성 박사님께 감사드립

니다. 논문 교정을 함께 해준 미란언니, 현숙언니, chocolat au lait를 사주며격려를 아끼지 않았던 충훈 오빠, 심사준비에 도움을 준 형태오빠, 한솔언니그리고 길지 않은 시간을 함께 보낸 연구실 선후배 동료들에게 감사합니다.대학원에서 서로를 의지하며 보낸 대학원 동기들, 혜림이, 누리언니, 도영이,지연이, 미림이, 경민오빠, 찬우오빠에게도 감사합니다.무엇보다도 저에게 가장 큰 힘이 되어주신 부모님, 학위과정에서의 조언

과 격려를 많이 해주신 친척분들과 제가 가장 아끼는 동생에게도 감사의 말전합니다. 마지막으로학부교수님들을비롯하여이자리까지올수있게해준모든 분들께 감사를 표합니다.