Transcript

Jung Hee Cheon (SNU, CryptoLab)

Approximate Homomorphic Encryption and Privacy Preserving Machine Learning

Thanks to YongSoo Song, Kiwoo Lee, Andrey KIM

1. Homomorphic Encryption2. HEAAN3. Bootstrapping of HEAAN4. Toolkit for Homomorphic Computation

Outline

Integer-based HE scheme

- RAD PH[1]

โ€ข (Secret Key, Operation Key) = (a large prime ๐‘, ๐‘› = ๐‘๐‘ž0)โ€ข Encryption: ๐ธ๐‘›๐‘ ๐‘š = ๐‘š + ๐‘๐‘ž ๐‘š๐‘œ๐‘‘ ๐‘›โ€ข Decryption: ๐ธ๐‘›๐‘ ๐‘š ๐‘š๐‘œ๐‘‘ ๐‘ = ๐‘šโ€ข ๐ธ๐‘›๐‘ ๐‘š1 + ๐ธ๐‘›๐‘ ๐‘š2 = ๐‘š1 + ๐‘๐‘ž1 + ๐‘š2 + ๐‘๐‘ž2

= ๐‘š1 +๐‘š2 + ๐‘ ๐‘ž1 + ๐‘ž2= ๐ธ๐‘›๐‘ ๐‘š1 +๐‘š2

- DGHV HE scheme (on โ„ค2)[2]

โ€ข ๐ธ๐‘›๐‘(๐‘š โˆˆ ๐‘2100) = ๐‘š + 2100๐‘’ + ๐‘๐‘žโ€ข SECURE against quantum computingโ€ข Use a polynomial ring ๐‘…๐‘ž = โ„ค๐‘ž[๐‘ฅ]/(๐‘ฅ๐‘› + 1)

Homomorphic Encryption

But, INSECURE!

2100๐‘’1 ๐‘š1

2100๐‘’2 ๐‘š2

2200๐‘’1๐‘’2 + 2100 ๐‘š1๐‘’2 +๐‘š2๐‘’1 + ๐‘š1๐‘š2

X

- On Polynomials (RingLWE)โ€ข [Gen09] ideal latticeโ€ข NTRU: LTV12โ€ข Ring-LWE: BV11b, GHS13, BLLN13, HEAAN etc

- On Integers (AGCD)โ€ข [DGHV10] FHE over the Integers. Eurocrypt 2010โ€ข CMNT11, CNT12, CCKLLTY13, CLT14, etc

- On Matrices (LWE)โ€ข [BV11a] Efficient FHE from (Standard) LWE. FOCS11โ€ข Bra12, BGV12, GSW13

Fully Homomorphic Encryption

1. 2009~2012: Plausibility and Scalable for Large Circuitsโ€ข [GH11] A single bit bootstrapping takes 30 minutesโ€ข [GHS12b] 120 blocks of AES-128 (30K gates) in 36 hours

2. 2012~2015: Depth-Linear Constructionโ€ข [BGV12] Modulus/Key Switchingโ€ข [Bra12] Scale Invariant Schemeโ€ข [HS14] IBM's open-source library Helib: AES evaluation in 4 minutes

3. 2015~Today: Usabilityโ€ข Various schemes with different advantages (HEAAN, TFHE)โ€ข Real-world tasks: Big data analysis, Machine learningโ€ข Competitions for Private Genome Computation (iDash, 2014~)โ€ข HE Standardization meetings (2017~)

Continued on next page

Summary of Progress in HE

Standardization: HomomorphicEncryption.org

1st Workshop (2017.7.13-14) 2nd Workshop (2018.3.15-16) 3rd Workshop (2018.10.20)

Jul 2017 in Microsoft, Redmond

Mar 2018 in MIT

Oct 2018 in Toronto

Best Performing HE Schemes

Type Classical HE Fast Bootstrapping Approximate Computation

Scheme[BGV12] BGV

[Bra12, FV12] B/FV[DM15] FHEW[CGGI16] TFHE

[CKKS17] HEAAN

PlaintextFinite Field

PackingBinary string

