Rsa Encryption Calculator

Compute RSA encryption parameters: generate public/private keys, encrypt/decrypt messages using prime numbers p and q.

isCalculator Editorial Team Published by:
Reviewed by: Review Board
Last Updated:

Was this calculator helpful?

How to use this tool?

This RSA Encryption Calculator computes public/private keys and optionally encrypts/decrypts a numeric message.

  1. Enter two distinct prime numbers for p and q (e.g., 61 and 53).
  2. Set the public exponent e (default 65537). It must be coprime to φ(n) and between 2 and φ(n)-1.
  3. Optionally enter a message m as a whole number between 0 and n-1. Leave blank to only generate keys.
  4. Click "Calculate" to see results and step-by-step calculations.
  5. Outputs:

    • 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)

    All inputs must be integers. Use only prime numbers for p and q, and ensure the message is less than n.

Previous Results

Generate Charts
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.

Quick Convert
Length Converter
0
Weight/Mass Converter
0
Area Converter
0
Volume Converter
0
Speed Converter
0
Temperature Converter
0
Pressure Converter
0
Energy Converter
0
Power Converter
0
Force Converter
0
Time Converter
0
Angle Converter
0
Fuel Consumption Converter
0
Data Storage Converter
0
Base Numbers Converter
0
Dry Volume Converter
0
Currency Converter
0
Text Case Converter
0