Zero-Knowledge Middleboxes
Paul Grubbs - NYU/UMich
Arasu Arun - NYU
Ye Zhang - NYU
Joseph Bonneau - NYU/Melbourne
Mike Walfish - NYU
Zero-Knowledge Middleboxes
enforce
network
policies�
allow
encrypted
traffic
�
(using zero-knowledge proofs)
DNS Filtering
Client
MiddleBox
example.com
Is example.com allowed?
DNS Resolver
example.com
Blocklist
ban.co.uk
blocked.com
…
Local Network
DNS Filtering is a fact of life
In-flight
Schools
Cafes
Parental controls
legally required in USA
The rise of encrypted DNS: standards
The rise of encrypted DNS: resolvers
1.1.1.1
8.8.8.8
9.9.9.9
The rise of encrypted DNS: browsers
Encrypted DNS breaks filtering
Dilemma:
Client’s Privacy
vs.
Network Policy
MiddleBox
Is Enc(Query) allowed?
Blocklist
ban.co.uk
blocked.com…
???
Enc(Query)
Client
Mozilla’s “solution”: network-level kill switch
Past academic solutions
Can we achieve privacy & policy enforcement?
This is a job for zero-knowledge proofs
Zero-Knowledge �Sudoku Proof
Proof
Puzzle
Accept/Reject
Solution
Sudoku
Testing Algorithm
Prover knows �solution �to
Puzzle
Puzzle
, Proof
Prover
Verifier
ZK 101
proof π
public input
(statement)
private input
(witness)
Proving
Algorithm
Verification Algorithm
public input
(statement)
Accept/Reject
Blockchains have brought $$$ to ZKPs
New Application: ZKMBs
MiddleBox
Client
DNS Resolver
Enc(Query) + Proof
Blocklist
ban.co.uk
blocked.com
…
Verification Algorithm��Enc(Query) + Proof
Query is not in the Blocklist
Enc(Query)
Blocklist
ban.co.uk
blocked.com
…
Many evasion strategies exist for motivated clients
Assumption: client, server use standard protocols only
Filtering vs. Censorship
Censorship
Filtering
Polite request
Designing ZKMBS
Designing efficient ZK proofs remains challenging
Long-term expectations:
Today’s reality:
TLS is complex (even TLS 1.3)
ZKMBs proofs decompose into several tasks
Channel opening
Parse & extract
Policy
check
Ciphertext
Plaintext
Policy-relevant text
Accept/
reject
Channel opening statement proves plaintext matches transcript
Plaintext
Proof
Decryption (AES)
TLS Key Schedule (SHA-256)
key
Handshake
Transcript
TLS secrets
Simply supplying a valid AES key + decryption is insufficient
Problem:
Observation: TLS transcripts do commit to an exact AES key
Simple solution:
Fast solution:
Parse & extract circuit (DNS example)
Optional hints
Proof
Verify DNS query parse
Plaintext
Queried domain
Policy check: Merkle-tree non-membership
Verify Merkle
Non-inclusion Proof
Proof
Merkle �Non-Membership Proof
Domain
Blocklist
commitment
Implementation #1 (MB-optimized)
xJsnark: https://github.com/akosba/xjsnark
libsnark: https://github.com/scipr-lab/libsnark
Proving Time is the Bottleneck
Channel-opening
Parsing, policy check (DNS filtering)
Proving Time is the Bottleneck
MiddleBox
Client
Enc(Query) + Proof
5 ms
20 seconds
300 bytes
Verification time
Proof size
Proving time
75% of the runtime is due to SHA256!
Amortization
Opening Proof
Reuse Proof throughout session
Client
MiddleBox
20 seconds
6
seconds
* Middlebox needs to store some state
TLS 1.3 Session
Pre-computation
Opening Proof
Reuse Proof throughout session
TLS 1.3 Session
Doesn’t affect
DNS latency
Client
MiddleBox
20 seconds
6
seconds
Implementation #2 (balanced?)
Spartan: https://github.com/microsoft/Spartan
Spartan is much more client-friendly
Channel-opening
Parsing, policy check (DNS filtering)
Future Work
Conclusion: ZKMBs close to practical!
“Zero-Knowledge Middleboxes” paper: eprint.iacr.org/2021/1022.pdf
Implementation: github.com/pag-crypto/zkmbs
This work supported by the DARPA SIEVE Project
Operations Involved
SHA256 |
AES-GCM |
Poseidon Hash |
Blocklist with ~1 M entries