Real/Complex numbers

Packing

Operation Addition, Multiplication Look-up table & bootstrapping Fixed-point Arithmetic

LibraryHElib (IBM)

SEAL (Microsoft Research)

Palisade (Duality inc.)

TFHE(Inpher, Gemalto, etc.)

HEAAN (SNU)

Homomorphic Encryption

2. HEAAN: Approximate Homomorphic Encryption

Exact Multiplication

1.23

4.56

0.78

0.91

5.6088

0.7098

3.98112624

2.34

5.67

8.91

0.23

13.2678

2.0493

27.18970254

108.2456382397886496

- The plaintext size is doubled after a multiplication.2 4

8

16

Approximate Multiplication

HEAAN [CKKS17]โ€ข Rescale after a multiplicationโ€ข Tracing # of significandsโ€ข Most data is processed approximately in Data analysis or ML

1.23

4.56

0.78

0.91

5.6188

0.7198

3.98112624

2.34

5.67

8.91

0.23

13.2778

2.0593

27.19970254

108.2556382397886496

2 2

2

2

HEAAN = ๆ…ง็œผ = Insightful Minds

[CKKS, AC17] Homomorphic Encryption for Arithmetic of Approximate Numbershttps://eprint.iacr.org/2016/421.pdf

Numerical Representation

- Encode ๐‘š into an integer ๐‘š โ‰ˆ ๐‘๐‘ฅ for a scaling factor ๐‘ : 2 โ†ฆ 1412 โ‰ˆ 2 โ‹… 103

- Fixedโ€“Point Multiplicationโ€ข Compute ๐‘š = ๐‘š1๐‘š2 and extract its significant digits ๐‘šโ€ฒ โ‰ˆ ๐‘โˆ’1 โ‹… ๐‘š

: 1.234 ร— 5.678 = 1234 โ‹… 10โˆ’3 ร— 5678 โ‹… 10โˆ’3 = 7006652 โ‹… 10โˆ’6 โ†ฆ 7007 โ‹… 10โˆ’3 = 7.007

Previous HE on LWE problem (Regev, 2005)

โ€ข ct = Encsk ๐‘š , ct, sk =๐‘ž

๐‘ก๐‘š + ๐‘’ mod ๐‘ž

โ€ข Modulo ๐‘ก plaintext vs Rounding operation

Approximate Computation

๐‘š

๐‘ž/๐‘ก

๐‘’

๐‘ก

A New Message Encodingโ€ข ct = Encsk ๐‘š , ct, sk = ๐‘๐‘š + ๐‘’ mod ๐‘ž

โ€ข Consider ๐‘’ as part of approximation error

Homomorphic Operations

Support for the (approximate) fixed-point arithmetic

- Leveled HE : ๐‘ž = ๐‘๐ฟ

HEAAN

Input ๐œ‡1 โ‰ˆ ๐‘๐‘š1, ๐œ‡2 โ‰ˆ ๐‘๐‘š2

Addition ๐œ‡1 + ๐œ‡2 โ‰ˆ ๐‘ โ‹… (๐‘š1 +๐‘š2)

Multiplication ๐œ‡ = ๐œ‡1๐œ‡2 โ‰ˆ ๐‘2 โ‹… ๐‘š1๐‘š2

Rounding ๐œ‡โ€ฒ โ‰ˆ ๐‘โˆ’1 โ‹… ๐œ‡ โ‰ˆ ๐‘ โ‹… ๐‘š1๐‘š2

๐œ‡1 = ๐‘๐‘š1 + ๐‘’1

๐‘ž๐œ‡2 = ๐‘๐‘š2 + ๐‘’2

๐œ‡ = ๐‘2๐‘š1๐‘š2 + ๐‘’

๐œ‡โ€ฒ = ๐‘ โ‹… ๐‘š1๐‘š2 + ๐‘’โ€ฒ

๐‘ž/๐‘

