CHIFFREMENT (COMPLÈTEMENT) HOMOMORPHE:
DE LA THÉORIE À LA PRATIQUE
Tancrède Lepoint
CryptoExperts
C HIFFREMENT ( COMPLTEMENT ) HOMOMORPHE : DE LA THORIE LA PRATIQUE - - PowerPoint PPT Presentation
C HIFFREMENT ( COMPLTEMENT ) HOMOMORPHE : DE LA THORIE LA PRATIQUE Tancrde Lepoint CryptoExperts Sminaire sur la Confiance Numrique Jeudi 9 Octobre 2014 Outline 1. Introduction 1.1 What is Fully Homomorphic Encryption? Use
CryptoExperts
2 / 36
2 / 36
To:4442642999 (scam)
3 / 36
To: (scam)
3 / 36
Alice’s number: 444 264 2999
To: (scam)
3 / 36
4 / 36
5 / 36
6 / 36
◮ We assume communication with the Cloud is secure (e.g. HTTPS)
6 / 36
◮ For confidentiality, we use encryption
7 / 36
Storage/Retrieval ◮ For confidentiality, we use encryption
◮ Now... limited to storage/retrieval 7 / 36
Storage/Retrieval ◮ For confidentiality, we use encryption
◮ Now... limited to storage/retrieval ◮ This is not even what Dropbox/Google Drive/Microsoft OneDrive/Amazon
◮ Allow access control and sharing, interaction with whole app universe, etc. 7 / 36
8 / 36
◮ Additive Homomorphic Encryption:
8 / 36
◮ Additive Homomorphic Encryption:
◮ Multiplicative Homomorphic Encryption:
8 / 36
◮ Additive Homomorphic Encryption:
◮ Multiplicative Homomorphic Encryption:
8 / 36
9 / 36
◮ [RivestAdlemanDertouzos78]: notion of privacy homomorphism ◮ [GoldwasserMicali84]: XOR of bits ◮ [ElGamal84]: multiplication mod p ◮ [Paillier98]: addition mod N = pq ◮ [BonehGohNissim05]: additions and one multiplication mod p
10 / 36
◮ [RivestAdlemanDertouzos78]: notion of privacy homomorphism ◮ [GoldwasserMicali84]: XOR of bits ◮ [ElGamal84]: multiplication mod p ◮ [Paillier98]: addition mod N = pq ◮ [BonehGohNissim05]: additions and one multiplication mod p ◮ [Gentry09]: additions and multiplications mod 2!
10 / 36
◮ In theory, plentiful of applications
◮ Everything can be viewed as a circuit ◮ Humongous potential ◮ Solve many problems on privacy 11 / 36
◮ In theory, plentiful of applications
◮ Everything can be viewed as a circuit ◮ Humongous potential ◮ Solve many problems on privacy
◮ In practice... problem because of
◮ State-of-the-art in 2011: 30 minutes after
11 / 36
◮ In theory, plentiful of applications
◮ Everything can be viewed as a circuit ◮ Humongous potential ◮ Solve many problems on privacy
◮ In practice... problem because of
◮ State-of-the-art in 2011: 30 minutes after
◮ State-of-the-art in 2014: not much
◮ (But I heard about exciting new results to come...) 11 / 36
12 / 36
◮ Work over bits?
◮ e.g. computing
i=1 ti where ti are 8-bit values:
◮ 135 ‘×’ and ‘× depth’ = 8 if working over bits
◮ 0 ‘×’ if plaintext space is ≥ 2560 12 / 36
◮ Work over bits?
◮ e.g. computing
i=1 ti where ti are 8-bit values:
◮ 135 ‘×’ and ‘× depth’ = 8 if working over bits
◮ 0 ‘×’ if plaintext space is ≥ 2560
◮ “Real World”: limited number of multiplications
◮ Statistics on medical data: mean, variance, linear regression, etc. ◮ Geolocalization (Euclidean distance, etc.) 12 / 36
◮ Somewhat Homomorphic Encryption (SHE): limited number of
◮ Know in advance the × depth of the circuit to be evaluated
13 / 36
◮ Somewhat Homomorphic Encryption (SHE): limited number of
◮ Know in advance the × depth of the circuit to be evaluated
◮ Interestingly enough: FHE = (SHE that evaluates its decryption circuit)
◮ If c = Enc(m), run homomorphically Dec:
◮ We need to focus on applications driven by real use-cases having small
◮ Statistical Computations
◮ Mean ◮ Standard deviation
◮ Genomics (e.g. χ2 test: statistical tests) ◮ Machine learning ◮ ...
14 / 36
◮ Cloud want to compute the mean on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
15 / 36
◮ Cloud want to compute the mean on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
i=1 xi
15 / 36
◮ Cloud want to compute the mean on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
i=1 xi
15 / 36
◮ Cloud want to compute the mean on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
i=1 xi
15 / 36
◮ Cloud want to compute the mean on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
i=1 xi
n
15 / 36
◮ Cloud want to compute the variance on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
16 / 36
◮ Cloud want to compute the variance on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
n
n
n
16 / 36
◮ Cloud want to compute the variance on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
n
n
n
16 / 36
◮ Cloud want to compute the variance on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
n
n
n
n
◮ Cloud want to compute the variance on private values {x1,...,xn}
◮ SHE encryption scheme Enc (with decryption Dec)
n
n
n
n
16 / 36
◮ Application for genomic data
◮ In the following: Pearson Goodness-of-Fit to test for deviation from
17 / 36
◮ Population of N = NAA + NAa + Naa people with genotypes AA,Aa or aa ◮ Probabilities
18 / 36
◮ Population of N = NAA + NAa + Naa people with genotypes AA,Aa or aa ◮ Probabilities
◮ HWE:
A
a
18 / 36
◮ If the alleles are independent (i.e. HWE), then
A
a
19 / 36
◮ If the alleles are independent (i.e. HWE), then
A
a ◮ Compare the X 2 test-statistic below to the χ2-statistic with 1 degree of
◮ Can be rewritten as previously so that the multiplicative depth is 2
◮ Can be done homomorphically in an efficient manner! 19 / 36
◮ If the alleles are independent (i.e. HWE), then
A
a ◮ Compare the X 2 test-statistic below to the χ2-statistic with 1 degree of
◮ Can be rewritten as previously so that the multiplicative depth is 2
◮ Can be done homomorphically in an efficient manner!
19 / 36
◮ Public error-free element: x0 = q0 · p ◮ Secret key sk = p
21 / 36
◮ Public error-free element: x0 = q0 · p ◮ Secret key sk = p ◮ Ciphertext for m ∈ {0,1}:
c =
γ bits p : η bits r : ρ bits
21 / 36
◮ Public error-free element: x0 = q0 · p ◮ Secret key sk = p ◮ Ciphertext for m ∈ {0,1}:
◮ Decryption of c:
c =
γ bits p : η bits r : ρ bits
21 / 36
◮ How to Add and Multiply Encrypted Bits:
◮ Add/Mult two near-multiples of p gives a near-multiple of p ◮ c1 = q1 · p + 2 · r1 + m1,
◮ c1 + c2 = p · (q1 + q2) + 2 · (r1 + r2) + m1 + m2
◮ c1 · c2 = p · (c2q1 + c1q2 − q1q2) + 2 · (2r1r2 + r2m1 + r1m2) + m1 · m2
22 / 36
◮ How to Add and Multiply Encrypted Bits:
◮ Add/Mult two near-multiples of p gives a near-multiple of p ◮ c1 = q1 · p + 2 · r1 + m1,
◮ c1 + c2 = p · (q1 + q2) + 2 · (r1 + r2) + m1 + m2
◮ c1 · c2 = p · (c2q1 + c1q2 − q1q2) + 2 · (2r1r2 + r2m1 + r1m2) + m1 · m2
× × ×
22 / 36
◮ p = 541, q0 = 809 ⇒ x0 = 437669 ◮ noise size: ρ = 4
23 / 36
◮ p = 541, q0 = 809 ⇒ x0 = 437669 ◮ noise size: ρ = 4
◮ c1 = 737 · 541 + 2 · 6 + 1 = 398730 ◮ c2 = 368 · 541 + 2 · 9 + 0 = 199106
23 / 36
◮ p = 541, q0 = 809 ⇒ x0 = 437669 ◮ noise size: ρ = 4
◮ c1 = 737 · 541 + 2 · 6 + 1 = 398730 ◮ c2 = 368 · 541 + 2 · 9 + 0 = 199106
◮ c3 = c1 + c2 mod x0 = (398730 + 199106) mod 437669 = 160167 ◮ c4 = c1 · c2 mod x0 = (398730 · 199106) mod 437669 = 317801
23 / 36
◮ p = 541, q0 = 809 ⇒ x0 = 437669 ◮ noise size: ρ = 4
◮ c1 = 737 · 541 + 2 · 6 + 1 = 398730 ◮ c2 = 368 · 541 + 2 · 9 + 0 = 199106
◮ c3 = c1 + c2 mod x0 = (398730 + 199106) mod 437669 = 160167 ◮ c4 = c1 · c2 mod x0 = (398730 · 199106) mod 437669 = 317801
◮ c3 mod p = 160167 mod 541 = 31 = 2 · 10 + 1 = 2 · 10 + (1 XOR 0) ◮ c4 mod p = 317801 mod 541 = 234 = 2 · 117 + 0 = 2 · 10 + (1 AND 0)
23 / 36
◮ Implementation of bit-encryption scheme:
◮ Benchmark on a nontrivial, not astronomical circuit: AES
EncFHE AES−1
24 / 36
◮ Implementation of bit-encryption scheme:
◮ Benchmark on a nontrivial, not astronomical circuit: AES ◮ Batch DGHV (with bootstrapping) [CCKLLTY13]
24 / 36
◮ Implementation of bit-encryption scheme:
◮ Benchmark on a nontrivial, not astronomical circuit: AES ◮ Batch DGHV (with bootstrapping) [CCKLLTY13]
◮ Scale-Invariant DGHV (without bootstrapping) [CLT14]
24 / 36
◮ Implementation of bit-encryption scheme:
◮ Benchmark on a nontrivial, not astronomical circuit: AES ◮ Batch DGHV (with bootstrapping) [CCKLLTY13]
◮ Scale-Invariant DGHV (without bootstrapping) [CLT14]
◮ Lattice-Based Scheme [GHS12]
24 / 36
25 / 36
◮ GMP: GNU Multiple Precision Arithmetic Library
◮ NTL: A Library for doing Number Theory
◮ Not thread safe... ◮ Fork of NTL: newNTL
◮ FLINT: Fast Library for Number Theory
◮ LOTS of dependencies...
◮ OpenMP: library for easy parallelization
◮ Does not work easily with clang yet... 26 / 36
[LN14] (FLINT)
[BLLN13] (Home-made)
◮ Might be interesting: not too many functions to implement
◮ If q ≡ 1 (mod 2n) prime and n = 2k: very efficient FFT ◮ More work for general rings R = Z[X]/(φd(X)) with cyclotomic polynomial φd 27 / 36
◮ SV [SV10]: http://www.hcrypt.com
◮ Quite inefficient...
◮ DGHV [CNT12]: https://github.com/coron/fhe
◮ In SAGE
◮ BGV [BGV12]: https://github.com/shaih/HElib
◮ Uses NTL
◮ YASHE and FV [LN14]:
◮ Uses FLINT 28 / 36
◮ Typical high-level FHE use-case
29 / 36
◮ Typical high-level FHE use-case ◮ ... wait a sec! The ciphertext expansion is HUGE (prohibitive)!
◮ If mi is a 4MB image, using previous schemes, the user would have to send
29 / 36
◮ Typical high-level FHE use-case ◮ ... wait a sec! The ciphertext expansion is HUGE (prohibitive)! ◮ What if we use hybrid encryption? [NaehrigLauterVaikuntanathan12]
◮ e.g. AES does not have ciphertext expansion 29 / 36
EncFHE AES−1
◮ Typical high-level FHE use-case ◮ ... wait a sec! The ciphertext expansion is HUGE (prohibitive)! ◮ What if we use hybrid encryption? [NaehrigLauterVaikuntanathan12]
◮ e.g. AES does not have ciphertext expansion ◮ It works :) ◮ Network communication from user to cloud essentially optimal 29 / 36
EncFHE AES−1
◮ Latency of homomorphic eval.: time to get the result
30 / 36
EncFHE AES−1
◮ Latency of homomorphic eval.: time to get the result ◮ Latency of homomorphic AES: dozens of hours
◮ I’m not even considering the function f ... 30 / 36
◮ Three implementations published [GentryHaleviSmart12,
◮ Perform ℓ AES in parallel (several plaintexts in one ciphertext) ◮ Running times: ≈ 100 hours ◮ Time per AES block: ≤ 5 minutes 31 / 36
◮ Three implementations published [GentryHaleviSmart12,
◮ Perform ℓ AES in parallel (several plaintexts in one ciphertext) ◮ Running times: ≈ 100 hours ◮ Time per AES block: ≤ 5 minutes
◮ AES is not too complicated, but is not a trivial circuit!
◮ Multiplicative depth of the binary circuit: 40 (4 per S-box) ◮ Non-linear part: b → b254 in GF(28) 31 / 36
◮ Three implementations published [GentryHaleviSmart12,
◮ Perform ℓ AES in parallel (several plaintexts in one ciphertext) ◮ Running times: ≈ 100 hours ◮ Time per AES block: ≤ 5 minutes
◮ AES is not too complicated, but is not a trivial circuit!
◮ Multiplicative depth of the binary circuit: 40 (4 per S-box) ◮ Non-linear part: b → b254 in GF(28)
31 / 36
◮ Three implementations published [GentryHaleviSmart12,
◮ Perform ℓ AES in parallel (several plaintexts in one ciphertext) ◮ Running times: ≈ 100 hours ◮ Time per AES block: ≤ 5 minutes
◮ AES is not too complicated, but is not a trivial circuit!
◮ Multiplicative depth of the binary circuit: 40 (4 per S-box) ◮ Non-linear part: b → b254 in GF(28)
◮ Resemble some hardware/masking constraints (but is different): reduce
31 / 36
EncFHE
Simon−1
◮ Independently done for Simon [LNaehrig14]
32 / 36
EncFHE
Prince−1
◮ Independently done for Simon [LNaehrig14]
32 / 36
◮ Hard to compare (not same schemes/same computers/same
◮ Some parallelization is possible
◮ AES easily up to 16 cores ◮ Simon easily up to block size/2 cores ◮ Prince up to 32 cores 33 / 36
◮ Hard to compare (not same schemes/same computers/same
◮ Some parallelization is possible
◮ AES easily up to 16 cores ◮ Simon easily up to block size/2 cores ◮ Prince up to 32 cores
33 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
34 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
◮ Do we really need a block cipher? (wrt to PK scheme, RNG?)
34 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
◮ Do we really need a block cipher? (wrt to PK scheme, RNG?) ◮ What is the security/attack models? (who attacks? What do we want to
34 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
◮ Do we really need a block cipher? (wrt to PK scheme, RNG?) ◮ What is the security/attack models? (who attacks? What do we want to
◮ What are the condiditions we want on the block cipher? (e.g. resistance
34 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
◮ Do we really need a block cipher? (wrt to PK scheme, RNG?) ◮ What is the security/attack models? (who attacks? What do we want to
◮ What are the condiditions we want on the block cipher? (e.g. resistance
◮ How to exploit FHE constraints? (It is not only the multiplicative depth
34 / 36
◮ Current best choice: Prince (multiplicative depth of 24) ◮ The community is working on the subject
◮ Do we really need a block cipher? (wrt to PK scheme, RNG?) ◮ What is the security/attack models? (who attacks? What do we want to
◮ What are the condiditions we want on the block cipher? (e.g. resistance
◮ How to exploit FHE constraints? (It is not only the multiplicative depth
◮ Reciprocally, can we design FHE schemes specially adapted to certain
34 / 36
[Gen09] Fully Homomorphic Encryption using Ideal Lattices [DGHV10] Fully Homomorphic Encryption over the Integers [BV11] Fully Homomorphic Encryption from Ring-LWE and Security for Key Dependent Messages [CMNT11] Fully Homomorphic Encryption over the Integers with Shorter Public Keys [CNT12] Public Key Compression and Modulus Switching for Fully Homomorphic Encryption over the Integers [BGV12] (Leveled) Fully Homomorphic Encryption without Bootstrapping [FV12] Somewhat Practical Fully Homomorphic Encryption [GHS12] Homomorphic Evaluation of the AES Circuit [LTV12] On-the-fly Multiparty Computation on the Cloud via multikey Fully Homomorphic Encryption [NLV12] Can Homomorphic Encryption be Practical? [BLLN13] Improved Security for a Ring-Based Fully Homomorphic Encryption Scheme [LP13] On the Minimal Number of Bootstrappings in Homomorphic Circuits [CCKLLTY13] Batch Fully Homomorphic Encryption over the Integers [GSW13] Homomorphic Encryption from Learning With Errors: Conceptually-simpler, Asymptotically-faster, Attribute-based [CLT14] Scale-Invariant Fully Homomorphic Encryption over the Integers [LN14] A Comparison of the Homomorphic Encryption Schemes FV and YASHE [DSES14] Toward Practical Homomorphic Evaluation of Block Ciphers using Prince [BV14] Lattice-Based FHE as Secure as PKE