Take two whole numbers â say 48 and 18 â and ask for their greatest common divisor: the largest number that divides both with no remainder. The obvious method is to list every divisor of each and compare. For small numbers that works; for the 600-digit numbers inside an RSA key it is utterly hopeless.
Around 300 BC, in Book VII of his Elements, Euclid wrote down a far better recipe. It is, by common reckoning, the oldest algorithm still in everyday use â and remarkably, it is also one of the fastest things we know how to compute.
The whole idea fits in one sentence: the common divisors of two numbers are the same as the common divisors of the smaller one and the remainder of dividing the larger by it. Keep taking remainders and the numbers shrink astonishingly fast until one of them hits zero. The other is your answer.
Comments
Loading comments...