5

Given a list of 2048 bit integer values in which one or few 2048 bit integer values may be product of two prime numbers and other values may be just 2048 bit odd integers numbers.

My question is - Is there a way / technique (apart from brute-force) to confirm that a given 2048 bit integer value is product of two prime numbers or not?

Is there any pattern in an integer value which is not product of two prime numbers?

User2014
  • 59
  • 2

5 Answers5

12

No, there is no known test that we can run on a 2048 bit composite number that would indicate whether it was the product of two primes, or whether it was the product of more than two primes.

About the closest we can get is a zero knowledge proof; we know how someone (who does know the factorization) can run an interactive proof with us that can demonstrate to us that there are only two prime factors (and not reveal anything else). However, that does not appear what you're asking for.

poncho
  • 154,064
  • 12
  • 239
  • 382
1

It is not possible to ensure a number is power of two primes (without effectively factoring the number). NIST has defined tests which are used in context of validating RSA public key, which you could use.


NIST recommends following tests (from NIST SP 800-89, section 5.3.3) for testing RSA public keys (which are supposedly product of two prime numbers):

  1. The length of the modulus is one of the specified values in FIPS 186-3.
  2. The value of the public exponent is in the valid range, as specified in FIPS 186-3.
  3. The modulus and the public exponent are odd numbers.
  4. The modulus is composite, but not a power of a prime
  5. The modulus has no factors smaller than 752. Testing for additional factors is allowed.

The tests 1-2 are specific to NIST specifications for RSA, however, tests 3-5 are generally useful. In your case also test 1 applies: 2048-bit was the size the question was about. Apply the tests for modulus to your large 2048-bit number. After these tests, it is (probably) proven that the number:

  • has no small factors (test 5)
  • the number is not a prime or a power of prime (test 4)

Test 4 is usually implemented using tests from FIPS 186-3 (enhanced Miller-Rabin test).

Note: in case the test 5 fails, it is still possible that the number is indeed product of two primes. (I.e. one of factors is a small prime and another is a large prime.) Such numbers are valid for "product of two primes", but are not useful in some cryptographic algorithms such as RSA.

All these tests will not prove that the value is product of two primes. Instead, a product of more primes may still pass the tests. A prime number, however, will be very unlikely to pass above tests.

These tests are convenient to implement in the sense that if you have cryptographic module which is capable of generating key for RSA, many of the tests are likely already implemented by it.


BTW, in case this is about RSA, you could be able to use some other means of public key validity checking, including e.g. TTP Key Pair Validation.

user4982
  • 5,379
  • 21
  • 33
0

If you have a quantum computer at hand then you can use
Shor's algorithm to find the prime factors in polynomial time.

0

There are priminality tests that can be executed very efficiently. They come in different flavors (AKS->for sure, Rabin-Miller->with a 1-1/2^k probability etc). They will tell you if a big number is prime or not (answer true/false), so they will not tell you whether the number is divided by two or more primes. If the question is only for two primes, then the answer is definitely not. There is no efficient algorithm (non-quantum) that can tell you by how many primes a given integer is divided.

absinthe_minded
  • 475
  • 4
  • 10
-4
  • Calculate square root of your allegedly combined number (cn)
  • lookup prime number (pn) that is closest to it
  • lookup precomputed primorial (pp) for that prime number (pn)
  • calculate greatest common divisor of (pp) and (cn)
  • If the result is 1, the number (cn) is not combined and a prime number itself

Question is only where to get primorials for such high numbers, maybe ask the NSA ;)