Classical cryptography uses a shared secret key. Both sender and receiver must know the same secret information in advance.
Public-Key Cryptography
Classical cryptography uses a shared secret key. Both sender and receiver must know the same secret information in advance.
Public-key cryptography introduced a radically different idea:
- encryption uses a public key,
- decryption uses a private key.
Anyone may encrypt messages using the public key, but only the holder of the private key can decrypt them.
The RSA cryptosystem, introduced by entity[“people”,“Ron Rivest”,“American cryptographer”], entity[“people”,“Adi Shamir”,“Israeli cryptographer”], and entity[“people”,“Leonard Adleman”,“American computer scientist”], was the first widely practical public-key cryptosystem.
RSA relies fundamentally on arithmetic properties of prime numbers and modular exponentiation.
Modular Arithmetic Background
RSA operates in the ring
Arithmetic is performed modulo a composite integer
where and are large primes.
The key mathematical principle behind RSA is Euler’s theorem.
If
then
where
is Euler’s totient function.
When
with distinct primes,
This theorem makes modular inversion through exponentiation possible.
Key Generation
RSA key generation proceeds as follows.
Step 1. Choose Two Large Primes
Select large distinct primes
These primes must remain secret.
Step 2. Form the Modulus
Compute
The integer becomes part of the public key.
Step 3. Compute the Totient
Compute
This value must remain secret because knowledge of essentially reveals the factorization of .
Step 4. Choose a Public Exponent
Choose an integer
satisfying
Common choices include
Step 5. Compute the Private Exponent
Find
such that
Thus
The public key is
while the private key is
Encryption
Suppose a message is represented as an integer
Encryption computes the ciphertext
using modular exponentiation:
The sender needs only the public key.
Efficient modular exponentiation algorithms make this practical even for extremely large integers.
Decryption
The receiver computes
Substituting the encryption formula gives
Since
there exists an integer such that
Euler’s theorem then yields
$$ m^{ed}
m^{1+k\varphi(n)}
m(m^{\varphi(n)})^k \equiv m\pmod n. $$
Thus decryption recovers the original message.
Correctness of RSA
The correctness of RSA depends fundamentally on modular arithmetic and Euler’s theorem.
The system works because exponentiation by and exponentiation by are inverse operations modulo .
The algebraic structure of
makes this inversion possible.
Example with Small Numbers
Real RSA systems use enormous primes, but a small example illustrates the mechanism.
Choose:
Then
and
Choose
Compute satisfying
One obtains
Suppose the message is
Encryption gives
Decryption computes
The original message is recovered.
Real systems use integers hundreds or thousands of bits long.
Security of RSA
RSA security depends primarily on the difficulty of factoring large integers.
If an attacker factors
then:
- becomes known,
- the private exponent can be computed.
Thus breaking RSA reduces essentially to integer factorization.
No efficient classical algorithm for factoring large RSA moduli is currently known.
Padding Schemes
Raw RSA encryption is insecure.
Deterministic encryption leaks structural information and is vulnerable to chosen-message attacks.
Practical RSA therefore uses padding schemes such as:
- OAEP,
- PKCS standards,
- probabilistic encodings.
Padding introduces randomness and prevents many attacks.
Modern cryptographic security depends critically on correct padding.
Digital Signatures
RSA also supports digital signatures.
Instead of encrypting with the public key, one signs with the private key:
Verification uses the public exponent:
This proves that the signer possessed the private key.
Digital signatures are fundamental in secure communication and authentication systems.
Chinese Remainder Optimization
Decryption can be accelerated using the Chinese remainder theorem.
Instead of computing modulo , one computes separately modulo:
This substantially speeds up modular exponentiation.
Most practical RSA implementations use CRT optimization.
Attacks on RSA
Many attacks target poorly implemented RSA systems.
Examples include:
| Attack Type | Idea |
|---|---|
| Factoring attack | Factor |
| Timing attack | Measure execution time |
| Padding oracle | Exploit padding structure |
| Small exponent attack | Abuse weak parameter choices |
| Side-channel attack | Use physical leakage |
Thus practical security depends on careful implementation as well as theoretical mathematics.
Quantum Threat
RSA is vulnerable to quantum algorithms.
Shor’s algorithm can factor integers in polynomial time on a sufficiently powerful quantum computer.
If large fault-tolerant quantum computers become practical, RSA would become insecure.
This motivates the development of post-quantum cryptography.
Practical Importance
RSA became one of the foundational systems of internet security.
Applications include:
- HTTPS,
- digital certificates,
- email encryption,
- secure authentication,
- software signing.
Although newer systems such as elliptic curve cryptography often provide better efficiency, RSA remains historically and practically significant.
Conceptual Importance
RSA demonstrates how deep number theory can produce practical technology.
The system combines:
- prime numbers,
- modular arithmetic,
- Euler’s theorem,
- fast exponentiation,
- computational complexity.
Its security relies not on secrecy of algorithms but on the presumed computational hardness of factorization.
RSA therefore represents one of the clearest and most influential connections between pure mathematics and modern digital infrastructure.