RSA is named after Ron Rivest, Adi Shamir, and Leonard Adleman. Its central idea is that a public mathematical operation can be paired with a private operation that reverses it when the parameters are constructed correctly. In a simplified demonstration, the process starts by selecting two distinct prime numbers, usually called p and q.
Their product is the modulus n. A prime number is a positive integer greater than one with exactly two positive divisors: one and itself. Choosing distinct primes makes it possible to compute Euler's totient for their product as (p - 1)(q - 1).
Next, a public exponent e is selected so that it has no common factor greater than one with the totient. A private exponent d is then found such that multiplying e by d leaves a remainder of one when divided by the totient. The public pair (n, e) defines the basic forward operation. The private exponent d defines its mathematical inverse when used with the modulus.
A message in this model is not automatically a sentence or document. It is an integer m in the interval from zero through n - 1. The operation m^e mod n produces a ciphertext representative c. Applying c^d mod n recovers the original message representative.
The remainder operation is what keeps intermediate numbers within a manageable range when efficient algorithms are used. Every value in this explanation is a dimensionless integer. There are no meters, seconds, percentages, or decimal rounding rules involved.
If a person wants to encrypt ordinary text, a separate encoding and secure encryption scheme are necessary. Because the supplied calculator engine has not been verified, this guide does not assume specific input boxes, automatic prime checks, generated keys, or output formatting. The purpose is to explain the mathematics that an RSA modular-exponentiation demonstration is intended to illustrate.