You need to prove you know the password to an account, or the private key behind a signature, or that you're over 21 — without ever handing over the password, the key, or your birth date. Is it actually possible to convince someone a secret exists and that you have it, while giving them zero information about what the secret actually is?
Commit Prover picks random r = 4, sends c = r² mod 91 = 16. (The verifier never learns r itself yet.)
Challenge Verifier flips a coin and asks for branch 0.
Respond Prover reveals r = 4 directly.
✓ Verified — the check for branch 0 holds.
The prover commits to a random number first, before knowing which question the verifier will ask. Whichever branch gets challenged, the prover can answer honestly — but each answer alone (just r, or just r·x mod n) looks like a random number to the verifier. Neither branch, on its own, reveals x.
This is a simplified Fiat-Shamir identification scheme. Public knowledge: a modulus and a value . The prover claims to know a square root of , without revealing it.
- , — public: the modulus, and , the value whose root is being proven known.
- — a fresh random number the prover picks each round; never revealed directly unless .
- — the commitment, , sent before the challenge is known.
- — the verifier's random challenge bit, or , chosen after is committed.
- — the response when : , which mixes in but never exposes it alone.
- A cheater can prepare for at most one branch
Without knowing , an impostor can fake a valid-looking commitment for one branch (say, honestly revealing some for ) — but has no way to produce a with for , since that requires actually knowing .
- One round only catches a cheater half the time
The verifier's challenge is random, so an impostor who guessed which branch to prepare for gets away with it whenever the verifier happens to ask that same branch — a coin flip, 50/50.
- Independent rounds multiply — probability of cheating shrinks fast
Repeating with a fresh random and a fresh random challenge each round, the rounds are independent: the chance a cheater survives all of them is , collapsing toward zero very quickly.
- Yet the verifier never learns x
Each round leaks only or — one masked value, chosen fresh every round — never enough, across any number of rounds, to isolate itself.
y = x² mod 91 = 25 is public; x itself is never revealed, in any round.
After 1 independent round, an impostor who doesn’t know x fools the verifier with probability (1/2)1 = 0.5000 (50.00%).
Drag the rounds slider and watch collapse: by round 5 an impostor's odds are already under 1 in 30, and it keeps falling from there — all while the verifier still never learns .
Public setup: , secret , public . The prover picks for this round.
- Commit
. The prover sends 16 and waits for the challenge.
- Branch b=0: reveal r
Response . Verifier checks , which matches . ✓ Passes — and the verifier has learned only that some with exists, nothing about .
- Branch b=1: reveal r·x mod n instead
Response . Verifier checks , and separately . Both sides equal 36. ✓ Passes.
- Rounds needed for under 5% cheating odds
- At 4 rounds: — still above 5%
- At 5 rounds: — clears it
So 5 rounds is the smallest number that pushes a cheater's odds below 5%.
Move the rounds slider to the smallest number of rounds that drops an impostor’s cheating probability to 5% or below — not just any round count past that point.
1 round → cheating probability = 0.50000 (50.00%)
A zero-knowledge proof convinces a verifier that a secret exists — by making a cheater's odds of bluffing through every round vanish — while each round leaks only one masked value that, alone, carries no information about the secret at all.