RSA Demonstrator
Educational RSA key generation, encryption, and decryption
n = p·q · φ(n) = (p−1)(q−1) · e·d ≡ 1 (mod φ(n)) · c = mᵉ mod n · m = cᵈ mod n
Key pair
Public key (e, n)
(17, 3.233)
Private key (d, n)
(2.753, 3.233)
Modulus n = p · q
3.233
Totient φ(n) = (p − 1)(q − 1)
3.120
Private exponent d ≡ e⁻¹ (mod φ(n))
2.753
Ciphertext c = mᵉ mod n
2.790
Decrypted cᵈ mod n
65
Round-trip check
✓ Decryption recovered the original message
Über diesen Rechner
The RSA Demonstrator is an educational tool that walks through the RSA public-key cryptosystem from end to end. Pick two primes p and q; it derives the modulus n = p·q, Euler's totient φ(n) = (p−1)(q−1), a public exponent e coprime to φ(n), and the matching private exponent d = e⁻¹ mod φ(n). It then encrypts a message as c = mᵉ mod n and decrypts it back as cᵈ mod n, showing the full key pair and the round-trip. All arithmetic is exact. Useful for learning how public-key encryption, modular exponentiation, and modular inverses fit together.
Häufige Beispiele
- p=61, q=53, e=17 → n=3233, φ=3120, d=2753; encrypt 65 → 2790, decrypt 2790 → 65
- p=11, q=13, e=7 → n=143, φ=120, d=103; encrypt 9 → 48, decrypt 48 → 9
- p=17, q=23, e=3 → n=391, φ=352, d=235; encrypt 100 → 213, decrypt 213 → 100
- p=61, q=53, e=15 → e shares the factors 3 and 5 with φ=3120, so no private key exists
- p=4 is not prime, so RSA cannot start — the modulus would not be a product of two primes