Construction over the ringโ€ข A single ctx can encrypt a vector of plaintext values ๐‘ง = (๐‘ง1, ๐‘ง2, โ€ฆ , ๐‘งโ„“)โ€ข Parallel computation in a SIMD manner ๐‘ง โŠ—๐‘ค = (๐‘ง1๐‘ค1, ๐‘ง2๐‘ค2, โ€ฆ , ๐‘งโ„“๐‘คโ„“)

HEAAN Packed Ciphertext

Continued on next page

Let ๐‘… = โ„ค ๐‘‹ ๐‘‹๐‘› + 1 and ๐‘…๐‘ž = ๐‘… mod ๐‘ž = โ„ค๐‘ž ๐‘‹ ๐‘‹๐‘› + 1

โ€ข A ciphertext can encrypt a polynomial ๐‘š ๐‘‹ โˆˆ ๐‘…โ€ข Note (m0+m1X+ โ€ฆ ) (m0โ€™+m1โ€™X+ โ€ฆ )= m0m0โ€™+(m0m1โ€™ +m0โ€™m1)X+โ€ฆ

โ€ข Decoding/Encoding function๐‘… = โ„ค ๐‘‹ ๐‘‹๐‘› + 1 โŠ† โ„ ๐‘‹ ๐‘‹๐‘› + 1 โ†’ โ„‚๐‘›/2

where ๐‘‹๐‘› + 1 = ๐‘‹ โˆ’ ๐œ1 ๐‘‹ โˆ’ ๐œ1โˆ’1 ๐‘‹ โˆ’ ๐œ2 ๐‘‹ โˆ’ ๐œ2

โˆ’1 โ‹ฏ ๐‘‹ โˆ’ ๐œ ๐‘› 2 ๐‘‹ โˆ’ ๐œ ๐‘› 2โˆ’1

โ€ข Example: ๐‘› = 4, ๐œ1 = ๐‘’๐‘ฅ๐‘(๐œ‹๐‘–/4), ๐œ2 = ๐‘’๐‘ฅ๐‘(5๐œ‹๐‘–/4)

โ€ข ๐‘ง = 1 โˆ’ 2๐‘–, 3 + 4๐‘– โ†ฆ ๐‘š ๐‘‹ = 2 โˆ’ 2 2 ๐‘‹ + ๐‘‹2 โˆ’ 2 ๐‘‹3

โ€ข โ†ฆ ๐œ‡ ๐‘‹ = 2000 โˆ’ 2828๐‘‹ + 1000๐‘‹2 โˆ’ 1414 ๐‘‹3

โ€ข ๐œ‡ ๐œ1 โ‰ˆ 1000.15 โˆ’ 1999.55 ๐‘–, ๐œ‡ ๐œ2 โ‰ˆ 2999.85 + 3999.55 ๐‘–

RLWE-based HEAAN

๐‘š ๐‘‹ โ†ฆ ๐‘ง = ๐‘ง1, โ€ฆ , ๐‘ง๐‘›โˆ•2 , ๐‘ง๐‘– = ๐œ‡ ๐œ๐‘– ,

3. Bootstrapping of HEAAN

Bootstrapping

Decryption๐ธ๐‘›๐‘๐‘˜(๐พ)

๐ธ๐‘›๐‘(๐‘)

c = ๐ธ๐‘›๐‘๐‘˜(๐‘š; ๐‘Ÿ)

๐พ

๐‘š

๐ธ๐‘›๐‘๐‘˜ ๐‘š; ๐‘Ÿโ€ฒ , ๐‘Ÿโ€ฒ: small

Safe Box

[1] Cheon-Han-Kim-Kim-Song: Bootstrapping for Approximate Homomorphic Encryption. EUROCRYPT 2018

โ€ข Old Ciphertext with large noise

โ€ข Encrypted Secret Key

โ€ข New ciphertext with small noise

โ€ข Evaluate Decrypt circuit

Input

Output

Process

โ€ข Ciphertexts of a leveled HE have a limited lifespanโ€ข Refresh a ciphertext ct = Encsk ๐‘š

by evaluating the decryption circuit homomorphically: Decsk ct = ๐‘š โŸบ ๐นct sk = ๐‘š where ๐นct โˆ— = Decโˆ— ct

