1 of 109

CryptoNet

1

Cryptography

Content Routing

Anca Nitulescu

For Privacy

In

2 of 109

Routing

Content

3 of 109

Content Routing: Storage Network

3

Consumer C Provider P

Common interface for content routing:

Provide: Make content available for other peers in the network

Resolve: Find the peers storing the content in the network.

Fetch: Fetches content from a provider.

Content ID: When you add a file to IPFS, your file is hashed, and given a unique fingerprint called a content identifier (CID). This CID acts as a permanent record of your file as it exists at that point in time.

Routing: When other nodes look up your file, they ask their peer nodes who's storing the content referenced by the file's CID.

Fetch

4 of 109

Content Routing: Setting

4

Consumer C Provider P

Router R

Actors:

  • Content Providers P
  • Content Consumers C
  • Content Routers R

- Providers store data D and make it available to Consumers C.

- Providers and consumers find each other through Routers.

- Advertisements or provider records rec include content identifiers CID and propagate them to the Routers.

- Consumers query the routers using CID, getting 0 or corresponding provider records (PIDs).

- Providers and Consumers are “light clients” and Routers do most of the work in the routing system.

Content

CID

Provider

IDs

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

5 of 109

Content Routing: Challenges

5

Consumer C Provider P

Router R

Content Routing in P2P networks

  • No central entity orchestrating the storage and discovery of content
  • No central directory to find how to reach every peer in the network.

  • The content routing network must hold at least for:
          • 1015 content IDs each
          • 109 devices to store the content

Content

CID

Provider

IDs

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

6 of 109

Content Routing: Privacy

6

Consumer C Provider P

Router R

Writer Privacy: Providers P can provide content to some consumers, without unauthorized consumers, routers, or adversaries learning what the provider has published.

  • identity writer-privacy: adversaries cannot learn who provided some content. Adversaries may see advertisements and learn what data they are associated to, but not learn the identity of the provider.
  • content writer-privacy: adversaries cannot learn what content is being provided. Adversaries may detect that a provider is publishing advertisements, but not learn what data the advertisements are about.

Content

CID

Provider

IDs

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

7 of 109

Content Routing: Privacy

7

Consumer C Provider P

Router R

Reader Privacy: Consumers C can find content (lookup records) without unauthorized providers, routers, or adversaries learning what the consumer has requested.

  • identity reader-privacy: adversaries cannot learn who is looking for some content. Adversaries may see requests and learn what data they are associated to, but not learn the identity of the consumer.
  • content reader-privacy: adversaries cannot learn what content is being searched. Adversaries may detect that a particular consumer is making requests, but not learn what data the requests are about.
  • action reader-privacy: adversaries cannot learn that a particular consumer has taken any action. This is difficult to achieve, as solutions tend to require slow round-based protocols that produce lots of noise.
  • full reader-privacy: no entity learns what entities request content or what content is being requested, at all. This is extremely difficult.

Content

CID

Provider

IDs

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

8 of 109

Cryptographic Solutions

Privacy-Preserving Search

9 of 109

  1. Searchable Encryption

9

Deterministic Encryption: exact match

Property-Preserving Encryption: approximative match

Order-Preserving Encryption: range queries

Hiding everything implies accessing the entire data

Drawbacks:

Leaks repetitions

Some existing attacks to recover data

Data is encrypted under Consumer’s key…

Searchable

Encryption

10 of 109

2. Fully Homomorphic Encryption

10

Provider encrypts its data.

The search function is evaluated over encrypted data.

Consumer gets the encrypted result.

Avantages:

Privacy from the encryption

No interaction

Drawbacks:

Not efficient

Costly communication

Key management ?

Ciphertext

Fully Homomorphic

Encryption

Encrypted result

Query

Encrypt

Data

11 of 109

3. Multi-Party Computation

11

2-Party

Computation

Provider sends records in clear to Router.

Consumer and Router interact in order to execute the search.

Needs multiple rounds of communication between the two parties.

Avantages:

Perfect Security

Performant

Drawbacks:

Costly in communication

Requires interaction and synchronisation

12 of 109

4. Private Information Retrieval

12

Consumer queries Router while hiding the content she is after.

Avantages:

Leaks no info on the index

Drawbacks:

May require more than one non-communicating Router with identical copies of the database

Private Information

Retrieval

Query

Data

?

13 of 109

5. Private Set Intersection

13

Consumer queries Router Content id

Router privately computes intersection between the queried content id and its record

Avantages:

Small Communication via FHE

Drawbacks:

Router may need to pre-process DB (expensive, not updatable)

FHE limitations

Private Information

Retrieval

Query S

Data

?

S

S

14 of 109

  1. Searchable Encryption

15 of 109

Index-Based Searchable Encryption

15

Based on keywords and trapdoors

Each query allows for a partial decryption

Searchable

Encryption

Trap

door

Encrypted Content

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

R

QKI5 98JE

T

7RTS IH2L

M

AZD2 T9YY

16 of 109

Index-Based Searchable Encryption

16

Based on keywords and trapdoors

Each query allows for a partial decryption

Consumer sends a trapdoor

Router decrypts the index corresponding to the trapdoor

Searchable

Encryption

Trap

door

Encrypted Content

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

