# Prime factorization of 700 decimal digits number

I'm a newbie to encryption. If I create a number 'n' as a product of two prime numbers 'p' and 'q' with the following specifications:

'p' is a fully random prime with 300 decimal digits in length. 'q' is a fully random prime with 400 decimal digits in length.

My question is: If I make 'n' public, will anyone be able to get 'p' and 'q' within a month? Tanks in advance!

• That's about 2300 bits modulus length, which is what is widely used (unbroken) on the internet. – SEJPM Jun 25 '16 at 11:54
• Thank you for your quick answer. So what would be the minimum number of decimal digits nowadays to get 'p' and 'q' from 'n'? – Jan Lonner Jun 25 '16 at 11:58
• @JanLonner: this answer could help. The number of bits (used in cryptography) is $\log_2(10)\approx3.322$ times the number of decimal digits. – fgrieu Jun 25 '16 at 12:05
• someone could guess it on the first try, but that's exceedingly unlikely – dandavis Jun 26 '16 at 9:10

No an attacker will not be able to factor your $n$ (e.g. break it).
Your $n$ is of size 700 decimal digits which is $\frac{700}{\log_{10}(2)}\approx2325$ bits. Now 2048-bit moduli is the most widespread size used on the internet and hasn't seen a failure yet (without exploiting bad random number generators), so you are secure with that modulus size.
You have chosen 400 digits and 300 digits. While this is safe in this instance, this is unusual to do, because too much unbalancedness can help the attacker as he can apply attacks that find small factors first (by trial division or ECM). The standard way of approaching this is to generate two equally large primes (in terms of digits) and ensuring that $|p-q|>2^{k/3}$ (where k is your modulus bitlength), which will hold anyways with overwhelming probability if you choose both primes independently at random.