๐Ÿ” RSA Encryption Demo

An educational demo using small numbers. Not suitable for real security.

n = p ร— q33
ฯ†(n) = (p-1)(q-1)20
Private exponent (d)3
Ciphertext (c = m^e mod n)29
Decrypted (c^d mod n)2
โœ“ The decrypted result matches the original message

Enter small primes p and q, a public exponent e, and a message (a number) to see how RSA generates keys (n, ฯ†(n), private exponent d), encrypts, and decrypts โ€” step by step.

How to use

  1. Enter two distinct primes p and q.
  2. Enter a public exponent e (must be coprime to ฯ†(n)).
  3. Enter the message to encrypt (an integer less than n).
  4. n, ฯ†(n), the private exponent d, the ciphertext, and the decrypted result are calculated automatically.

FAQ

What is RSA encryption?

A widely used public-key cryptography algorithm whose security rests on the difficulty of factoring large numbers. It underlies much of HTTPS and other encrypted communication.

Why canโ€™t small numbers be used for real security?

A product (n) of small primes can be factored trivially by brute force or known algorithms. Real RSA uses primes hundreds of digits long.

Can e be any value?

No โ€” e must be coprime to ฯ†(n) (their greatest common divisor must be 1). If it isnโ€™t, no valid private exponent d exists.