How to calculate
Multiply the two distinct odd primes for n. Compute the inverse of the public exponent modulo the selected totient and use modular exponentiation to encrypt or decrypt.
Worked example
Use Operation Encrypt a message integer · Prime p 61 · Prime q 53 · Public exponent e 17 · Message or ciphertext integer 65 · Compute private exponent modulo Euler totient φ(n). The result is 2790.
Input and result notes
This demonstration uses small primes and raw modular arithmetic. Enter sample integers from zero through n − 1.
RFC 8017 RSA arithmetic primitives