Interactive walkthrough of RSA public-key encryption and decryption
This tool walks through the mechanics of RSA encryption step by step. It uses small numbers
for clarity — no provisions are made for high-precision arithmetic or efficient handling of
large values, so keep your choices modest.
Summary of Steps
1
Generate N and r
Pick two primes p and q. N = p×q becomes the modulus; r = (p−1)(q−1) is used to find valid key pairs.
2
Find a factorable K
From the list of candidates equal to 1 mod r, pick one (K) that factors into two usable numbers.
3
Choose e and d
Split K's factors into e and d, both relatively prime to r, so that e×d ≡ 1 (mod r).
4
Encrypt / decrypt
Use e and N to encrypt a numeric message, then d and N to decrypt the ciphertext back to the original.
ASCII Reference Table
Printable characters 32–126 with their decimal codes. Use these values when converting a message character by character, or with the Message → Numeric converter above.