#1, #4, #8

B

U8S5 GT75

R

QKI5 98JE

T

7RTS IH2L

M

AZD2 T9YY

17 of 109

Index-Based Searchable Encryption

17

Based on keywords and trapdoors

Each query allows for a partial decryption

Consumer sends a trapdoor

Router decrypts the index corresponding to the trapdoor

Leakage:

Static DB

- reveals search pattern - repetitions

Dynamic DB

- updates leak what record was updated

- deletions leak what record was deleted

Searchable

Encryption

Trap

door

Encrypted Content

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

R

QKI5 98JE

T

7RTS IH2L

M

AZD2 T9YY

18 of 109

Solution for Private Content routing?

18

Provider:

- encrypts content id (deterministic/hash)

- encrypts provider id (randomized)

- generates a trapdoor for each content id (decryption key)

Content

Provider

ID

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #8, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #7, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

Searchable

Encryption

Provider

19 of 109

Fonctionnement - Index-Based Searchable Encryption

19

Provider:

- encrypts content id (deterministic/hash)

- encrypts provider id (randomized)

- generates a trapdoor for each content id (decryption key)

Router:

- has the encrypted table

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

R

QKI5 98JE

T

7RTS IH2L

M

AZD2 T9YY

Searchable

Encryption

20 of 109

Fonctionnement - Index-Based Searchable Encryption

20

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

R

QKI5 98JE

T

7RTS IH2L

M

AZD2 T9YY

Provider:

- encrypts content id (deterministic/hash)

- encrypts provider id (randomized)

- generates a trapdoor for each content id (decryption key)

Router:

- has the encrypted table

Consumer:

- encrypts the content id (hash)

- sends ciphertext and trapdoor

Searchable

Encryption

21 of 109

Fonctionnement - Index-Based Searchable Encryption

21

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

#3, #15, #19

R

QKI5 98JE

T

7RTS IH2L

#4, #5, #21

M

AZD2 T9YY

Provider:

- encrypts content id (deterministic/hash)

- encrypts provider id (randomized)

- generates a trapdoor for each content id (decryption key)

Router:

- has the encrypted table

Consumer:

- encrypts the content id (hash)

- sends ciphertext and trapdoor

Router:

- trapdoor allows to decrypt the provider id for queried cid

Searchable

Encryption

22 of 109

Attacks - Index-Based Searchable Encryption

22

Update the table

Provider

- encrypts the content id (hash)

- adds new indexes

Searchable

Encryption

#22

Content

Provider

ID

cat.gif

#3, #5, #7

photo.jpg

#1, #4, #8, #11

offer.pdf

#3, #15, #19

slides.pptx

#1, #3, #7, #10

book.epub

#4, #5, #21

video.mp4

#6, #13, #18

23 of 109

Attacks - Index-Based Searchable Encryption

23

Update the table

Provider

- encrypts the content id (hash)

- adds new indexes

Router

- receives new ciphertexts

Searchable

Encryption

#22

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

#22

P

FCD3 7FBD

B

U8S5 GT75

#3, #5, #9, #22

R

QKI5 98JE

T

7RTS IH2L

#4, #5, #8, #22

M

AZD2 T9YY

24 of 109

Attacks - Index-Based Searchable Encryption

24

Update the table

Provider

- encrypts the content id (hash)

- adds new indexes

Router

- receives new ciphertexts

Leakage

- search pattern

- adding new indexes reveals info about Content IDs

Searchable

Encryption

#22

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

#22

P

FCD3 7FBD

B

U8S5 GT75

#3, #5, #9, #22

R

QKI5 98JE

T

7RTS IH2L

#4, #5, #8, #22

M

AZD2 T9YY

25 of 109

Attacks - Index-Based Searchable Encryption

25

Update the table

Provider

- encrypts the content id (hash)

- adds new indexes

Router

- receives new ciphertexts

Leakage

- search pattern

- adding new indexes reveals info about Content IDs

- deleting indexes reveals information about Content IDs

Searchable

Encryption

Trap

door

Encrypted Content ID

Provider

ID

L

6UIX ZO9V

P

FCD3 7FBD

B

U8S5 GT75

#3, #5, #9

R

QKI5 98JE

T

7RTS IH2L

#4, #5, #8

M

AZD2 T9YY

#5

26 of 109

References

26

“Oblivious RAMs” [Ost90,GO96]

– Optimal security (even hides access pattern)

– Poly-logarithmic number of rounds

“Practical techniques for searches on encrypted data” [SWP00]

– First specific construction (PRGs, PRFs, PRPs)

– Limitations: leaks information; inadequate security definition (IND-CPA)

“Secure Indexes” [Goh03]

– IND2-CKA: semantic security against chosen-keyword attacks

– Efficient and IND2-CKA construction (PRFs, Bloom filters)

“Privacy Preserving Keyword Searches on Remote Encrypted Data” [CM05]

– Simulation-based security definition

– Two constructions (PRFs,PRPs)

“Searchable Symmetric Encryption: Improved Definitions and Efficient Constructions,” [CGKO06]

– Proposed four new security definitions

– Two new efficient constructions for SSE IND2-CKA: Indistinguishability against Chosen-Keyword Attacks

27 of 109

