Loading
Preparing the page...
Loading
Preparing the page...
Explore RSA public-key cryptography with small primes. See how key generation, encryption, and decryption work step-by-step in this educational demonstration.
Download results as PDF, CSV, or JSON.
Run the tool to enable exports.
RSA is an asymmetric encryption algorithm using two related keys:
To encrypt a message m, compute: c = me mod n
Anyone with the public key (e, n) can encrypt messages, but only the private key holder can decrypt them.
To decrypt ciphertext c, compute: m = cd mod n
The private key (d, n) reverses the encryption, recovering the original message. This works due to Euler's theorem.
RSA security relies on the difficulty of factoring large numbers: