RSA Key Generator Calculator

Generate strong RSA pairs or learn the math. See fingerprints, parameters, and export files easily. Use safe defaults, then tweak settings for projects today.

Calculator Inputs

Choose secure keys or view the RSA math steps.
2048+ is common for general use.
Use an odd value. 65537 is widely used.
Leave blank for an unencrypted private key.
Used only when a passphrase is set.
Exported format can vary by tooling.
Try 61, 101, 211, or 9973.
Must differ from p.
Ensure gcd(e, phi(n)) = 1.
Results will appear above this form.

Example Data Table

Scenario Inputs Outputs (Example)
Secure Key Pair Bits: 2048, e: 65537, Passphrase: blank Public/Private PEM + SHA-256 fingerprint
Secure Protected Key Bits: 3072, e: 65537, Passphrase: set Encrypted private PEM + public PEM
Educational RSA p: 61, q: 53, e: 17 n: 3233, phi: 3120, d: 2753
Educational numbers are small by design to show the arithmetic.

Formula Used

RSA builds keys from two primes p and q. The modulus is n = p × q. Euler's totient is φ(n) = (p − 1)(q − 1).

Choose a public exponent e such that gcd(e, φ(n)) = 1. The private exponent d is the modular inverse: d ≡ e⁻¹ (mod φ(n)).

Public key is (n, e). Private key is (n, d). In secure mode, the server generates large primes internally and exports PEM keys.

How to Use This Calculator

  1. Pick Secure for real keys, or Educational to see the math.
  2. For secure keys, choose a bit size and exponent. Add a passphrase if you will store the private key.
  3. For educational keys, enter two small primes and a valid e.
  4. Click Generate. Results appear above the form.
  5. Use Download CSV or Download PDF for reports.

FAQs

1) What does this tool generate?

It produces an RSA public and private key pair. Secure mode exports PEM keys. Educational mode outputs the integer parameters n, e, d, plus φ(n).

2) Which key size should I choose?

2048 bits is a common baseline for general use. 3072 or 4096 bits can add margin at the cost of slower operations and larger keys.

3) Why is 65537 a recommended exponent?

65537 is an odd prime that balances performance and security. It is large enough to avoid known issues from tiny exponents, while still being efficient.

4) Should I add a passphrase?

Yes, if the private key will be stored on disk or shared across systems. A passphrase reduces risk if the file is copied or leaked.

5) Is educational mode secure for real use?

No. Educational mode uses small primes so you can verify the arithmetic. Real RSA requires very large primes and careful generation methods.

6) What is the fingerprint shown in the results?

The fingerprint is a SHA-256 hash of the public key’s DER bytes. It helps you compare keys safely and detect accidental substitutions.

7) Why might generation fail on my server?

Some hosting plans disable OpenSSL functions or restrict entropy. Enable OpenSSL, update its configuration, and ensure the server has enough randomness.

Related Calculators

caesar cipher toolsha256 hash generatorrsa encryption toolpgp decrypt toolmd5 hash generatorurl decode toolwallet address validatormerkle root calculatorpgp encrypt tool

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.