2. Fully

Homomorphic

Encryption

28 of 109

FHE

28

Encrypt

Evaluate

Decrypt

Compute on ciphertexts

Ciphertexts

Fully Homomorphic

Encryption

Data

Secret key

Encrypted result

Secret key

Encrypted input

Encrypted result

Public key

29 of 109

FHE

29

Encrypt

Evaluate

Decrypt

=

7

13c82ea37b844ed03c

2

0dc1946c1158e7a9cd

13c82ea37b844ed03c

0dc1946c1158e7a9cd

6216d5bb3d78a75f24

9

Compute on ciphertexts

Ciphertexts

Fully Homomorphic

Encryption

Data

Secret key

Encrypted result

Secret key

Encrypted input

Encrypted result

Public key

6216d5bb3d78a75f24

30 of 109

Limitations of FHE

What model of computation ? - Boolean Circuits

Is this sufficient ? - Yes: {XOR, AND} is Turing-complete

And in practice ? - need to compile any algorithm in a Boolean Circuit

Privacy-Preserving Search:

Compare two integers A, B (2 bits)

31 of 109

Limitations of FHE

What model of computation ? - Boolean Circuits

Is this sufficient ? - Yes: {XOR, AND} is Turing-complete

And in practice ? - need to compile any algorithm in a Boolean Circuit

Privacy-Preserving Search:

Compare two integers A, B (2 bits)

32 of 109

Limitations of FHE

What model of computation ? - Boolean Circuits

Is this sufficient ? - Yes: {XOR, AND} is Turing-complete

And in practice ? - need to compile any algorithm in a Boolean Circuit

Privacy-Preserving Search:

Compare two integers A, B (2 bits)

A = A0 A1

B = B0 B1

33 of 109

Limitations of FHE

What model of computation ? - Boolean Circuits

Is this sufficient ? - Yes: {XOR, AND} is Turing-complete

And in practice ? - need to compile any algorithm in a Boolean Circuit

Privacy-Preserving Search:

Compare two integers A, B (2 bits)

A = A0 A1

B = B0 B1

Compilation

  • expensive to represent as Boolean circuit
  • lost in performance in practice

34 of 109

Better New FHE

TFHE: - allow to evaluate a gate MUX

- fast bit-wise comparison

- fast look-up tables

0 / 1

1

0

r0

r1

r0 / 1

35 of 109

Better New FHE

TFHE: - allow to evaluate a gate MUX

- fast bit-wise comparison

- fast look-up tables

0 / 1

1

0

r0

r1

r0 / 1

I

Comparing two integers A, B (2 bits)

A = a0 a1

B = b0 b1

b1 if a1 ≠ b1 b0 if a0 ≠ b0

r1 = r0 =

1 else r1 else

r0 = (A ≤ B )

36 of 109

Better New FHE

Comparing two integers A, B (2 bits)

A = a0 a1

B = b0 b1

b1 if a1 ≠ b1 b0 if a0 ≠ b0

r1 = r0 =

1 else r1 else

r0 = (A ≤ B )

I

0

0

0

I

TFHE: - allow to evaluate a gate MUX

- fast bit-wise comparison

- fast look-up tables

37 of 109

Better New FHE

CKKS: - Numerical method

- Evaluates polynomials on integers

- approximative comparison based on Taylor series

38 of 109

Better New FHE

CKKS: - Numerical method

- Evaluates polynomials on integers

- approximative comparison based on Taylor series

Comparing two integers or reels a, b

Idea : Write the comparison function using an approximation based on polynomials

→ polynomial degree = precision

→ better precision = bigger cost

→ pays off only by parallelising multiple comparison

→ amortised cost

*variable t decides precision

approximation for square root

with

Wilkes Method (1951)

39 of 109

Fully Homomorphic Encryption Landscape

TFHE

BV

1st generation

2nd generation

3rd generation

4th generation

  • First Schemes (2009-10)
  • Gentry-Halevi’11:

→ ad-hoc assumption

→ one bit operation = 30 minutes

  • Optimised Circuit FHE (2011-12)
  • Brakerski-Vaikuntanathan’11 :

→ assumption: Approximate eigenvector

→ fast bootstrapping (< .1 seconde)

→ unpractical

  • Gentry-Halevi-Smart’12 :

→ circuit of 30,000 gates = 36 hours

  • Modern Schemes (2012 - present)
  • Brakerski-Gentry-Vaikuntanathan (BGV’12)

→ assumption = RLWE

circuit of 30,000 gates = 4 -15 minutes

  • Gentry-Sahai-Waters (GSW’13)

→ assumption = LWE

→ encryption of one bit = big matrix

→ compute a NAND gate = matrix multiplication

asymmetric multiplication C12 = c1 ⊗ c2 and C21 = c2 ⊗ c1

C12 = C21 (they both encrypt the product b1b2= b2b1).

→ asymmetric noise - left factor is dominant

  • Practical schemes
  • Cheon-Kim-Kim-Song (CKKS, 2016)
  • Chillotti-Gama-Georgieva-Izabachène (TFHE, 2016)

Gentry

BHS

BGV

GSW

2009

2011

2012

2015

CKKS

40 of 109

FHE: Performances for Comparison

Bit-wise comparison with selector

