0Pricing
Cryptology Academy · Lesson

MPC Problem & Yao's Garbled Circuits

Understand 2-party secure computation via garbled Boolean circuits.

MPC Problem & Yao's Garbled Circuits is a free Cryptology Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Secure Multi-Party Computation Problem

MPC allows n parties, each holding private input x_i, to jointly compute f(x_1,...,x_n) without revealing their inputs to each other — as if a trusted third party computed it.

Classic Example: Millionaires' Problem

Yao's 1982 Millionaires' Problem: Alice and Bob want to know who is richer without disclosing their wealth. No trusted third party. MPC solves this with cryptographic guarantees.

Security Goals in MPC

1. Privacy: parties learn only the output and what they can infer from it. 2. Correctness: the output is correct even if some parties are corrupt. 3. Variants exist for semi-honest vs malicious adversaries.

Boolean Circuits as the Computation Model

Any function can be expressed as a Boolean circuit (AND, XOR, NOT gates). MPC protocols often work at the circuit level, evaluating each gate securely.

Yao's Garbled Circuit Construction

Alice (garbler) assigns two random labels per wire: one for 0, one for 1. She encrypts each gate's truth table under the input wire labels. Bob (evaluator) learns only the labels for his inputs via Oblivious Transfer.

Garbled Gate Evaluation

Bob receives garbled tables (4 encryptions per AND gate). He decrypts exactly one row using his input labels, obtaining the output label — without learning whether it represents 0 or 1.

Point-and-Permute Optimisation

Attach a random "select bit" to each label. Bob uses the select bits to find the correct garbled row in O(1) instead of trying all four decryptions. Reduces computation by 4×.

Free-XOR Optimisation

Kolesnikov & Schneider (2008): choose a global offset Δ. Then label_1 = label_0 ⊕ Δ for every wire. XOR gates become free (no encryption needed), saving ~30% bandwidth.

Half-Gates: Minimal AND Gates

Zahur et al. (2015): each AND gate requires only 2 ciphertexts (down from 4). Combined with Free-XOR, this halves the bandwidth of standard garbled circuits.

Two-Party vs Multi-Party Garbling

Classic garbled circuits are 2-party. Multi-party extensions (e.g., BMR protocol) parallelize garbling across all parties but require O(n²) communication. Practical for small n.

Knowledge Check

In Yao's garbled circuit protocol, how does Bob obtain the wire labels corresponding to his private input bits?

Lesson Recap

MPC lets parties compute jointly without revealing inputs. Garbled circuits encode Boolean functions as encrypted truth tables. Optimisations (Free-XOR, Half-Gates, Point-and-Permute) make them practical. OT delivers Bob's input labels privately.

Frequently asked questions

Is the “MPC Problem & Yao's Garbled Circuits” lesson free?

Yes — the full text of “MPC Problem & Yao's Garbled Circuits” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “MPC Problem & Yao's Garbled Circuits”?

Understand 2-party secure computation via garbled Boolean circuits. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “MPC Problem & Yao's Garbled Circuits” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. MPC Problem & Yao's Garbled Circuits
  2. GMW Protocol & Oblivious Transfer
  3. SPDZ & Arithmetic MPC over Secret Shares
  4. MPC Applications: Private Set Intersection & ML
← Back to Cryptology Academy