A garbled circuit is a cryptographic protocol that enables two-party secure computation by encrypting a Boolean circuit gate-by-gate, allowing evaluation without revealing the inputs. One party, the garbler, constructs an encrypted version of the circuit and their input, while the evaluator computes the output using oblivious transfer to learn only their designated output.
Glossary
Garbled Circuits

What is Garbled Circuits?
A foundational protocol for secure two-party computation that enables joint function evaluation while keeping each party's input private.
The protocol represents each wire in the circuit with two random cryptographic labels corresponding to logical 0 and 1. The garbler encrypts the truth table of each gate so the evaluator can decrypt exactly one output label per gate without learning the underlying plaintext values, ensuring input privacy throughout the computation.
Key Features of Garbled Circuits
Garbled circuits provide a foundational protocol for secure two-party computation, enabling mutually distrustful parties to jointly evaluate a function over their private inputs without revealing those inputs to each other. The following cards break down the core mechanisms and properties that define this technology.
Gate-by-Gate Encryption
The fundamental mechanism of a garbled circuit involves treating a boolean function as a logical circuit and encrypting it gate by gate. The garbler assigns two random cryptographic labels to each wire in the circuit, representing the values 0 and 1. For each logic gate, the garbler encrypts the output label using the corresponding input labels as keys. The evaluator can only decrypt the single output label that corresponds to their specific inputs, learning nothing about the alternative path.
Oblivious Transfer (OT) Integration
To initiate the protocol without revealing the evaluator's private input, garbled circuits rely on Oblivious Transfer (OT). The evaluator needs the wire labels corresponding to their input bits, but cannot ask the garbler directly without exposing those bits. OT allows the evaluator to select and receive the correct labels for their input from the garbler, while the garbler remains oblivious to which labels were chosen. This ensures the evaluator's input privacy from the very first step.
One-Time Use & Non-Reusability
A standard garbled circuit is inherently single-use. The cryptographic keys (wire labels) are generated for a specific execution. If the same garbled circuit were evaluated twice with different inputs, the evaluator could use the labels learned from the first execution to decrypt additional gates in the second, violating the garbler's input privacy. This property necessitates generating a fresh circuit for every computation, which is a primary driver of the protocol's computational overhead.
Constant-Round Communication Complexity
A significant advantage of the garbled circuit protocol is its constant number of communication rounds. The interaction between the garbler and evaluator is minimal: the garbler sends the garbled circuit and their input labels, the evaluator performs the OT for their input labels, and finally, the evaluator computes the result. This fixed, low-latency interaction pattern is independent of the circuit's depth, making it highly suitable for high-latency networks where minimizing back-and-forth is critical.
Point-and-Permute Optimization
A critical optimization to reduce evaluation cost is the point-and-permute technique. Without it, the evaluator would need to attempt decrypting a gate's ciphertext with multiple key combinations to find the correct one. Point-and-permute appends a random 'pointer' bit to each wire label. The garbler orders the gate's ciphertexts based on these pointer bits, allowing the evaluator to immediately identify which single ciphertext to decrypt using the pointer bits of the input labels they hold, reducing evaluation to one decryption per gate.
Security Against Semi-Honest Adversaries
The classic Yao's garbled circuit protocol is proven secure in the semi-honest (or honest-but-curious) security model. This assumes both parties follow the protocol exactly but may try to learn additional information from the messages they receive. It guarantees that the evaluator learns only the final output and their own input, while the garbler learns nothing about the evaluator's input. Extensions using cut-and-choose techniques or zero-knowledge proofs are required to achieve security against malicious adversaries who may deviate from the protocol.
Garbled Circuits vs. Other Secure Computation Techniques
A technical comparison of garbled circuits against homomorphic encryption, secret sharing-based SMPC, and differential privacy across key operational dimensions for privacy-preserving computation.
| Feature | Garbled Circuits | Fully Homomorphic Encryption | Secret Sharing SMPC | Differential Privacy |
|---|---|---|---|---|
Computational Model | Boolean circuit evaluation | Arithmetic circuits on ciphertext | Arithmetic/Boolean circuit sharing | Statistical noise injection |
Number of Parties | 2 (extendable to N) | 1 (computation on encrypted data) | 3+ (honest majority typical) | 1 (data curator) |
Communication Complexity | High (O(n) circuit size) | Low (no interaction during compute) | Very High (O(n) per multiplication) | None (statistical mechanism) |
Computation Overhead | Moderate (symmetric key ops) | Extremely High (lattice operations) | Moderate (linear ops fast) | Negligible |
Output Accuracy | Exact | Exact | Exact | Approximate (ε, δ bounded) |
Resistant to Quantum Attacks | ||||
Round Complexity | Constant (1-2 rounds) | 1 round (non-interactive) | Linear in circuit depth | Not applicable |
Primary Use Case | Private set intersection, auctions | Cloud computation on encrypted data | Statistical analysis, voting | Public dataset release, analytics |
Frequently Asked Questions
Clear, technically precise answers to the most common questions about Yao's Garbled Circuits protocol, its role in secure two-party computation, and its implementation in modern privacy-preserving systems.
A Garbled Circuit is a cryptographic protocol that enables two mutually distrustful parties to jointly evaluate a function over their private inputs without revealing those inputs to each other. The protocol works by having one party, the Garbler, encrypt a Boolean circuit representation of the function gate-by-gate. For each gate, the Garbler generates a garbled truth table by encrypting the possible output wire labels using the corresponding input wire labels as keys. The second party, the Evaluator, receives the garbled circuit and the wire labels corresponding to its own input via Oblivious Transfer (OT). The Evaluator then evaluates the circuit gate-by-gate, decrypting exactly one row per gate to obtain the output wire label, without learning any intermediate values or the Garbler's input. The final output labels are mapped back to plaintext bits using a decoding table. This construction guarantees semantic security for both parties' inputs, assuming the underlying symmetric encryption scheme is secure and the OT protocol is oblivious.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Garbled circuits are a foundational protocol within the broader landscape of secure computation. The following concepts represent the essential building blocks, alternatives, and optimizations that interact with or extend the core garbled circuit technique.
Oblivious Transfer (OT)
A fundamental cryptographic protocol that serves as the input-handling mechanism for garbled circuits. In an OT, a sender transmits multiple messages, but the receiver only learns one, while the sender remains oblivious to which was selected.
- 1-out-of-2 OT: The most common variant where the receiver chooses one of two messages.
- Role in Garbled Circuits: The circuit evaluator uses OT to privately retrieve the garbled keys corresponding to their private input bits from the circuit generator.
- OT Extension: A performance optimization that uses a small number of computationally expensive 'base' OTs to generate a vast number of efficient OTs using only symmetric-key operations.
Point-and-Permute
A standard optimization technique that eliminates the need for the evaluator to attempt decrypting all four rows of a garbled gate to find the correct output.
- Mechanism: A random permutation bit is appended to each wire label. The garbled table rows are sorted based on these external bits.
- Efficiency Gain: The evaluator simply uses the permutation bits of the two input labels to index directly into the correct row of the garbled table, reducing evaluation cost by a factor of four.
- Security: The permutation bit is independent of the actual truth value, revealing no semantic information about the underlying computation.
Free-XOR
A groundbreaking optimization that allows XOR gates to be evaluated without any cryptographic operations and without transmitting any ciphertext.
- Method: The circuit generator chooses a global random offset R. For every wire, the 0-label and 1-label differ by this same offset. The XOR of two labels naturally produces a valid output label.
- Impact: Since XOR gates are ubiquitous in boolean circuits, this technique drastically reduces communication and computation overhead, making garbled circuits practical for complex functions.
Half-Gates
A state-of-the-art optimization that reduces the cost of garbling an AND gate to just two ciphertexts, down from the original four.
- Technique: An AND gate is decomposed into two 'half-gates'—one generated by each party. The first half-gate uses a technique similar to Free-XOR, while the second leverages the evaluator's knowledge of one input label.
- Result: Combined with Free-XOR, the total cost of a garbled circuit is reduced to 2 ciphertexts per AND gate, making it the most efficient known garbling scheme for boolean circuits.
Cut-and-Choose
A security mechanism that defends against a malicious circuit generator who might construct an incorrect or corrupt circuit to leak private information.
- Protocol: The generator creates multiple independent garbled copies of the circuit. The evaluator randomly selects a fraction to be 'opened' and verified for correctness.
- Assurance: If all opened circuits are correct, the remaining unopened circuits are evaluated with majority voting. The probability of undetected cheating decreases exponentially with the number of circuits.
- Modern Variants: Optimizations like LEGO and TinyLEGO use soldering techniques to reduce the replication overhead.
Authenticated Garbling
A modern paradigm shift that moves from the cut-and-choose model to a more efficient single-circuit execution with malicious security.
- Mechanism: The generator commits to the correct garbling of each gate using cryptographic authentication. During evaluation, the evaluator verifies these commitments without revealing their input.
- Key Protocols: Systems like WRK (Wang, Ranellucci, Katz) and Authenticated Garbling (Hazay et al.) achieve malicious security with only a constant factor overhead over semi-honest protocols.
- Advantage: Eliminates the statistical security parameter and the high replication cost of cut-and-choose.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us