Type-checking protocols k A secret k A only signs pairs for which AliceSends holds & authentic T A = {x : String*Prin | AliceSends x} k A :SigKey(T A ) vk(k A ) : VerKey(T A ) vk(k A ) authentic (also for Bob) m = "Meet@2pm" : String assume (AliceSends (m,Bob)) sign((m,Bob), k A ) y : Un let y = in(net) in (x m ,x b ) : T A if check(y,vk(k A )) ⇓ (x m ,x b ) then {x b == Bob} if x b == Bob then assert (AliceSends (x m ,Bob)) ✓ Intuituion : strong type of k A allows us to “transfer” AliceSends predicate from Alice to Bob [Fournet, Gordon & Ma fg eis, CSF 2007], [Bengtson et. al., CSF 2008]
Advantages of type systems for protocol analysis • modular → efficient and scalable analysis • incremental (type-check while writing the code) • robust to changes • useful error messages (pinpoints location in the code) • both for protocol models ( π ) & implementations ( λ ) • unbounded # of executions by sound approximation
Inherent / incidental limitations • User often needs to write some type annotations • we require the same ( π , inference) or more annotations ( λ ) • Precise protocol analysis requires sophisticated types • we use even more expressive types • Restricted to simple crypto primitives (enc, sign, hash) • no existing type system could handle zero-knowledge proofs • the only previous symbolic analysis for ZK used ProVerif [Backes, Maffei & Unruh, S&P 2008]
Inherent / incidental limitations • User often needs to write some type annotations • we require the same ( π , inference) or more annotations ( λ ) • Precise protocol analysis requires sophisticated types • we use even more expressive types • Restricted to simple crypto primitives (enc, sign, hash) • no existing type system could handle zero-knowledge proofs • the only previous symbolic analysis for ZK used ProVerif [Backes, Maffei & Unruh, S&P 2008] • the first type systems that can handle ZK ( π + λ )
Inherent / incidental limitations • User often needs to write some type annotations • we require the same ( π , inference) or more annotations ( λ ) • Precise protocol analysis requires sophisticated types • we use even more expressive types • Restricted to simple crypto primitives (enc, sign, hash) • no existing type system could handle zero-knowledge proofs • the only previous symbolic analysis for ZK used ProVerif [Backes, Maffei & Unruh, S&P 2008] • the first type systems that can handle ZK ( π + λ )
Inherent / incidental limitations • User often needs to write some type annotations • we require the same ( π , inference) or more annotations ( λ ) • Precise protocol analysis requires sophisticated types • • we use even more expressive types we use even more expressive types • Restricted to simple crypto primitives (enc, sign, hash) • no existing type system could handle zero-knowledge proofs • the only previous symbolic analysis for ZK used ProVerif [Backes, Maffei & Unruh, S&P 2008] • the first type systems that can handle ZK ( π + λ )
Inherent / incidental limitations • User often needs to write some type annotations • • we require the same ( π , inference) or more annotations ( λ ) we require the same ( π , inference) or more annotations ( λ ) • Precise protocol analysis requires sophisticated types • • we use even more expressive types we use even more expressive types • Restricted to simple crypto primitives (enc, sign, hash) • no existing type system could handle zero-knowledge proofs • the only previous symbolic analysis for ZK used ProVerif [Backes, Maffei & Unruh, S&P 2008] • the first type systems that can handle ZK ( π + λ )
13 emerging applications of zero-knowledge proofs anonymous authentication electronic voting security despite compromise privacy-friendly smart metering privacy-aware anonymous credentials digital identity management decentralized social networks anonymous trust and reputation risk assurance for hedge funds e-cash electronic auctions anonymous electronic ticketing for public transportation biometric authentication
Achieving seemingly conflicting security requirements with ZK + ➔ vote privacy verifiability electronic voting + ➔ protecting digital credentials privacy-enabled identity systems personal information “proving you are over 18 without revealing your age”
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover sign((A,29),k i )
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) sign((A,29),k i )
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) sign((A,29),k i )
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) check(sign((A,29),k i ), vk(k i )) ⇓ (A,29) ∧ 29 ≥ 18 sign((A,29),k i )
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) ✓ check(sign((A,29),k i ), vk(k i )) ⇓ (A,29) ∧ 29 ≥ 18 sign((A,29),k i )
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) ✓ check(sign((A,29),k i ), vk(k i )) ⇓ (A,29) ∧ 29 ≥ 18 A vk(k i ) • sign((A,29),k i ) verifier finds out whether the proof is valid or not, and the public arguments
Zero-knowledge (symbolically) • Non-interactive zero-knowledge proofs • very powerful crypto primitives • show validity of a statement without revealing the witnesses S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 Prover Verifier zk S age (29, sign((A,29),k i ); A, vk(k i )) ✓ check(sign((A,29),k i ), vk(k i )) ⇓ (A,29) ∧ 29 ≥ 18 A vk(k i ) • sign((A,29),k i ) verifier finds out whether the proof is valid or not, and the public arguments (zero-knowledge) no other information is revealed about the witnesses (soundness) cannot produce wrong proof that passes verification
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 age = 29 : Private Verifier cert = sign((A,age),k i ) zk S age (age, cert; A, vk(k i ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 age = 29 : Private Verifier cert = sign((A,age),k i ) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 age = 29 : Private Verifier cert = sign((A,age),k i ) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) assume IssueId(A,age) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) assume IssueId(A,age) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} assume IssueId(A,age) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) assume IssueId(A,age) vk(k i ) : VerKey(T ki ) x age ≥ 18 check(x cert , y vki ) ⇓ (y name ,x age ) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) assume IssueId(A,age) vk(k i ) : VerKey(T ki ) x age ≥ 18 check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) assume IssueId(A,age) vk(k i ) : VerKey(T ki ) x age ≥ 18 check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ assert (Accept (y name )) Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) assume IssueId(A,age) vk(k i ) : VerKey(T ki ) x age ≥ 18 check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) zk S age (age, cert’; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ assert (Accept (y name )) Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) k i : SigKey(T ki ) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) assume IssueId(A,age) vk(k i ) : VerKey(T ki ) x age ≥ 18 check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) zk S age (age, cert’; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then If proof created by attacker: ✖ assert (Accept (y name )) x age : Un x cert : Un y name : Un Not enough to justify assert! y vki : Un ∧ VerKey(T ki )
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) It can’t be that x age : Private and x age : Un vk(k i ) : VerKey(T ki ) since Private and Un are disjoint types; x age ≥ 18 so the proof was’n created by attacker check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ If proof created by attacker: ✖ assert (Accept (y name )) x age : Un x cert : Un y name : Un Not enough to justify assert! y vki : Un ∧ VerKey(T ki )
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} Type-checker initially knows: y vki = vk(k i ) It can’t be that x age : Private and x age : Un vk(k i ) : VerKey(T ki ) since Private and Un are disjoint types; x age ≥ 18 so the proof was’n created by attacker check(x cert , y vki ) ⇓ (y name ,x age ) Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then (ie. type-checked), so we just need to impose ✖ assert (Accept (y name )) more restrictions on ZK proof creation Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) Type associated to ZK statement Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then (ie. type-checked), so we just need to impose ✖ assert (Accept (y name )) more restrictions on ZK proof creation Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) Type associated to ZK statement Check this formula whenever honest participant creates ZK proof Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then (ie. type-checked), so we just need to impose ✖ assert (Accept (y name )) more restrictions on ZK proof creation Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) Type associated to ZK statement Check this formula whenever honest participant creates ZK proof Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier ✓ x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then (ie. type-checked), so we just need to impose ✖ assert (Accept (y name )) more restrictions on ZK proof creation Not enough to justify assert!
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) Type associated to ZK statement Check this formula whenever honest participant creates ZK proof Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier ✓ x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then (ie. type-checked), so we just need to impose assert (Accept (y name )) more restrictions on ZK proof creation Assume (existentially quantified) formula if verification succeeds
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T ki ={x : Un*Private | IssueId x} T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) Type associated to ZK statement Check this formula whenever honest participant creates ZK proof Type-checker infers: age = 29 : Private (y name ,x age ) : T ki same as Verifier ✓ x age : Private and IssueId(y name ,x age ) cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in The proof was created by honest participant if ver S age (z, =vk(k i )) ⇓ y name then ✓ (ie. type-checked), so we just need to impose assert (Accept (y name )) more restrictions on ZK proof creation Assume (existentially quantified) formula if verification succeeds
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : Un*Private | IssueId x} k i : SigKey(T ki ) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : Un*Private | IssueId x} k i : SigKey(T ki ) age = 29 : Private Verifier cert = sign((A,age),k i ) assume ProverSends(A,age) zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : Un*Private | IssueId x} k i : SigKey(T ki ) age = 29 : Private Verifier cert = sign((A,age),k i ) age cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : Un*Private | IssueId x} k i : SigKey(T ki ) This needs to change age = 29 : Private Verifier cert = sign((A,age),k i ) age cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : Un*Private | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) This needs to change age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) Snowball effect T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) This needs to change age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) Snowball effect T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) This needs to change age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) Snowball effect T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) This needs to change age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ assert (Accept (y name )) Failed assert - no ProverSends...
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) Snowball effect T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) This needs to change age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ Attacker following protocol assert (Accept (y name )) (not real attack) Failed assert - no ProverSends...
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) weaken policy assume (Comp(y name ) ⇒ ∀ x age . ProverSends(y name ,x age )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert zk S age (age, cert; A, vk(k i )) let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✖ Attacker following protocol assert (Accept (y name )) (not real attack) Failed assert - no ProverSends...
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) weaken policy assume (Comp(y name ) ⇒ ∀ x age . ProverSends(y name ,x age )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) Inferred types conditioned by other types not being compromised x age : {|fkind(T ki , tnt)|} ∨ {x age : PrivateUnless(A) | IssueId(y name ,x age )} age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) assume (Comp(A)) age cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) weaken policy assume (Comp(y name ) ⇒ ∀ x age . ProverSends(y name ,x age )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) Inferred types conditioned by other types not being compromised x age : {|fkind(T ki , tnt)|} ∨ {x age : PrivateUnless(A) | IssueId(y name ,x age )} age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) false because of IssueId assume (Comp(A)) age (issuer is not compromised) cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) weaken policy assume (Comp(y name ) ⇒ ∀ x age . ProverSends(y name ,x age )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) Inferred types conditioned by other types not being compromised x age : {|fkind(T ki , tnt)|} ∨ {x age : PrivateUnless(A) | IssueId(y name ,x age )} age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) false because of IssueId case analysis on Comp(A) assume (Comp(A)) age (issuer is not compromised) cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then assert (Accept (y name ))
S age = witness x age , x cert public y name ,y vki , in check(x cert , y vki ) ⇓ (y name ,x age ) ∧ x age ≥ 18 assume ( ∀ y name ,x age . ProverSends(y name ,x age ) ∧ IssueId(y name ,x age ) ∧ x age ≥ 18 ⇒ Accept(x name )) weaken policy assume (Comp(y name ) ⇒ ∀ x age . ProverSends(y name ,x age )) T S age =ZKProof(... ∃ x age ,x cert . ProverSends(y name ,x age )...) T ki ={x : (x name : Un * PrivateUnless(x name )) | IssueId x} PrivateUnless(A) = {Private | ¬ Comp(A)} ∨ {Un | Comp(A)} k i : SigKey(T ki ) Inferred types conditioned by other types not being compromised x age : {|fkind(T ki , tnt)|} ∨ {x age : PrivateUnless(A) | IssueId(y name ,x age )} age = 29 : PrivateUnless(A) Verifier cert = sign((A,age),k i ) false because of IssueId case analysis on Comp(A) assume (Comp(A)) age (issuer is not compromised) cert let z = in(net) in if ver S age (z, =vk(k i )) ⇓ y name then ✓ assert (Accept (y name )) Protocol robustly safe even when A compromised
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information tree � α � = µβ. α + α ∗ β ∗ β
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information tree � α � = µβ. α + α ∗ β ∗ β Private # Un Private ∗ tree � Private � ∗ tree � Private � # Un ∗ tree � Un � ∗ tree � Un � Private # Un Private + Private ∗ tree � Private � ∗ tree � Private � # Un + Un ∗ tree � Un � ∗ tree � Un � µβ. Private + Private ∗ β ∗ β # µβ. Un + Un ∗ β ∗ β tree � Private � # Un
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information tree � α � = µβ. α + α ∗ β ∗ β Private # Un Private ∗ tree � Private � ∗ tree � Private � # Un ∗ tree � Un � ∗ tree � Un � Private # Un Private + Private ∗ tree � Private � ∗ tree � Private � # Un + Un ∗ tree � Un � ∗ tree � Un � µβ. Private + Private ∗ β ∗ β # µβ. Un + Un ∗ β ∗ β tree � Private � # Un • More powerful non-disjointness judgement If T 1 overlaps with T 2 E ⊢ T 1 � � T 2 � F then formula F holds
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information tree � α � = µβ. α + α ∗ β ∗ β Private # Un Private ∗ tree � Private � ∗ tree � Private � # Un ∗ tree � Un � ∗ tree � Un � Private # Un Private + Private ∗ tree � Private � ∗ tree � Private � # Un + Un ∗ tree � Un � ∗ tree � Un � µβ. Private + Private ∗ β ∗ β # µβ. Un + Un ∗ β ∗ β tree � Private � # Un • More powerful non-disjointness judgement If T 1 overlaps with T 2 E ⊢ T 1 � � T 2 � F then formula F holds Disjointness encoded T 1 # T 2 � ⊢ T 1 � � T 2 � false
Reasoning about Type Disjointness New ! • Syntactically derive type disjointness information tree � α � = µβ. α + α ∗ β ∗ β Private # Un Private ∗ tree � Private � ∗ tree � Private � # Un ∗ tree � Un � ∗ tree � Un � Private # Un Private + Private ∗ tree � Private � ∗ tree � Private � # Un + Un ∗ tree � Un � ∗ tree � Un � µβ. Private + Private ∗ β ∗ β # µβ. Un + Un ∗ β ∗ β tree � Private � # Un • More powerful non-disjointness judgement If T 1 overlaps with T 2 E ⊢ T 1 � � T 2 � F then formula F holds Disjointness encoded T 1 # T 2 � ⊢ T 1 � � T 2 � false Our base case is security-specific ( ⊢ PrivateUnless F � � Un � F ) but the inductive cases are not.
Models ( π ) Implementations ( λ )
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x :
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types first-order authorization logic der authorization logic
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types first-order authorization logic der authorization logic reasoning about type disjointness (#) easoning about type disjointness (#)
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types first-order authorization logic der authorization logic reasoning about type disjointness (#) easoning about type disjointness (#) logical kinding&subtyping (novel) inductive kinding&subtyping (standard)
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types first-order authorization logic der authorization logic reasoning about type disjointness (#) easoning about type disjointness (#) logical kinding&subtyping (novel) inductive kinding&subtyping (standard) statement-based inference for ZK code generation from ZK statement
Models ( π ) Implementations ( λ ) concurrent λ -calculus (RCF); ML core spi calculus variant encryption, signatures, hashes, blind signatur hashes, blind signatures, zero-knowledge constructors and destructors crypto encoded using dynamic sealing efinement {x : T | C}, dependent pair ( Σ ) types union ( ∨ ), intersection ( ∧ ), refinement {x : + dependent function ( Π ), sum (+), iso- + lots of crypto-specific types recursive ( μ ), polymorphic ( ∀ ) types first-order authorization logic der authorization logic reasoning about type disjointness (#) easoning about type disjointness (#) logical kinding&subtyping (novel) inductive kinding&subtyping (standard) statement-based inference for ZK code generation from ZK statement type-checker is extensible, proof is not extending type system requires no proof
Formalization and Proofs • Formalized definitions in Coq + “partial formal proofs” Coq + ( π ) 17kLOC (2.9kLOC of definitions -- 250 rules) Ott + ( λ ) 14kLOC (1.5kLOC of definitions -- 135 rules) LNGen • Found and fixed bugs in our previous definitions and in published “convincing paper proofs” partial vigorous convincing axiom-free no proofs formal proofs formal proofs handwaving paper proofs
Formalization and Proofs • Formalized definitions in Coq + “partial formal proofs” Coq + ( π ) 17kLOC (2.9kLOC of definitions -- 250 rules) Ott + ( λ ) 14kLOC (1.5kLOC of definitions -- 135 rules) LNGen • Found and fixed bugs in our previous definitions and in published “convincing paper proofs” partial vigorous convincing axiom-free no proofs formal proofs formal proofs handwaving paper proofs • Shortly before Christmas Matteo found a bug in weakening for statement-based inference ( π ) • fix required significant change to subtyping (inductive+logical → just logical) • still working on updating all the proofs (will finish that for final version of thesis)
Recommend
More recommend