Ordinary arithmetic has square roots: , . But in modular arithmetic — the world of clocks and remainders — the question "what is the square root of modulo ?" is surprisingly subtle.
We say is a square root of mod if . For example, , so 6 is a square root of 2 mod 17. Not every number has such a root; those that do are called quadratic residues.
The naive approach — try every remainder from 0 to — works but takes time, which is hopeless for the primes used in modern cryptography (hundreds of digits long). Cipolla's algorithm, published by Michele Cipolla in 1907, finds the square root in steps by a beautiful detour: it temporarily steps outside ordinary integers mod and into a quadratic field extension — a mathematical space with an "impossible" number whose square is not a residue.
That detour is the trick. Once you understand it, you see a pattern that reappears throughout number theory, algebra, and the algorithms that secure every HTTPS connection you make.
Comments
Loading comments...