Zero Knowlege Proof of Compositeness

Internet melts down over 'card trick math'—is this proof or just a test

TLDR: A post claims you can prove a big number isn’t prime without revealing its factors, using a card analogy and Fermat’s test. Comments clap back: the demo feels like a magic trick, digital signatures aren’t ZKPs, and this reads more like a local test than a true secret‑keeping proof.

A blog post tried to explain zero-knowledge proofs (ZKPs—proofs that show something is true without revealing the secret) with a playing-card trick and a giant number, claiming you can prove a number isn’t prime without revealing its factors. Cue the comment section going full courtroom drama. Skeptics pounced, saying the card example feels like magician smoke and mirrors. “How do we know the deck isn’t rigged?” asked one, turning the thread into a showdown between deck-checkers and card magicians.

The math bit used Fermat’s idea: raise a small number to a big power and check the remainder; if it’s not 1, your big number is composite. Helpful folks dropped tiny demos (shoutout to the “6 and 5” crowd), but the hottest take was whether this is really a ZKP. One commenter argued that a true ZKP needs a prover who actually knows the secret, not just a test you can run yourself. Another blasted the claim that digital signatures are ZKPs: copy-paste a signature and it looks like anyone knows the key—no secret revealed there. The thread turned into a debate over definitions, practicality, and vibes, with readers linking to zero‑knowledge proofs while posting memes like “bn−1 ≠ 1, but my patience ≠ ∞.”

Key Points

  • ZKPs prove statements without revealing extra information; examples include digital signatures and a playing-card scenario.
  • Fermat’s little theorem enables a compositeness test: if b^(n−1) ≠ 1 (mod n), then n is composite.
  • A large number n is shown composite by computing pow(2, n−1, n) in Python, yielding a result not equal to 1.
  • Fermat’s test cannot prove primality; it can only suggest probable primality and fails on Carmichael numbers.
  • ZKPs have negligible error probabilities and are designed for efficient verification; they have applications in cryptocurrency accounting.

Hottest takes

"This is just a primality test that can be performed locally" — tooltower
"I don't think a digital signature is a Zero-Knowledge Proof" — jstanley
"People are often exposed to trickery regarding playing cards" — jeremysalwen
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.