TFHE - integers of 32-bits = 3,3 seconds

Integer comparisons with approximation

CKKS - total time for 216 pairs of 32-bits integers = 230 s

- precision 2-14 = most significant 14 bits

- amortisation: 3,5 ms per comparison

0

0

0

Boolean Circuit with no selector

Schemes BV, GHS, BGV

a1 a0 b1 b0

41 of 109

Libraries FHE

Library

Scheme

Language

Boot-

strapping

Select

gates

API

Support

integers

Packing

SIMD

HELib

BGV, CKKS

C /C++

X

hard

X

SEAL

FV, CKKS

C++/C#

not public

X

easy

PALISADE

BGV, FV, CKKS, TFHE

C++

X

X

average

X

Concrete

TFHE

Rust

easy

X

42 of 109

3. MPC

Interactive Solution

43 of 109

MPC - goals

43

x1 x2

Framework for computation between parties who do not trust each other.

Examples:

  • elections,
  • auctions,
  • distributed data mining,
  • database privacy

Multi-Party

Computation

x3 x4

f(x1, x2, x3, x4) = (y1, y2 ,y3 ,y4 ) = y

44 of 109

MPC - goals

44

x1 x2

Framework for computation between parties who do not trust each other.

Examples:

  • elections,
  • auctions,
  • distributed data mining,
  • database privacy

Goals: preserve the privacy of each player's inputs and guarantee the correctness of the computation.

Multi-Party

Computation

x3 x4

f(x1, x2, x3, x4) = (y1, y2 ,y3 ,y4 ) = y

45 of 109

MPC - goals

45

Trusted party:

All of these tasks can be easily computed by a trusted third party

Security :

  • Same guarantees without involving a trusted third party
  • Provide an exact problem definition
    • Adversarial power
    • Network model
    • Meaning of security
  • Prove that the protocol is secure - by reduction to an assumed hard problem

Multi-Party

Computation

f(x1, x2, x3, x4) = (y1, y2 ,y3 ,y4 ) = y

x1 x2

x3 x4

46 of 109

MPC - goals

Preprocessing:

  • Independent of x,y
  • Typically only depends on size of f
  • Uses public key crypto technology (slower)

Online:

  • Uses only information theoretic tools
  • Runs in order of magn. faster

Reconstruction:

  • The intended parties learn the result of f

Multi-Party

Computation

Preprocessing

Online

Reconstruction

f(x1, x2, x3, x4) = (y1, y2 ,y3 ,y4 ) = y

y = f(x)

correlated

randomness

47 of 109

MPC General View

Multi-Party

Computation

f(x1, x2, x3, x4) = y

Preprocessing

Online

Reconstruction

f(x1, x2, x3, x4) = (y1, y2 ,y3 ,y4 ) = y

y = f(x)

48 of 109

MPC - Example

48

Salary s1 = 5 000 z1= 7 400

Mask m = 2 400

z1 = 2 400 + 5 000

Example : Compute the average salary without revealing the salary of each employee.

Here Bob runs a MPC protocol with his colleagues to learn the average salary.

49 of 109

MPC - Example

49

z2 = 10 400

Salary s1 = 5 000 z1= 7 400 Salary 3 000

Mask m = 2 400

z1 = 2 400 + 5 000 z2 = 7 400 + 3 000

Example : Compute the average salary without revealing the salary of each employee.

Here Bob runs a MPC protocol with his colleagues to learn the average salary.

50 of 109

MPC - Example

50

z2 = 10 400

z4 = 18 400

Salary s1 = 5 000 z1= 7 400 Salary 3 000

Mask m = 2 400

z1 = 2 400 + 5 000 z2 = 7 400 + 3 000

Salary 4 000 Salary 4 000

z3 = 14 400

z4 =14 400 + 4 000 z3 = 10 400 + 4 000

  1. Average = z4/4 = 18 400 /4
  2. Average = z4/4 m = 18 400 /4 2 400
  3. Average = ( z4 s1 ) /4 = (18 400 5 000 ) /4
  4. Average = ( z4 m )/4 = (18 400 2 400 ) /4

Example : Compute the average salary without revealing the salary of each employee.

Here Bob runs a MPC protocol with his colleagues to learn the average salary.

What computation should Bob make in order to learn the average salary?

51 of 109

MPC - Example

51

  1. Average = z4/4 = 18 400 /4
  2. Average = z4/4 m = 18 400 /4 2 400
  3. Average = ( z4 s1 ) /4 = (18 400 5 000 ) /4
  4. Average = ( z4 m )/4 = (18 400 2 400 ) /4

Solution : D. Sum of salaries = Masked Sum Random Mask = z4 m

z2 = 10 400

z4 = 18 400

Salary s1 = 5 000 z1= 7 400 Salary 3 000

Mask m = 2 400

z1 = 2 400 + 5 000 z2 = 7 400 + 3 000

Salary 4 000 Salary 4 000

z3 = 14 400

z4 =14 400 + 4 000 z3 = 10 400 + 4 000

Example : Compute the average salary without revealing the salary of each employee.

Here Bob runs a MPC protocol with his colleagues to learn the average salary.

What computation should Bob make in order to learn the average salary?

52 of 109

MPC - Security

