cyberchef_rsa_attack
Test an RSA public key for breakable generation flaws—close primes, shared factors, small private exponent, smooth p-1, and more—then recover the private key and decrypt supplied ciphertext when an attack succeeds.
Instructions
Test an RSA public key for the generation flaws that make it breakable, and recover the private key when one applies: trial division, Fermat (primes too close), shared factors between two moduli, Wiener (private exponent too small), Pollard's rho (one prime too short), Pollard's p-1 (a prime whose predecessor is smooth) and unpadded small-e. None threatens a correctly generated key — a sound 2048-bit modulus defeats all of them — so a negative result is evidence the key is not weak in these specific ways, and not that it is strong. Decrypts a supplied ciphertext when the key is recovered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attacks | No | Which attacks to try. All of them by default, which costs up to 35 seconds of wall clock on a key none of them breaks — the four time-budgeted searches run sequentially, and a soundly generated modulus is exactly the case that reaches all four. Name the ones you want if your client has a shorter per-call timeout. `small_factors` is trial division and costs nothing; `pollard_rho` finds a short prime; `pollard_pm1` finds a prime whose predecessor is smooth. | |
| modulus | Yes | The modulus n, as decimal or hex. | |
| pm1_bound | No | Smoothness bound for pollard_pm1. Higher finds primes whose p-1 has a larger factor, and takes proportionally longer. | |
| ciphertext | No | Optional. Decrypted if the private key is recovered. | |
| other_modulus | No | A second modulus, to test for a shared prime factor. Breaks both keys if one exists. | |
| public_exponent | No | The public exponent e. | 65537 |
| fermat_iterations | No | Bound on the Fermat search. Higher finds primes that are further apart, and takes longer. |