GCD for RSA Key Check
Enter two large integers (e.g. RSA moduli or primes) and instantly see their GCD — if it is greater than 1, they share a factor and the key is weak.
Integer A
Integer B
Quick Test Pairs
Enter two integers and click Compute GCD
Supports arbitrarily large numbers (BigInt)
GCD(A, B)
Digits in A
Digits in B
Steps
Euclidean Algorithm Steps
Coprime means GCD = 1. In RSA, two moduli being coprime is expected — they should not share any prime factor. If GCD > 1, one prime factor is exposed and both keys are broken.
Copied!
Summary
Enter two large integers (e.g. RSA moduli or primes) and instantly see their GCD — if it is greater than 1, they share a factor and the key is weak.
How it works
- Enter both integers A and B in the input fields.
- Click "Compute GCD" to run the Euclidean algorithm using JavaScript BigInt.
- The result panel shows GCD(A, B), the number of algorithm steps, and a security verdict.
- If GCD = 1, the numbers are coprime — no shared prime factor.
- If GCD > 1, the shared factor is displayed along with a warning.
Use cases
- Audit a batch of RSA public keys for shared prime factors (ROCA / batch GCD attack).
- Verify that two RSA moduli generated on the same weak RNG are not related.
- Educational demo of the Euclidean algorithm on cryptographic-sized numbers.
- Quick sanity-check before deploying an RSA key pair to production.
- Detect entropy failures in embedded devices that reuse prime factors.
- Check whether p and q derived from the same seed share a GCD > 1.
Frequently Asked Questions
Last updated: 2026-07-01 ·
Reviewed by Nham Vu