52

z4 =14 400 + 4 000 z3 = 10 400 + 4 000

z2 = 10 400

z4 = 18 400

z1= 7 400

z1 = 2 400 + 5 000 z2 = 7 400 + 3 000

We need to make sure that an adversary cannot learn the private data of the honest parties.

We assume that communication channels are private and authenticated.

Security Model: The adversary is inside the system and corrupts some of the parties

  • Semi-honest (passive) Corrupted players follow the protocol but try to learn more → private computation

z3 = 14 400

53 of 109

MPC - Security

53

We need to make sure that an adversary cannot learn the private data of the honest parties.

We assume that communication channels are private and authenticated.

Security Model: The adversary is inside the system and corrupts some of the parties

  • Semi-honest (passive) Corrupted players follow the protocol but try to learn more → private computation

  • Malicious (active) Corrupted players can collaborate in any way and misbehave arbitrarily → secure computation

z2 = 10 400

z4 = 7 000

Salary 4 000 Salary 4 000

z3 = 14 400

z4 = 3 000 + 4 000 z3 = 3 000

Salary s1 = 5 000 z1= 7 400 Salary 3 000

Mask m = 2 400

z1 = 2 400 + 5 000 z2 = 7 400 + 3 000

z3 = 3 000

54 of 109

MPC - Security

54

Security is defined by the types of attacks considered:

Adversary type:

  • Semi-honest (passive)

  • Malicious (active)

Number of corrupted parties t among n

  • Honest Majority t < n/2
  • Dishonest Majority t ≥ n/2

55 of 109

Security with Output Delivery

/

55

Corrupted parties t

Total parties n

Setting

Adversary

Condition

Computational

passive

t < n

active

t < n/2

Perfect Security*

passive

t < n/2

active

t < n/3

* Shannon Information Theory

56 of 109

MPC

from

secret

sharing

57 of 109

MPC - Arithmetic Circuits

57

Model of Computation: Represent the function as Arithmetic/Boolean circuit C

Limiting Factor : Number of multiplications

58 of 109

MPC from Secret Sharing

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

*[GMW87] Oded Goldreich, Silvio Micali, Avi Wigderson. How to prove all NP- statements in zero-knowledge, and a methodology of cryptographic protocol design.

[BGW88 ] M. Ben-Or, S. Goldwasser, A. Wigderson. Completeness Theorems for Non-Cryptographic Fault-Tolerant Distributed Computation.

f (x,y,z)

x

y

z

59 of 109

MPC from Secret Sharing

59

f (x,y,z)

x

y

z

z = z1 + z2 + z3

x = x1 + x2 + x3

y = y1 + y2 + y3

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

60 of 109

MPC from Secret Sharing

60

f (x,y,z)

x

y

z

z = z1 + z2 + z3

x = x1 + x2 + x3

y = y1 + y2 + y3

x2

x3

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

61 of 109

MPC from Secret Sharing

61

f (x,y,z)

x

y

z

z = z1 + z2 + z3

x = x1 + x2 + x3

y = y1 + y2 + y3

x3

x2

y3

y1

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

62 of 109

MPC from Secret Sharing

62

f (x,y,z)

x

y

z

x3 y3 z3

z = z1 + z2 + z3

x = x1 + x2 + x3

x1 y1

x2 y2

y = y1 + y2 + y3

z1

z2

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

63 of 109

MPC from Secret Sharing

63

f (x,y,z)

x

y

z

x3 y3 z3

z

x

x1 y1 z1

x2 y2 z2

y

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

64 of 109

MPC from Secret Sharing

64

f (x,y,z)

x

y

z

x3 y3 z3

x1 y1 z1

x2 y2 z2

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

65 of 109

MPC from Secret Sharing

65

f (x,y,z)

x3 y3 z3

S3 = x3+ y3 + z3

S1 = x1+ y1 + z1

x1 y1 z1

x2 y2 z2

S2 = x2+ y2 + z2

x1 + x2 + x3 = x

y1 + y2 + y3 = y

z1 + z2 + z3 = z

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

● Addition is possible without interaction → Si = xi+ yi + zi

66 of 109

MPC from Secret Sharing

66

f (x,y,z)

x3 y3 z3

S3 = x3+ y3 + z3

S1 = x1+ y1 + z1

x1 y1 z1

x2 y2 z2

S2 = x2+ y2 + z2

S1 = x1 + y1 + z1

S2 = x2 + y2 + z2

S3 = x3 + y3 + z3

+

S1+ S2 + S3 = x + y + z

x1 + x2 + x3 = x

y1 + y2 + y3 = y

z1 + z2 + z3 = z

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares

● Addition is possible without interaction → Si = xi+ yi + zi S = x + y + z = S1+ S2 + S3

67 of 109

MPC from Secret Sharing

67

f (x,y,z)

x

y

z

x3 y3 z3

x1 y1 z1

x2 y2 z2

a3

a1

a2

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

● Answer is reconstructed from final shares

68 of 109

MPC from Secret Sharing

68

x3 y3 z3

x1 y1 z1

x2 y2 z2

R3 = f (x3, y3, z3)

R2 = f (x2, y2, z2)

R1 = f (x1, y1, z1)

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

● Answer is reconstructed from final shares

