Why is RSA Encryption/Decryption secure?

Let’s analyze security from different perspectives:

What Does an Outsider See?

An outsider observing an RSA-encrypted message has access to:

  • The public key: (e,n)(e,n)

  • The ciphertext: c=me mod nc = m^e\ mod\ n

To decrypt the message and retrieve m, the outsider would need the private key dd. However:

Why can't the outsider calculate dd?

To find dd, the outsider must compute the modular inverse of e mod ϕ(n)e\ mod\ ϕ(n), where ϕ(n)=(p1)(q1)ϕ(n)=(p−1)(q−1). This requires knowledge of ϕ(n)ϕ(n), which can only be calculated if it can factorize nn into pqpq

However, due to Integer Factorization Problem, it is very hard to factorize nn! hence, cannot calculate private key dd

Can Alice Learn Bob’s Private Value?

Suppose Alice is an authorized sender and knows:

  • Bob’s public key: (e,n).

  • Her own plaintext message: m.

  • The ciphertext she sent: c=me mod nc=m^e\ mod\ n

Even with this information:

Similarly, Alice cannot derive Bob’s private key dd, as she would need to factorize nn to compute ϕ(n)ϕ(n), which is very hard due to Integer Factorization Problem.