Calculator Inputs
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 |
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
- Pick Secure for real keys, or Educational to see the math.
- For secure keys, choose a bit size and exponent. Add a passphrase if you will store the private key.
- For educational keys, enter two small primes and a valid e.
- Click Generate. Results appear above the form.
- 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.