69 of 109

MPC from Secret Sharing

69

R = f (x, y , z)

R1

R3 = f (x3, y3, z3)

R2 = f (x2, y2, z2)

R1 = f (x1, y1, z1)

R3

R = R1 + R2 + R3

The GMW/BGW* Approach:

● The (public) function being computed is written as a circuit

● Each participant secret-shares their private input

● The circuit is evaluated gate-by-gate on the shares (this requires communication between participants)

● Answer is reconstructed from final shares

70 of 109

Yao Garbling Circuits

71 of 109

2PC - Boolean Circuits

71

Model of Computation: Represent the function as Arithmetic/Boolean circuit C

Limiting Factor : Circuit Depth

Depth 3

72 of 109

2PC - Yao Garbling Circuit 1982

72

[Yao82] A. Yao, Protocols for secure computations. In Proceedings of FOCS (1982)

73 of 109

2PC - Yao Garbling Circuit

73

step 1 - Truth table for each logic gate

74 of 109

2PC - Yao Garbling Circuit

74

Step 2 - Generate 2 secret keys for each possible input (one for 0 and another one for 1)

75 of 109

Yao Garbling Circuit

75

Step 3 - Rewrite the Truth Table by replacing 0/1 with their corresponding keys

76 of 109

Yao Garbling Circuit

76

Step 4 - Encrypt with both keys the output of each gate

77 of 109

Yao Garbling Circuit

77

Step 5 - Send this version of the circuit to the Evaluator

78 of 109

Yao Garbling Circuit - Evaluation

78

Step 1 - Use the known keys for your inputs to decrypt each gate value

example - inputs (1, 0, 0, 1)

79 of 109

Yao Garbling Circuit - Evaluation

79

Step 2 - Continue the process for following gates

80 of 109

Yao Garbling Circuit - Evaluation

80

Step 2 - Continue the process for following gates

81 of 109

Yao Garbling Circuit - Evaluation

81

Step 2 - Continue the process for following gates

82 of 109

Yao Garbling Circuit - Evaluation

82

Step 2 - Continue the process for following gates

83 of 109

Yao Garbling Circuit - Evaluation

83

Step 4 - Obtain the expected result

84 of 109

Bibliography

[AOR+19] Abdelrahaman Aly, Emmanuela Orsini, Dragos Rotaru, Nigel P. Smart, Tim Wood. Zaphod: Efficiently Combining LSSS and Garbled Circuits in SCALE. In Workshop on Encrypted Computing and Applied Homomorphic Cryptography 2019, 2019.

[BDOZ11] Rikke Bendlin, Ivan Damgaard, Claudio Orlandi, Sarah Zakarias. BDOZ: Semi-homomorphic encryption and multiparty computation. In Advances in Cryptology – EUROCRYPT 2011, 2011, Springer.

[BGW88 ]M. Ben-Or, S. Goldwasser and A. Wigderson. Completeness Theorems for Non-Cryptographic Fault-Tolerant Distributed Computation. In the 20th STOC, pages 1–10, 1988.

[BMR90] Donald Beaver, Silvio Micali, and Phillip Rogaway. The round complexity of secure protocols. In 22nd ACM STOC, 1990.

[DPSZ12] Ivan Damgaard, Valerio Pastro, Nigel P. Smart, Sarah Zakarias. SPDZ: Multiparty computation from somewhat homomorphic encryption. In Advances in Cryptology – CRYPTO 2012, Springer.

[GMW87] Oded Goldreich, Silvio Micali, and Avi Wigderson. How to prove all NP- statements in zero-knowledge, and a methodology of cryptographic protocol design. In CRYPTO’86, volume 263 of LNCS, pages 171–185. Springer.

[KRS18] M. Keller, D. Rotaru, N. Smart, and T. Wood, Reducing Communication Channels in MPC. In Security and Cryptography for Networks 11, pp. 181-199, 2018.

[LPSY19] Y. Lindell, B. Pinkas, N. Smart, A. Yanai. Efficient Constant Round Multi-Party Computation Combining BMR and SPDZ. In Journal of Cryptology 32, 2019.

[NNOB12] Jesper Nielsen, Peter Nordholt, Claudio Orlandi, Sai S. Burra. TinyOT: A new approach to practical active-secure two-party computation. In CRYPTO 2012, Lecture Notes in Computer Science, pages 681–700, 2012, Springer

[RT19] D. Rotaru, T. Wood, MArBled Circuits: Mixing Arithmetic and Boolean Circuits with Active Security. In INDOCRYPT 2019, Lecture Notes in Computer Science, Springer-Verlag, 2019

[Yao82] A. Yao, Protocols for secure computations. In Proceedings of FOCS (1982)

85 of 109

4.Private Information Retrieval

86 of 109

Private Information Retrieval

86

Trivial solution: Download the entire database

Can the problem be solved with less communications?

PIR Setting:

Server: - holds n-bit string x

- n is very large

User: - wishes to retrieve value xi

- to keep i private

Private Information

Retrieval

Query i

?

xi

DB

1

x1

2

x2

3

x3

4

x4

.

.

.

.

.

.

n

xn

87 of 109

Private Information Retrieval

87

  • withstand attacks even from an adversary with unlimited computational power �

