Tested tool guide
Tested browser tools
Checked August 16, 2026
What RSA Algorithm Visualizer does, with a checked example
Textbook RSA runs on arithmetic small enough to hold in your head, and this tool makes every step visible. Give it two small primes p and q plus a public exponent e, and it computes the modulus n, the Euler totient (p-1)(q-1), and the private exponent d, then encrypts a message by modular exponentiation and decrypts it back, showing each multiplication and reduction. The surprise most people hit: the plaintext must be smaller than n. With n = 33 you can only encrypt values 0 to 32; a larger message reduces to its remainder before exponentiation, so a message of 40 decrypts back to 7, not to 40.
Worked example
A concrete input and expected output from the current implementation.
Input
p = 3, q = 11, e = 7, message m = 5
->
Expected output
n = 3 * 11 = 33. Totient = (3-1)(11-1) = 20. d = 3, since 7 * 3 = 21 leaves remainder 1 when divided by 20. Public key (33, 7), private key (33, 3). Ciphertext: c = 5^7 mod 33 = 14 (5^2 = 25, 5^4 = 31, so 5^7 = 31 * 25 * 5 mod 33 = 14). Decrypt: c^d = 14^3 mod 33 = 5. The message comes back as 5.
d must satisfy 7 * d = 1 (mod 20), and 7 * 3 = 21 = 20 + 1, so d = 3. Raising 5 to the public exponent 7 mod 33 gives 14, and raising 14 to the private exponent 3 mod 33 returns 5, closing the key generation, encryption, decryption cycle.