Rsa Encryption Calculator
Compute RSA encryption parameters: generate public/private keys, encrypt/decrypt messages using prime numbers p and q.
Was this calculator helpful?
How to use this tool?
This RSA Encryption Calculator computes public/private keys and optionally encrypts/decrypts a numeric message.
- Enter two distinct prime numbers for p and q (e.g., 61 and 53).
- Set the public exponent e (default 65537). It must be coprime to φ(n) and between 2 and φ(n)-1.
- Optionally enter a message m as a whole number between 0 and n-1. Leave blank to only generate keys.
- Click "Calculate" to see results and step-by-step calculations.
- Public key (n, e) – n = p × q
- Private key d – modular inverse of e modulo φ(n)
- If a message was entered: ciphertext (encrypted) and decrypted value (should equal original message)
Outputs:
All inputs must be integers. Use only prime numbers for p and q, and ensure the message is less than n.
Previous Results
| Result | Inputs | Date |
|---|
Frequently Asked Questions
RSA is an asymmetric encryption algorithm that uses a public key for encryption and a private key for decryption. It relies on the difficulty of factoring the product of two large prime numbers.
p and q must be distinct prime numbers. For security, they should be large (e.g., 1024 bits), but for this calculator you can use small primes for demonstration.
e must be coprime to φ(n) and typically 65537 is used. It is part of the public key along with n.
The message m must be less than n. If your message is larger, it must be split into blocks.