RSA Encryption Calculator

Work through RSA with small primes: n = pq, φ(n), the private key d, then encrypt and decrypt a numeric message.

Results

Enter your details and click Calculate to see your results.
About This Calculator

Choose primes p, q; n = pq; φ = (p − 1)(q − 1); pick e coprime to φ; d = e⁻¹ mod φ. Encrypt c = mᵉ mod n; decrypt m = cᵈ mod n.

Example

Example: p = 61, q = 53, e = 17 → d = 2753; message 65 encrypts to 2790.

Assumptions

Educational sizes — real RSA uses 2048-bit primes and padding.

Frequently Asked Questions

Why is RSA secure?

Finding d needs φ(n), which needs factoring n — infeasible for huge n.

Related Calculators

About the Author

Imran Hossain
Imran Hossain

Professional SEO, Digital Marketer Specialist

I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist

View full profile