Information Theoretic

PIR

  • provide weaker guarantees: security is reduced to solving computationally hard problem (bounded adversary) �

Computational

PIR

88 of 109

Private Information Retrieval

88

  • withstand attacks even from an adversary with unlimited computational power �
  • # servers: multiple copies of the database k copies
  • comm.: more expensive

Information Theoretic

PIR

  • provide weaker guarantees: security is reduced to solving computationally hard problem (bounded adversary) �
  • # servers: only one database
  • comm.: low

Computational

PIR

89 of 109

Private Information Retrieval

89

  • withstand attacks even from an adversary with unlimited computational power �
  • # servers: multiple copies of the database k copies
  • comm.: more expensive
  • IT-PIR schemes:
    • 2 servers – comm. O(n1/3) [CGKS95]
    • k servers – comm. O(n1/Ω(k)) [CGKS95, Amb9,BIKR02]
    • log n servers – comm. O((log n)a) [BF90, CGKS95]

Information Theoretic

PIR

  • provide weaker guarantees: security is reduced to solving computationally hard problem (bounded adversary) �
  • # servers: only one database
  • comm.: low
  • C-PIR schemes are based on the difficulty of:
    • Quadratic Residue Problem – comm O(nε )
    • φ-hiding problem – comm O((log n)a )
    • one-way permutations – comm n - o(n)

Computational

PIR

90 of 109

Private Information Retrieval

90

  • withstand attacks even from an adversary with unlimited computational power �
  • # servers: multiple copies of the database k copies
  • comm.: more expensive
  • IT-PIR schemes:
    • 2 servers – comm. O(n1/3) [CGKS95]
    • k servers – comm. O(n1/Ω(k)) [CGKS95, Amb9,BIKR02]
    • log n servers – comm. O((log n)a) [BF90, CGKS95]
  • time cost: Expected computation of the servers is O(n)
  • open: Improving time complexity via preprocessing / amortization / off-line computation

Information Theoretic

PIR

  • provide weaker guarantees: security is reduced to solving computationally hard problem (bounded adversary) �
  • # servers: only one database
  • comm.: low
  • C-PIR schemes are based on the difficulty of:
    • Quadratic Residue Problem – comm O(nε )
    • φ-hiding problem – comm O((log n)a )
    • one-way permutations – comm n - o(n)
  • time cost: Computation O(n/ log n) public-key operations

Computational

PIR

91 of 109

State of the Art

91

This work = EC2022

“Single-Server Private Information Retrieval with Sublinear Amortized Time”

Corrigan-Gibbs,

Henzinger,

Kogan

ia.cr/081

public-key operations: n1/2

*This number of per-client queries assumes that the total number of clients, m, grows sufficently large.

92 of 109

Variations of Private Information Retrieval

92

  • block PIR

– what if Alice wants a block of bits (of size m)?

– can we do better than invoking a PIR protocol m times? �

  • robust PIR – what if some of the database copies break down or return false answers (Byzantine failure model)? �
  • t-private PIR

– how to ensure that even t colluding databases cannot figure out in which bit Alice is interested in? �

  • PIR with preprocessing

– the database usually has to do O(n) computations – can this be cut down?

Private Information

Retrieval

Query

Data

?

93 of 109

5. Private Set Intersection

FHE-based

94 of 109

Private Set Intersection

94

Receiver Sender

R = {a, b, c, n} R S = ? S = {a, b, d, e, f, g, h, i, j, k, l, m}

Problem :

Two parties compute their set intersection keeping their sets private

95 of 109

Private Set Intersection

95

Receiver Sender

R = {a}

Constructs polynomial F

F (a) = 2, F(b)=4, …

2

Encrypts the search a

a

1

1c82e

7b44e

1c82e

7b44e

Solution based on FHE :

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

96 of 109

Private Set Intersection

96

Receiver Sender

R = {a}

Constructs polynomial F of degree |set|

Evaluate F on Enc(a)

1

Encrypts the search a

a

1

1c82e

7b44e

1c82e

7b44e

Solution based on FHE :

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

2

Enc(a)

97 of 109

Private Set Intersection

97

Receiver Sender

R = {a}

Constructs polynomial F of degree |set|

Evaluate F on Enc(a)

F (Enc(a)) = Enc(2)

1

Encrypts the search a

a

1

1c82e

7b44e

1c82e

7b44e

Solution based on FHE :

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

2

Enc(a)

98 of 109

Private Set Intersection

98

Receiver Sender

R = {a}

Constructs polynomial F of degree |set|

Evaluate F on Enc(a)

F (Enc(a)) = Enc(2)

1

Encrypts the search a

Decrypts and learns value

a

1

1c82e

7b44e

1c82e

7b44e

Solution based on FHE :

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

2

Enc(a)

Encrypted label for a

F( ) =

Enc(2)

4

Enc(2)

0, 0, t, z

{a, b}

1c82e

7b44e

Enc(2)

99 of 109

Private Set Intersection

99

Receiver Sender

R = {a}

  • Computation = 𝑂(𝑁)
  • Depth of FHE circuit = 𝑂(log log 𝑁)
  • Communication = 𝑂(log 𝑁)
  • No circuit privacy → Much smaller FHE parameters

