An integer is prime if its only positive divisors are and .
Examples
Example 29.18 (Application to cryptography)
Fermat’s theorem makes exponentiation modulo reversible when the exponents are chosen suitably — the heart of the RSA cryptosystem. With large primes and , one publishes and an exponent ; encryption is . Decrypting requires an exponent with , which only someone knowing and can compute — and recovering from means factoring a number hundreds of digits long, which no known algorithm does in reasonable time.