Has it been Pwned
ImplementationPractical impact

Fermat factorization works on real keys: printers generated p and q too close together

Hanno Bock showed that the Rambus SafeZone Basic Crypto Module generated q as the next prime after p, so p and q differed by only a few thousand and Fermat's 1643 factoring method recovered them almost instantly. Affected products included Canon imageRUNNER/imagePROGRAF and Fujifilm Apeos/DocuCentre/DocuPrint printers; a handful of vulnerable keys were found in the wild, including in TLS certificates and PGP keys.

A separate source-review date has not been recorded for this historical entry. Corrections.

Broken implementation. The underlying math is not broken by this. The failure is in code, hardware, or how the primitive is used.

Background

Fermat's method finds factors near sqrt(N) in a number of steps proportional to the gap between them, so any key generator that derives q from p by sequential search is broken regardless of key size. FIPS 186 has long required |p - q| > 2^(nlen/2 - 100) precisely to rule this out. This was the first documented case of Fermat-factorable keys in real products. Classic implementation failure, not a math weakness in RSA.

Sources

  1. announcementFermat Attack on RSAHanno Bock, fermatattack.secvuln.info
  2. cveCVE-2022-26320NIST NVD, nvd.nist.gov
  3. newsResearcher uses 379-year-old algorithm to crack crypto keys found in the wildArs Technica, arstechnica.com