Performance:

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

100 of 109

Private Set Intersection

100

Receiver Sender

R = {a}

Comparison with Key-word PIR:

element

a

b

d

e

f

g

h

i

m

label

#2

#4

#8

#4

#1

#4

#7

#3

#1

FHE-PSI:

  • 20 seconds and 18MB
  • Requires a single server
  • Has a large offline computation

PIR/MPC:

  • linear communication
  • better running time

101 of 109

Cuckoo Hashing

101

Cuckoo Table

Index

h1/2/3

1

2

3

4

Cuckoo Table

Index

h1

h2

h3

1

2

a

3

a

4

a

h1(a) = 3, h2(a) = 2, h3(a) = 4,

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

102 of 109

Cuckoo Hashing

102

Cuckoo Table

Index

h1/2/3

1

2

3

4

h1(a) = 3, h2(a) = 2, h3(a) = 4,

h1(b) = 2, h2(b) = 3, h3(b) = 1,

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

Cuckoo Table

Index

h1

h2

h3

1

b

2

b

a

3

a

b

4

a

103 of 109

Cuckoo Hashing

103

Cuckoo Table

Index

h1/2/3

1

2

b

3

c

4

a

Cuckoo Table

Index

h1

h2

h3

1

d,f,l

j,e,l

b,i,k

2

b,g,i,j

a,d,k

g,l

3

a,k,m

b,f,g

d,e,m

4

e,h

h,i,m

a,f,h,j

h1(a) = 3, h2(a) = 2, h3(a) = 4,

h1(b) = 2, h2(b) = 3, h3(b) = 1,

h1(c) = 4, h2(c) = 3, h3(c) = 2,

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

104 of 109

Cuckoo Hashing

104

Cuckoo Table

Index

h1/2/3

1

2

b

3

c

4

a

Cuckoo Table

Index

h1

h2

h3

1

d,f,l

j,e,l

b,i,k

2

b,g,i,j

a,d,k

g,l

3

a,k,m

b,f,g

d,e,m

4

e,h

h,i,m

a,f,h,j

h1(a) = 3, h2(a) = 2, h3(a) = 4,

h1(b) = 2, h2(b) = 3, h3(b) = 1,

h1(c) = 4, h2(c) = 3, h3(c) = 2,

h1(n) = 2, h2(n) = 3, h3(n) = 1.

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

105 of 109

Cuckoo Hashing

105

Cuckoo Table

Index

h1/2/3

1

b

2

n

3

c

4

a

Cuckoo Table

Index

h1

h2

h3

1

d,f,l

j,e,l

b,i,k

2

b,g,i,j

a,d,k

g,l

3

a,k,m

b,f,g

d,e,m

4

e,h

h,i,m

a,f,h,j

h1(a) = 3, h2(a) = 2, h3(a) = 4,

h1(b) = 2, h2(b) = 3, h3(b) = 1,

h1(c) = 4, h2(c) = 3, h3(c) = 2,

h1(n) = 2, h2(n) = 3, h3(n) = 1.

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

106 of 109

Cuckoo Hashing

106

Cuckoo Table

Index

h1/2/3

1

b

2

n

3

c

4

a

Cuckoo Table

Index

h1

h2

h3

1

d,f,l

j,e,l

b,i,k

2

b,g,i,j

a,d,k

g,l

3

a,k,m

b,f,g

d,e,m

4

e,h

h,i,m

a,f,h,j

h1(a) = 3, h2(a) = 2, h3(a) = 4,

h1(b) = 2, h2(b) = 3, h3(b) = 1,

h1(c) = 4, h2(c) = 3, h3(c) = 2,

h1(n) = 2, h2(n) = 3, h3(n) = 1,

Receiver Sender

R = {a, b, c, n} S = {a, b, d, e, f, g, h, i, j, k, l, m}

# indexes > | R |

table size = 3 | S |, average line size = 3/#indexes | S |

107 of 109

Private Set Intersection

107

Receiver Sender

R = {a, b, c, n} R S = ? S = {a, b, d, e, f, g, h, i, j, k, l, m}

The intersection is done for each line in the Cuckoo Table

Optimisations : Batching, Windowing and Splitting

Encode lines as functions

F1, F2, F2, F4

Evaluate

F1 on first ciphertext

F2 on second ciphertext

etc.

Encrypts all

table values

Decrypts and

learns the intersection

Cuckoo Table

b

n

c

a

Cuckoo Table

d,f,l

d,e,l

b,i,k

b,g,i,j

a,j,k

g,l

a,k,m

b,f,g

d,e,m

e,h

h,i,m

a,f,h,j

1

2

3

4

1c82e

7b44e

0d96c

11589

62165

78a7f

e35y6

c57u8

Ciphertexts

Encrypted intersection

Enc(0/r)

Enc(0/s)

Enc(0/t)

Enc(0/z)

108 of 109

Conclusions

109 of 109

Cryptographic Primitives

109

Fully

Homomorphic

Encryption

Private Information

Retrieval

Multi-Party

Computation

Hash

Function

Searchable Encryption

Symmetric Cryptography Best Performance

Heuristic Security

Public Key Cryptography

Computational expensive

Proved Security

Private Information

Retrieval