A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Garbled Circuits

Research Depth 100 in the knowledge graph ☐ I know this ☆ Set as goal
539prerequisites beneath it
See this on the map →
Oblivious TransferSymmetric Encryption and Block Ciphers→
garbled-circuit yao-protocol two-party-computation free-xor half-gates

Core Idea

Yao's garbled circuits enable two-party secure computation. The garbler converts a Boolean circuit into a "garbled" version where each wire carries random labels instead of 0/1 values, and each gate's truth table is encrypted so that knowing input labels reveals only the output label — not whether it represents 0 or 1. The evaluator obtains their input labels via oblivious transfer and evaluates the garbled circuit gate by gate, learning only the final output. Key optimizations (point-and-permute, free XOR, half-gates) reduce cost from 4 ciphertexts per gate to 1.5 for AND gates and zero for XOR gates, making garbled circuits practical for real applications.

Explainer

Yao's garbled circuits (1986) are the foundational technique for two-party secure computation. The idea is elegant: convert the function to be computed into a Boolean circuit, then "garble" the circuit so it can be evaluated on encrypted values without revealing any intermediate results. The construction involves two parties — the garbler (who builds the garbled circuit) and the evaluator (who evaluates it) — and achieves the remarkable property that the evaluator learns the function's output but nothing else, while the garbler learns nothing at all.

The garbling process works as follows. For each wire in the circuit, the garbler generates two random labels — one representing 0 and one representing 1. For each gate, the garbler creates a garbled truth table: four entries, one for each combination of input values, where each entry encrypts the corresponding output label under the two input labels. The entries are randomly permuted so their position doesn't reveal information. The garbler sends the garbled circuit (all garbled truth tables) to the evaluator, along with the labels corresponding to the garbler's own input bits. The evaluator obtains labels for their own input bits via oblivious transfer (ensuring the garbler doesn't learn the evaluator's input). The evaluator then evaluates gate by gate: for each gate, they use their two input labels to decrypt exactly one truth table entry, obtaining the output label. At the final output wires, a decoding table maps labels back to 0/1.

Three optimizations have transformed garbled circuits from a theoretical construct into a practical tool. Point-and-permute attaches a signal bit to each label, allowing the evaluator to identify the correct truth table entry directly (without trial decryption), reducing from 4 decryption attempts to 1. Free XOR establishes a global offset R such that the two labels on every wire differ by R; XOR gates then require zero ciphertexts — the output label is simply the XOR of input labels. Half-gates reduce AND gate cost from 3 to 2 ciphertexts by decomposing each AND into two specialized "half-gates." Together, these optimizations mean a garbled circuit costs essentially 2 AES evaluations per AND gate and nothing per XOR gate.

The main limitations of garbled circuits are one-time use (each garbled circuit can be evaluated only once, requiring a fresh circuit per computation) and linear communication (the garbled circuit must be transmitted in its entirety, costing bandwidth proportional to the circuit size). For repeated evaluations of the same function, secret-sharing-based MPC protocols (like SPDZ) may be more efficient because they amortize setup cost. Garbled circuits excel for one-shot computations and when minimizing round complexity is important (the basic protocol requires only constant rounds of interaction). Modern MPC frameworks like EMP-toolkit and ABY combine garbled circuits with other techniques, automatically selecting the most efficient approach for each sub-computation.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → The P vs. NP Problem → Complexity Class P: Polynomial Time → Hash Functions and Collision Resistance → The RSA Cryptosystem → Computational Hardness Assumptions → Oblivious Transfer → Garbled Circuits

Longest path: 101 steps · 539 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.