For distinct prime numbers , compute the Euler totient functionThe RSA cryptosystem private exponent is a modular multiplicative inverse of the public exponent:Use the extended Euclidean algorithm on and . It produces integers with , and reducing modulo gives a suitable positive . Searching through possible exponents is unnecessary.
To see correctness even for a plaintext sharing a factor with , write . Modulo , either or Fermat's little theorem gives ; the same holds modulo . The Chinese remainder theorem then gives . One may alternatively invert modulo , but inversion modulo is sufficient for this paper.
The essential exponent condition isOtherwise the modular multiplicative inverse defining does not exist. For large prime numbers greater than three, this is equivalent toIf, for example, , the multiplicative group modulo has order divisible by three, and cubing is not a bijection; distinct plaintexts can have the same ciphertext. Unique decryption of all messages would then be impossible.
The prime numbers must also be distinct for the displayed totient formula, and selected sufficiently large and independently that integer factorization of is infeasible. A small factor, equal factors, or an exceptionally small difference between and gives an avoidable factorisation weakness. These size and generation conditions address security; the congruence condition addresses invertibility of cubing.
Articles by others on the same topic
There are currently no matching articles.