Interactive demos

Both demos on this page run the exact construction from how it works — real SHA-256 keystreams and XOR, computed live via the browser’s Web Crypto API. Nothing here is precomputed or mocked.

Garble and evaluate an AND gate

  1. Garble the gate — generates six fresh random 128-bit wire labels and builds the 4-row garbled table, then shuffles it.
  2. Pick input bits and evaluate — the Evaluator XORs its keystream against all 4 shuffled rows and keeps the one whose last 128 bits are zero.

Ready.

Try different input combinations and re-garble to see the labels and table contents change completely each time — nothing about a label or a ciphertext’s position reveals what it corresponds to.

Compare two 2-bit numbers

A single AND gate proves the construction — this shows it scales. Alice and Bob each pick a number from 0–3; the circuit below computes a > b using eleven chained AND/XOR/NOT gates (the “two millionaires” idea from what garbled circuits are, just very small numbers), without either input ever appearing anywhere except as an opaque wire label.

Ready.

a
b

Sources: implements the constructions derived on how it works.