Two 2048-bit RSA keys that share a prime open with one GCD. Long keys are not enough. Check how they were born, right in your browser.
KeyGuard is a free tool that finds four families of structural defects in RSA public keys, inside your browser. On its built-in benchmark of 145 keys it found 65 of 65 weak keys with 0 false alarms on 80 healthy keys (2026-11-25).
An RSA public key is the product of two secret primes, N = p Γ q. Routers and cameras often create a key right after first boot, when there is little randomness to draw from. Two different devices can land on the same prime, and key length no longer helps.
| Study | Finding |
|---|---|
| Mining Your Ps and Qs, USENIX Security 2012 | Private keys obtained for about 0.50% of TLS hosts because their public keys shared factors |
| Keyfactor, 2019 | 249,553 distinct keys broken, about 1 in 172 of the RSA certificates collected from the internet |
| ROCA, CVE-2017-15361 | Keys from a flawed chip library carry a mathematical fingerprint |
| Check | What goes wrong | How it is found |
|---|---|---|
| Shared primes | Two devices use the same prime, so both private keys are recoverable | Pairwise GCD over the keys you paste together |
| Close primes | p and q are nearly equal, so N factors almost at once | Fermat factorization with bounded steps |
| ROCA fingerprint | Keys from the flawed library follow a fixed pattern | Subgroup test over 38 odd primes |
| Length and exponent | Short keys or an abnormal public exponent | Direct inspection |
Press the shared prime sample. Two 2048-bit public keys go in, and one GCD reveals the 1024-bit prime they have in common. No supercomputer and no quantum computer is needed.

| Detector | Weak keys found | False alarms on 80 healthy keys | Time for 145 keys |
|---|---|---|---|
| KeyGuard | 65 / 65 (100%) | 0 | 73 ms |
| Size and exponent | 25 / 65 (38.5%) | 0 | < 1 ms |
| GCD only | 20 / 65 (30.8%) | 0 | 9 ms |
| Fermat only | 20 / 65 (30.8%) | 0 | 95 ms |
A batch-GCD engine from the same family processed 220,713 keys in 122.5 seconds: 220,707 real RSA public keys from Certificate Transparency logs plus 6 planted weak keys. It found 6 of 6 planted keys with 0 false alarms on the real ones.
KeyGuard is a free self-check for RSA public keys from VIDRAFT. It finds keys that share a prime, keys whose primes are too close, keys with the ROCA fingerprint, and keys with a dangerous length or exponent, all inside your browser.
A 2048-bit key with well chosen primes is out of reach for today's factoring methods. If two devices share one prime, a single greatest common divisor opens both keys, and if the two primes are too close, the KeyGuard sample falls in 1.4 ms.
No. Every check runs in JavaScript in your browser. We recorded the network during the checks and saw 0 requests after the page loaded. Private keys are not accepted.
BEGIN PUBLIC KEY, BEGIN RSA PUBLIC KEY, BEGIN CERTIFICATE, an ssh-rsa line, a hex modulus, a decimal N, or N:e. All 18 tested combinations across 2048, 3072 and 4096 bits were read correctly.
A shared prime shows up only when keys are compared with each other. One at a time, each key looks healthy. Paste the public keys of your routers, cameras, printers and VPN gateways together.
Keys from the flawed chip library follow a fixed pattern modulo small primes. KeyGuard tests this pattern over 38 odd primes. In our own test it flagged 12 of 12 ROCA-structured keys and 0 of 40 ordinary keys.
Retire the key, update the device firmware and generate a new key. If the weak key belongs to someone else's product, report it privately to the vendor or your national CERT.
It is free with no sign-in, released under MIT, and available in English, Korean and Chinese.
Use it only on keys of devices you own or are authorized to test.