Miller–Rabin Primality Test
Interactive 3D simulator for the Miller-Rabin primality test: watch modular squaring sequences spiral around a residue ring, pick witnesses, and see why a few random rounds make the false-positive rate vanishingly small.
Every RSA key pair starts with two large primes, and finding them at scale means testing thousands of random odd numbers with a probabilistic algorithm rather than trial division. This simulator runs the real Miller–Rabin test: pick an n, write n − 1 = 2r·d, and watch the modular squaring chain for each random base spiral around a 3D ring representing arithmetic mod n. A round that lands on ±1 at the right step passes as "probably prime"; a round that squares into a nontrivial root of 1 exposes n as composite outright, and the base becomes a witness. Run enough independent rounds and the false-positive probability collapses below 4−k — the same guarantee that lets real cryptographic libraries trust a "probable prime" enough to build a key from it.
Watch the real Miller-Rabin probabilistic primality test in 3D: modular squaring chains spiral around a residue ring, witnesses expose composite numbers, and independent rounds drive the false-positive rate below 4^-k.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install