⌂ Home ν•œκ΅­μ–΄
πŸ” KeyGuard Β· RSA

KeyGuard: free RSA public key weakness check

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.

Short answer

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).

65 / 65
weak keys found, 0 false alarms
1.4 ms
to recover a 2048-bit key with close primes
12 / 12
ROCA-structured keys flagged, 0 of 40 ordinary keys
0
network requests after the page loads

The problem is not RSA. It is how some keys are born

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.

StudyFinding
Mining Your Ps and Qs, USENIX Security 2012Private keys obtained for about 0.50% of TLS hosts because their public keys shared factors
Keyfactor, 2019249,553 distinct keys broken, about 1 in 172 of the RSA certificates collected from the internet
ROCA, CVE-2017-15361Keys from a flawed chip library carry a mathematical fingerprint

What KeyGuard checks

CheckWhat goes wrongHow it is found
Shared primesTwo devices use the same prime, so both private keys are recoverablePairwise GCD over the keys you paste together
Close primesp and q are nearly equal, so N factors almost at onceFermat factorization with bounded steps
ROCA fingerprintKeys from the flawed library follow a fixed patternSubgroup test over 38 odd primes
Length and exponentShort keys or an abnormal public exponentDirect inspection

Two devices, one prime, two open keys

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.

g = gcd(N1, N2) # both values are public if g not in (1, N1, N2): p, q1, q2 = g, N1 // g, N2 // g # both keys are now factored
μ†Œμˆ˜λ₯Ό κ³΅μœ ν•œ 2048λΉ„νŠΈ RSA ν‚€ 두 κ°œκ°€ ν’€λ¦° ν™”λ©΄ / Two 2048-bit RSA keys broken by a shared prime
Live screen. The private key value is never shown.

Why combine the checks

DetectorWeak keys foundFalse alarms on 80 healthy keysTime for 145 keys
KeyGuard65 / 65 (100%)073 ms
Size and exponent25 / 65 (38.5%)0< 1 ms
GCD only20 / 65 (30.8%)09 ms
Fermat only20 / 65 (30.8%)095 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.

Check your own devices in three steps

1. Get the public key
Take the certificate, public key file or SSH public key of a device you are authorized to test.
2. Paste them together
Put several devices in at once so that a shared prime can be found.
3. Read the result
Each key gets Safe, Caution or Danger with the reason.
openssl s_client -connect 192.0.2.10:443 </dev/null 2>/dev/null | openssl x509 cat ~/.ssh/id_rsa.pub

FAQ

What is KeyGuard?

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.

Can a 2048-bit RSA key be broken?

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.

Is my public key sent to a server?

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.

Which formats can I paste?

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.

Why should I paste keys from several devices together?

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.

How is ROCA (CVE-2017-15361) detected?

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.

What should I do if a key is marked Danger?

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.

What does it cost and what is the license?

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.

vidraft.net ν•œκ΅­μ–΄ KeyGuard app Hugging Face article Insights Press