โ€ข Bootstrapping key BK = Encsk(sk): ๐นct BK = ๐นct Encsk sk = Encsk ๐นct sk = Encsk(๐‘š)

โ€ข Homomorphic operations introduce errors Fine: ๐นct BK = ๐นct Encsk sk = Encsk ๐นct sk + ๐‘’ = Encsk(๐‘š + ๐‘’)

โ€ข How to evaluate the decryption circuit (efficiently)?: Decsk ct = ct, sk (mod ๐‘ž)

Bootstrapping

๐ท๐‘’๐‘๐‘ ๐‘˜ ๐‘๐‘ก โ†ฆ ๐‘ก = ๐‘๐‘ก, ๐‘ ๐‘˜ โ†ฆ ๐‘ก ๐‘ž = ๐œ‡,

๐‘ก = ๐‘ž๐ผ + ๐œ‡ for some ๐ผ < ๐พ

โ€ข Naรฏve solution: polynomial interpolation on [โˆ’๐พ๐‘ž, ๐พ๐‘ž]โ€ข Huge depth, complexity & inaccurate result

Approximate Decryption

๐ท๐‘’๐‘๐‘ ๐‘˜ ๐‘๐‘ก โ†ฆ ๐‘ก = ๐‘๐‘ก, ๐‘ ๐‘˜ โ†ฆ ๐‘ก ๐‘ž = ๐œ‡,

๐‘ก = ๐‘ž๐ผ + ๐œ‡ for some ๐ผ < ๐พ

โ€ข Idea1: Restriction of domain ๐œ‡ โ‰ช ๐‘ž

Approximate Decryption

โ€ข Idea1: Restriction of domain ๐œ‡ โ‰ช ๐‘ž

โ€ข Idea 2: Sine approximation ๐œ‡ โ‰ˆ๐‘ž

2๐œ‹sin ๐œƒ for ๐œƒ =

2๐œ‹

๐‘ž๐‘ก (period:๐‘ž , slope at 0=1)

๐‘ž

1

๐ท๐‘’๐‘๐‘ ๐‘˜ ๐‘๐‘ก โ†ฆ ๐‘ก = ๐‘๐‘ก, ๐‘ ๐‘˜ โ†ฆ ๐‘ก ๐‘ž = ๐œ‡,

๐‘ก = ๐‘ž๐ผ + ๐œ‡ for some ๐ผ < ๐พ

Approximate Decryption

Sine Evaluation

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

0

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

1

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

2

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

3

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

4

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

5

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

6

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formula

โ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜2 ๐œƒ โˆ’ ๐‘†๐‘˜

2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

7

Bootstrapping of HEAAN

Sine Evaluation

- Direct Taylor approximationโ€ข Huge depth & complexity

- Idea 1: Low-degree approx. near 0

โ€ข ๐ถ0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜ ! ๐œƒ 2๐‘Ÿ 2๐‘˜ โ‰ˆ cos ๐œƒ 2๐‘Ÿ

โ€ข ๐‘†0 ๐œƒ = ๐‘˜=0๐‘‘ โˆ’1 ๐‘˜

2๐‘˜+1 ! ๐œƒ 2๐‘Ÿ 2๐‘˜+1 โ‰ˆ sin( ๐œƒ 2๐‘Ÿ)

- Idea 2: Iterate by double-angle formulaโ€ข ๐ถ๐‘˜+1 ๐œƒ = ๐ถ๐‘˜

2 ๐œƒ โˆ’ ๐‘†๐‘˜2 ๐œƒ , ๐‘†๐‘˜+1 ๐œƒ = 2๐‘†๐‘˜ ๐œƒ โ‹… ๐ถ๐‘˜ ๐œƒ

โ€ข Numerically stable & Linear complexity๐‘†๐‘Ÿ ๐œƒ โ‰ˆ sin ๐œƒ

8

Bootstrapping of HEAAN

Iteration vs Direct Computation

