← Back

RSA Key Generation

Understanding Public Key Cryptography Through Interactive Visualization

1 Choose Primes

-
-

2 Compute n = p × q

-

This is the modulus used in both public and private keys

3 Compute φ(n)

-

φ(n) = (p-1)(q-1)

4 Choose e

-

1 < e < φ(n), gcd(e, φ(n)) = 1

5 Compute d

-

d ≡ e⁻¹ (mod φ(n))

🔓 Public Key

Generate keys first

Used to encrypt messages

🔐 Private Key

Generate keys first

Used to decrypt messages

Test Encryption/Decryption

Results will appear here...