RSA: Public Computation, Private Inversion
Build a modulus from two primes
In introductory RSA, choose two distinct primes and multiply them to form the modulus n. The value φ(n) is the product of one less than each prime. Choose a public exponent e that is relatively prime to φ(n), then find a private exponent d whose product with e has remainder one modulo φ(n).
Encrypt and decrypt modulo n
A message represented by an allowed integer m is encrypted by taking m to the public exponent modulo n. Decryption raises the ciphertext to the private exponent modulo n. Modular reduction may be done after intermediate multiplications, which keeps hand computations manageable without changing the final remainder.
What is public and what is secret
The public key contains n and e; the private information includes d and, in practical implementations, protection of the prime factors. Knowing the public key permits encryption and verification operations, not practical recovery of the private exponent when the modulus is generated at cryptographic scale. Classroom-sized examples illustrate arithmetic, not production security.
Check every inverse claim
To verify a proposed private exponent, multiply it by e and reduce modulo φ(n). The remainder has to be one. A candidate public exponent is valid only when its greatest common divisor with φ(n) is one; merely being smaller than φ(n) is not enough.
Let p = 5 and q = 11 in a classroom RSA example. Which proposed public exponent e is valid?
In an RSA example, φ(n) = 24 and e = 5. Which value of d is a valid private exponent?