- ๐‘†๐‘Ÿ(๐œƒ) is obtained from ๐‘†0(๐œƒ) and ๐ถ0(๐œƒ) by ๐‘Ÿ iterationsโ€ข One computation of Doubleโ€“angle formula: 2 squarings + 1 additionโ€ข ๐‘Ÿ iterations take 2๐‘Ÿ squarings + ๐‘Ÿ additionsโ€ข Degree of ๐‘†๐‘Ÿ(๐œƒ) โ‰ˆ 2๐‘Ÿ

- Direct Taylor Approximationโ€ข 2๐‘Ÿ multiplications to get 2๐‘Ÿ degree approximation ๐‘‡2๐‘Ÿ of sine function

Bootstrapping of HEAAN

Slot-Coefficient Switching

- Ringโ€“based HEAANโ€ข Homomorphic operations on plaintext slots, not on coefficientsโ€ข We need to perform the modulo reduction on coefficients

- Pre/post computation before/after sine evaluationโ€ข Depth consumption: Sine evaluationโ€ข Complexity: Slot-Coefficient switchings (# of slots)

- Performance of Bootstrapping

- Experimental Resultsโ€ข 127 + 12 = 139 s / 128 slotsร—12 bitsโ€ข 456 + 68 = 524 s / 128 slotsร—24 bits

Coefficient Plaintext Slots

โ„ ๐‘‹ ๐‘‹๐‘› + 1 โ„‚ ๐‘› 2

๐‘ก ๐‘‹ = ๐‘ž โ‹… ๐ผ ๐‘‹ + ๐œ‡(๐‘‹)

(๐‘ก0, ๐‘ก1, โ€ฆ ๐‘ก๐‘›โˆ’1)

(๐œ‡0, ๐œ‡1, โ€ฆ , ๐œ‡๐‘›โˆ’1)

๐œ‡ ๐‘‹ = ๐œ‡0 +โ‹ฏ+ ๐œ‡๐‘›โˆ’1๐‘‹๐‘›โˆ’1

โ‘  coeff to slotโ‘ก sine eval

โ‘ข slot to coeff

Bootstrapping of HEAAN

Speed of FHE

2011 2013 2014 2015 2016 2018

1-bit Amortized

1bit, 1800s

1bit, 0.7s

1bit, 0.052s

*120s, 250K bit

172s, 531bit 320s, 16K bit

1800s โ†’ 0.05s (1bit) 1800s โ†’ 0.00046s (Amortized)

: 30K~300K times

*[CHH18]Faster Homomorphic Discrete Fourier Transforms and Improved FHE Bootstrapping, eprint, 1073, 2018/ Intel Xeon CPU E5-2620 2.10GHz, 64RAM

[GH11] Implementing Gentryโ€™s Fully-Homomorphic Encryption Scheme, Eurocrypt 2011.[CCK+13] Batch Fully Homomorphic Encryption over the Integers, Eurocrypt 2013.[CLT14] Scale-Invariant Fully Homomorphic Encryption over the Integers, PKC 2014.[HS15] Bootstrapping for Helib, Eurocrypt 2015[DM15] FHEW: Boostrapping Homomorpic Encryption in Less Than a Second, Eurocrypt 2015.[CGGI16] Faster Fully Homomorphic Encryption: Bootstrapping in less than 0.1 Seconds, Asiacrypt 2016.

Secure Genome Analysis Competition

Hosted by Sponsored by AIM

Privacy Preserving Genom Analysis

Slide Courtesy of Xiaoqian Jiang (โ–ณ = too small iteration โ†’ hard to adapt for other data)

Rank

1

3

โ–ณ

โ–ณ2

X

X

2017 Track 3: Logistic Regression Training on Encrypted Data

2018 Track 2 : Secure Parallel Genome Wide Association Studies using HE

Team Submission Schemes

End to End Performance Evaluation result ( F1- Score ) at different cutoffs

Running

time

(mins)

Peak

Memory (M)

0.01 0.001 0.0001 0.00001

Gold Semi Gold Semi Gold Semi Gold Semi

A*FHE

A*FHE -1 +

HEAAN

922.48 3,777 0.977 0.999 0.986 0.999 0.985 0.999 0.966 0.998

A*FHE -2 1,632.97 4,093 0.882 0.905 0.863 0.877 0.827 0.843 0.792 0.826

ChimeraVersion 1 + TFHE & HEAAN

(Chimera)

201.73 10,375 0.979 0.993 0.987 0.991 0.988 0.989 0.982 0.974

Version 2 215.95 15,166 0.339 0.35 0.305 0.309 0.271 0.276 0.239 0.253

Delft BlueDelft Blue

HEAAN1,844.82 10,814 0.965 0.969 0.956 0.944 0.951 0.935 0.884 0.849

UC San

Diego

Logistic Regr + HEAAN 1.66 14,901 0.983 0.993 0.993 0.987 0.991 0.989 0.995 0.967

Linear Regr 0.42 3,387 0.982 0.989 0.980 0.971 0.982 0.968 0.925 0.89

Duality IncLogistic Regr +

CKKS (Aka HEAAN),

pkg: PALISADE

3.8 10,230 0.982 0.993 0.991 0.993 0.993 0.991 0.990 0.973

Chi2 test 0.09 1,512 0.968 0.983 0.981 0.985 0.980 0.985 0.939 0.962

Seoul

National

University

SNU-1

HEAAN

52.49 15,204 0.975 0.984 0.976 0.973 0.975 0.969 0.932 0.905

SNU-2 52.37 15,177 0.976 0.988 0.979 0.975 0.974 0.969 0.939 0.909

IBMIBM-Complex CKKS

(Aka HEAAN),

pkg: HElIb

23.35 8,651 0.913 0.911 0.169 0.188 0.067 0.077 0.053 0.06

IBM- Real 52.65 15,613 0.542 0.526 0.279 0.28 0.241 0.255 0.218 0.229

Slide Courtesy of Xiaoqian Jiang

4. Toolkit for Homomorphic Computation

Packing Method

- HEAAN supports vector operations- How can we compute matrix operations for ciphertexts?

- Matrix Encoding method

How to Pack

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

Encode

1 2 โ‹ฏ 16๐‘ = ๐ธ๐‘›๐‘( )

Packing Method

- Matrix addition : trivial- Matrix multiplication : non-trivial (exercise)- Row/column rotation?

How to rotate

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

4 1 2 3

8 5 6 7

12 9 10 11

16 13 14 15

๐‘Ÿ๐‘œ๐‘ก ๐‘, 1 = ๐ธ๐‘›๐‘( 16 1 โ‹ฏ 15 ) =

16 1 2 3

4 5 6 7

18 9 10 11

12 13 14 15

(wrong)

Packing Method

- Solution : using masking vector

How to rotate

16 1 2 3

4 5 6 7

8 9 10 11

12 13 14 15

โŠ™

0 1 1 1

0 1 1 1

0 1 1 1

0 1 1 1

=

0 1 2 3

0 5 6 7

0 9 10 11

0 13 14 15

๐‘Ÿ๐‘œ๐‘ก ๐‘, 1 โŠ™๐‘š๐‘Ž๐‘ ๐‘˜ =

4 5 6 7

8 9 10 11

12 13 14 15

16 1 2 3

โŠ™

1 0 0 0

1 0 0 0

1 0 0 0

1 0 0 0

=

4 0 0 0

8 0 0 0

12 0 0 0

16 0 0 0

๐‘Ÿ๐‘œ๐‘ก ๐‘, โˆ’3 โŠ™๐‘š๐‘Ž๐‘ ๐‘˜โ€ฒ =

โˆด ๐ถ๐‘œ๐‘™๐‘…๐‘œ๐‘ก (๐‘) = ๐‘Ÿ๐‘œ๐‘ก ๐‘, 1 โŠ™๐‘š๐‘Ž๐‘ ๐‘˜ + ๐‘Ÿ๐‘œ๐‘ก ๐‘, โˆ’3 โŠ™๐‘š๐‘Ž๐‘ ๐‘˜โ€ฒ =

4 1 2 3

8 5 6 7

12 9 10 11

16 13 14 15

Message Space

- Bit-wise HE: โ„ค2={0,1} with logical gatesโ€ข Good at gate operations but slow at arithmetic.

- Word-wise HE: โ„‚ or โ„ค๐‘ with add. & mult.

โ€ข Good at poly evaluation but hard to evaluate non-poly function.

Idea: Use Polynomial Approximation for Non-Poly Functions!- Donโ€™t use naรฏve Taylor Approx. It is local i.e. approx at a point- Minimize errors on an interval- Methods: Least Square, Chevyshev, Minimax โ€ฆ

Polynomial Approximation

Application : Homomorphic Logistic Regression [HHCP]- Need to evaluate sigmoid function : 1/(1+exp(-x))

Real Financial Large Data (Provided by KCB) About 400,000 samples with 200 features. Target value = โ€œcredit scoreโ€

Polynomial Approximation

Idea: ๐ถ๐‘œ๐‘š๐‘ ๐‘Ž, ๐‘ = lim๐‘˜โ†’โˆž

๐‘Ž๐‘˜

๐‘Ž๐‘˜+๐‘๐‘˜for a,b>0

1. Compute approximately (Take only the msb of the results)

2. Choose k as a power of 2

3. Use iteration algorithms for division

Comparison

Method Scheme(Amortized)Running time

# of pairs Error

Bit-wiseHElib โ‰ˆ 1 ms 1800

0TFHE โ‰ˆ 1 ms -

Ours (Word-wise)

HEAAN 0.73 ms 216 < 2-8

General Max

๐‘€๐‘Ž๐‘ฅ ๐‘Ž1, โ€ฆ , ๐‘Ž๐‘ก = lim๐‘˜โ†’โˆž

๐‘Ž1๐‘˜+1+โ‹ฏ+๐‘Ž

๐‘ก๐‘˜+1

๐‘Ž1๐‘˜+โ‹ฏ+๐‘Ž

๐‘ก๐‘˜ for ai>0

2nd ๐‘€๐‘Ž๐‘ฅ ๐‘Ž1, โ€ฆ , ๐‘Ž๐‘ก = lim๐‘˜โ†’โˆž

๐‘Ž1๐‘˜+1+โ‹ฏ+๐‘Ž

๐‘ก๐‘˜+1โˆ’๐‘š๐‘Ž๐‘ฅ๐‘˜+1

๐‘Ž1๐‘˜+โ‹ฏ+๐‘Ž

๐‘ก๐‘˜โˆ’๐‘š๐‘Ž๐‘ฅ๐‘˜

Applications: k-max, threshold counting, clustering, โ€ฆ

Min/Max

Fast\Merge Sort: O(klogk)

- Comparison-based algorithm doesnโ€™t work on HE- We cannot check min-max condition

Sorting Network: O(klog2k)

- Comparison network that always sort their inputs- Data-independent algorithm

Results

- 64 slots : about 12 min. (previous work : 42 min. [EGN+15])- 32,768 slots : about 10.5 hour (previous work: impractical)

Sorting on Encrypted Data

Basic Tools:

Packing, Matrix Operation, Comparison, Approximate inv/sigmoid,

Decision Tree: Packing, Comparison

Boosting: Comparison and Gradient Decent

Deep Neural Network: Fast matrix operations + Approximate

Convolution Neural Network: + Comparison

Toward Homomorphic Machine Learning

HEAAN natively supports for the (approximate) fixed point arithmetic

Ciphertext modulus log ๐‘ž = ๐ฟ log ๐‘ grows linearly

Useful when evaluating analytic functions approximately:โ€ข Polynomialโ€ข Multiplicative Inverseโ€ข Trigonometric Functionsโ€ข Exponential Function (Logistic Function, Sigmoid Function)

Packing technique based on DFTโ€ข SIMD (Single Instruction Multiple Data) operationโ€ข Rotation on plaintext slots:

HEAAN: Summary

๐‘ง = ๐‘ง1, โ€ฆ , ๐‘ง ๐‘› 2 โ†ฆ ๐‘งโ€ฒ = (๐‘ง2, โ€ฆ , ๐‘ง ๐‘› 2, ๐‘ง1)

Thank you for your attention!๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.


Top Related