Calculator Inputs
Enter p, q, and e to derive d automatically. Or leave those blank and provide n and d directly.
Example Data Table
| p | q | e | Ciphertext | Expected Plaintext Integer | ASCII |
|---|---|---|---|---|---|
| 61 | 53 | 17 | 2790 | 65 | A |
| 61 | 53 | 17 | 524 | 66 | B |
| 61 | 53 | 17 | 641 | 67 | C |
Formula Used
n = p × q φ(n) = (p - 1) × (q - 1) d ≡ e⁻¹ mod φ(n) m = cᵈ mod n
Here, c is a ciphertext block, m is the recovered plaintext block, n is the modulus, and d is the private exponent.
When multiple ciphertext blocks are entered, the tool applies the same modular exponent rule to every block and then builds a simple ASCII preview where possible.
How to Use This Calculator
- Enter p, q, and e when you want the tool to derive n, φ(n), and d automatically.
- Leave those three fields blank if you already know the private key values n and d.
- Type one ciphertext block or a block list separated by commas, spaces, semicolons, or line breaks.
- Press the submit button to show the result above the form, directly below the header.
- Review plaintext integers, ASCII preview, derived key values, and validation notes.
- Use the export buttons after calculation to save the table as CSV or PDF.
FAQs
1. What does this tool decrypt?
It decrypts RSA ciphertext blocks using a private exponent. You can provide the private key directly or derive it from classroom-style prime inputs and a public exponent.
2. Why are p and q optional?
They are optional because some exercises already provide n and d. When p, q, and e are entered, the tool computes φ(n) and the modular inverse automatically.
3. Can I enter multiple ciphertext values?
Yes. Enter blocks separated by commas, spaces, semicolons, or line breaks. The result table will show decrypted integers and an ASCII label for each block.
4. Why must every ciphertext block be smaller than n?
RSA operates on residues modulo n. A block equal to or larger than n is outside the expected range and usually indicates invalid formatting or an incorrect parameter set.
5. Does this tool verify that p and q are prime?
It performs a prime check when the available math engine can do so reliably. In limited environments, the tool reports that prime verification was skipped or simplified.
6. Why might ASCII preview be unavailable?
ASCII preview works only when decrypted blocks fit standard byte values. Large numeric blocks may represent padded data, grouped text, or values outside simple character ranges.
7. Will this handle very large RSA numbers?
Yes, when GMP or BCMath is enabled on the server. Without those extensions, the native fallback is intended for smaller educational examples and validation exercises.
8. When should I export CSV or PDF?
Export after a successful run when you want a record of inputs, derived values, and block results for assignments, documentation, reviews, or teaching materials.