A garbled circuit is a cryptographic protocol for secure two-party computation (2PC) where a function is represented as a Boolean circuit. The circuit constructor "garbles" the circuit by encrypting the truth table of each logic gate using symmetric keys, creating a garbled truth table. The evaluator then obliviously computes the output by decrypting only the specific gate entries corresponding to the parties' private input wires, learning the final result but nothing about the constructor's input or the intermediate wire values.
Glossary
Garbled Circuits

What is Garbled Circuits?
A foundational cryptographic protocol enabling two mutually distrusting parties to jointly evaluate a function over their private inputs without revealing those inputs to each other.
The protocol relies on oblivious transfer (OT) to securely deliver the evaluator's input keys without revealing the input itself. While computationally intensive due to circuit-level encryption, optimizations like the free-XOR and half-gate techniques have made garbled circuits practical for privacy-preserving applications such as fraud detection across competing banks, secure auctions, and private set intersection, where raw transaction data must never be exposed.
Key Features of Garbled Circuits
Garbled circuits enable two mutually distrustful parties to jointly evaluate a function over their private inputs without revealing those inputs to each other. The protocol represents the function as a Boolean circuit, encrypts the wire values, and allows evaluation through a series of oblivious transfers.
Boolean Circuit Representation
The function to be computed is first compiled into a Boolean circuit consisting of logic gates (AND, XOR, NOT) and wires. This circuit representation is fundamental because garbled circuits operate at the gate level, encrypting the truth table of each gate. The garbler constructs this circuit and assigns two random cryptographic labels to each wire—one representing logical 0 and one representing logical 1—ensuring that the evaluator learns only the output label without discovering the underlying plaintext value.
Garbled Gate Construction
Each logic gate in the circuit is garbled by encrypting its output wire labels using the input wire labels as encryption keys. For a 2-input gate, the garbler creates four ciphertexts—one for each possible input combination—encrypting the corresponding output label. The resulting garbled table is randomly permuted so the evaluator cannot determine which ciphertext corresponds to which input combination. Only by possessing the correct input labels can the evaluator decrypt exactly one entry and obtain the correct output label.
Oblivious Transfer for Input Delivery
The evaluator obtains the wire labels corresponding to their private input through Oblivious Transfer (OT). In each OT instance, the garbler holds two labels (for 0 and 1), and the evaluator selects one based on their actual input bit. The garbler learns nothing about which label was selected, and the evaluator learns only the label for their chosen bit. This cryptographic primitive ensures that the evaluator's input remains private while providing exactly the labels needed to evaluate the circuit.
Point-and-Permute Optimization
The point-and-permute technique dramatically reduces evaluation cost by appending a random color bit to each wire label. The garbler uses these color bits to sort the garbled table, allowing the evaluator to identify which ciphertext to decrypt by simply observing the color bits of their input labels. This eliminates the need to trial-decrypt all four ciphertexts per gate, reducing the evaluator's work from four decryptions to a single decryption per gate while maintaining security.
Free-XOR Technique
The Free-XOR optimization eliminates cryptographic operations for XOR gates entirely. By choosing wire labels such that the XOR of two input labels equals the output label—specifically, setting label pairs with a fixed global offset Δ—XOR gates can be evaluated by simply XORing the input labels together. Since XOR gates often constitute a large fraction of Boolean circuits, this technique yields substantial performance improvements, making garbled circuits practical for complex functions.
Half-Gates Construction
The half-gates technique reduces the size of garbled AND gates from four ciphertexts to just two, cutting communication overhead nearly in half. It decomposes each AND gate into two half-gates—one where the garbler knows one input and one where the evaluator knows one input—and combines them using a free-XOR operation. Combined with Free-XOR, this optimization makes the entire garbled circuit protocol remarkably efficient, with AND gates requiring only two ciphertexts and XOR gates requiring none.
Frequently Asked Questions
Clear, technical answers to the most common questions about Yao's Garbled Circuits, their role in secure multi-party computation, and their application in privacy-preserving fraud analytics.
A garbled circuit is a cryptographic protocol for secure two-party computation (2PC) that allows two mutually distrusting parties to jointly evaluate any Boolean function over their private inputs without revealing those inputs to each other. The protocol works by having one party, the garbler, construct an encrypted version of a Boolean circuit representing the function. Each wire in the circuit is assigned two random cryptographic labels representing logical 0 and 1. Each logic gate is then replaced with a garbled truth table—a set of four ciphertexts encrypting the appropriate output label under the corresponding input labels. The second party, the evaluator, receives the garbled circuit and uses oblivious transfer (OT) to obtain the labels corresponding to its own private input bits without the garbler learning which labels were selected. The evaluator then processes the circuit gate-by-gate, decrypting exactly one entry per gate to obtain the output label, which is finally mapped back to a plaintext result. The fundamental security property is that the evaluator learns nothing about the garbler's input beyond what is logically revealed by the function's output, and the garbler learns nothing about the evaluator's input whatsoever.
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 for secure two-party computation. These related cryptographic primitives and concepts form the ecosystem of privacy-preserving computation essential for collaborative fraud detection.

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