Zero Knowledge Proofs / Secure Computing

Notes and reference for some intro crypt + zero knowledge, moving towards secure AI content. IN PROGRESS.

1. Intro

AI inference services require blind trust. Key security risks are privacy of the user’s input and integrity of the server’s output. Ideally, we want private and verifiable computation. The user should send an encrypted question to a trustworthy server which computes and the encrypted response. The user can then decryp the response and verify that it is the intended output of the model, without learning anything else about the model.

Three key capabilities to learn about:

Zero Knowledge Proofs

What is a proof system? The prover has some claim and creates proof π\pi. This proof is sent to the verifier, who will run an algorithm to either accept or reject this proof.

In a zero knowledge proof, a prover wants to convince a verifier that a statement is true without revealing secret evidence.

2.

blah blah blah make up lecture

3. make up lecture

4. Private, verifiable computation (preliminaries)

Previously: DL and collision-resistant hash from DL

Groups of unknown order

A group where the order is computationally hard to compute, defined by group sampling alg

<G>,nGGen(1λ)<\mathbb{G}>, n \leftarrow \text{GGen}(1^\lambda)

for <G><\mathbb{G}> a succinct (size polynomial in λ\lambda) description of a group G\mathbb{G} and nn an upper bound on its order.

The hidden order assumption holds for GGen\text{GGen} if for any polynomial time algorithm AA and distribution:

P[ga=1]<negl(λ).\P [g^a = 1 ] < \text{negl}(\lambda).

RSA assumption (fill in)

GUO with trusted setup: the algorithm GGen\text{GGen} is allowed to randomly generate secret values that are discarded.

Ex: GGen\text{GGen} samples secret primes p,qp,q and outputs N=pqN = p*q defining the group ZN. \mathbb{Z}^*_N. This group has order (p1)(q1)(p-1)(q-1), which is easy to compute if NN can be factored.

Collision resistant hash from GUO

Collision-resistant based on hidden order assumption: if gx=gyg^x = g^y for xyx \neq y then gxy=1g^{x-y} = 1.

Statistical distance

The statistical distance between random variables X,YX, Y over a finite domain DD is :

Δ(X,Y)=αD12P(X=α)P(Y=α).\Delta(X,Y)= \sum_{\alpha \in D} \frac{1}{2}|P(X=\alpha) - P(Y=\alpha)|.

Sequences of random variables (Xn),(Yn)(X_n), (Y_n) are statistically indistinguishable if

Δ(Xn,Yn)=1/2n.\Delta(X_n, Y_n) = 1/ 2^n.

Sequences (Xn),(Yn)(X_n), (Y_n) on the same domain DD are computationally indistinguishable if for any polynomial time algorithm AA that receives an input xDx \in D and outputs 00 or 11:

P(A(Xn)=1)P(A(Yn)=1)=1/2n.|P(A(X_n) = 1) - P(A(Y_n) = 1)| = 1/2^n.

Learning parity with noise

The LPN assumption over a field F\mathbb{F} has a dimension parameter kk, noise rate ϵ\epsilon, and number of samples NN.

The assumption is that a list of nn samples of the form (ri,ris+ei)(r_i, r_i * s + e_i) is computationally indistinguishable from a list of nn samples of the form (ri,ui)(r_i, u_i) where

Pseudorandom matrix from LPN

R=AS+ER = A*S + E

where AFn×kA \in \mathbb{F}^{n \times k} and SFk×n S \in \mathbb{F}^{k \times n} and all entries of EE are sampled as eie_i on previous slide.

Each entry of RR has the form rij=aisj+eij.r_{ij} = a_i * s_j + e_{ij}.

For each sjs_j get nn samples of the form aisj+eijuij.a_i * s_j + e_{ij} \approx u_{ij}.

Languages, NP, and P

A language is a subset of strings L{0,1}.L \subset \{0,1\}^*.

A language LL is in NP if there exists a deterministic polynomial times algorithm DD and polynomial q()q(\cdot) such that:

A language LL is in P if there exists a polynomial time algorithm SS such that S(x)=1S(x) =1 if and only if xLx \in L.

NP relations

A binary relation RR is a subset of {0,1}×{0,1}.\{0,1\}^* \times \{0,1\}^*. The language LRL_R of a binary relation RR is the set

{x{0,1} : there exists w s.t. (x,w)R}.\{x \in \{0,1\}^* \text{ : there exists } w \text{ s.t. } (x,w) \in R \}.

RR is called an NP relation if the language LRL_R is in NP.

How to represent algorithms?

Arithmetic circuits

Fix a finite field F={0,...,p1}\mathbb{F} = \{0, ..., p-1\} for some prime p>2.p>2.

An arithmetic circuit is defined C:FnFC: \mathbb{F}^n \rightarrow \mathbb{F}. It is a directed acyclic graph (DAG) where internal nodes are labeled as +,,+, -, or ×\times. Inputs are labeled 1,x1,...,xn1, x_1, ..., x_n. This defines an nn-variate polynomial with an evaluation recipe.

C|C| usually denotes the number of multiplication gates in CC.

5. Private, verifiable computation

Representing algorithms (above).

Boolean circuits can be represented as arithmetic circuits over Fp\mathbb{F}_p:

Proof verification asymptotically faster than program evaluation = verifiable computation.

Sound: infeasible to produce valid proof if prover doesn’t know program ww Zero knowledge: proof doesn’t reveal anything about the program ww

Proof system syntax

Completeness property

Notation: <P(x,w),V(x)>< P(x,w), V(x)> denotes output of verifier on interaction with prover for input xx and witness ww.

For all (x,w)(x,w) s.t. C(x,w)=0C(x,w) = 0, there is a probability 1 that <P(x,w),V(x)>=1<P(x,w), V(x)> = 1.

Soundness property

Notation: <A(x,w),V(x)><A(x,w), V(x)> the output of verifier on interaction with an adversarial prover algorithm AA for input xx and witness ww.

For any xx where there does not exist ww such that C(x,w)=0C(x,w) = 0 and any polynomial time algorithm AA, the probability that <A(x,w),V(x)>=1<A(x,w), V(x)> = 1 is boundeed by negl(x).\text{negl}(|x|).

Weaker SNARKS with trusted setup

We believe there’s some trusted party that creates the parameters and then disappears. Risky because a broken trusted setup is very bad.

Sometimes we can use multi-party trusted setup.

Types of pre-processing setup:

Setup(1λ,C)public parameters(pk,vk).\text{Setup}(1^\lambda, C) \rightarrow \text{public parameters}(pk,vk).

Completeness property with setup

<P(pk, x,w), V(vk, x)> denotes output of verifier on interaction with prover for input xx and witness ww.

For all (pk,vk)Setup(1λ)(pk, vk) \leftarrow \text{Setup}(1^\lambda) (finish line from slides)

Soundness property with setup

from slides

Knowledge

What does it mean to have knowledge?

Soundness saids that if the prover succeeds, there must exist a witness (except with very small probability). This is too weak for some applications.

“Knowledge soundness” captures the property that the prover must somehow “know” the witness ww in order to succeed in the protocol.

Knowledge soundness

A protocol is knowledge sound if there exists an extractor algorithm E that can obtain the witness w from any successful prover (informal).

E can run A for any number of steps, rewind A to a previous state, and re-run A on different inputs.

For every adversarial prover AA and input xx that causes verifier to accept with non-negligible probability, EE outputs ww such that C(x,w)=0C(x,w) = 0 with high probability.