About this site
Secrets from Primes is part of a public library of interactive explanations. It is free, has no ads and needs no sign-up.
The idea§
The site follows one thread: public-key cryptography is clock arithmetic with enormous primes. The chapters on prime numbers, modular arithmetic and public-key cryptography each add one piece, and the tools (prime checker, prime list, modular calculator, RSA and Diffie–Hellman calculators) answer the questions people most often arrive with.
How the mathematics is checked§
All arithmetic is exact: whole numbers of unlimited size, never floating point, except for the prime number theorem's approximations, which are marked ≈. Every tool states its range and refuses inputs outside it rather than guess. The primality test is a proof for every number it accepts (up to 1024 − 1), and factorizations that run out of their budget say so. The engine is tested by its author against published tables and worked examples, and by an independent test suite written from the published mathematics without reading the code. Every claim on the site is recorded in a claims register with its source and checked by a reviewer who did not write it. What each figure simplifies is stated next to the figure.
Found an error?§
Please open an issue on the source repository. Corrections are welcome and are credited.
Reuse§
Text and figures are licensed CC BY 4.0; code is MIT. Teachers may use and adapt any of it, with attribution. Every figure has a Share button that copies a link to its exact state, for projecting in class.