57

Quanta Magazine reports:

Two mathematicians have uncovered a simple, previously unnoticed property of prime numbers [...]. Prime numbers, it seems, have decided preferences about the final digits of the primes that immediately follow them.

Among the first billion prime numbers, for instance, a prime ending in 9 is almost 65 percent more likely to be followed by a prime ending in 1 than another prime ending in 9.

Do these insights make breaking keys based on primes more mathematically plausible in a shorter amount of time?

user
  • 513
  • 4
  • 7

3 Answers3

43

No, because these new insights only affect the discovery and patterns regarding finding new prime numbers. In order to break existing encryption algorithms that rely on primes such as RSA, you'd have to have a breakthrough in discovering how to factor integers into primes.

Primes are used in encryption keys as the basis of their generation: two large primes are multiplied together to form a very large number. The difficulty of factoring this large number to discover its prime roots is essentially the protection the cryptosystem offers. Since you already have the primes (the private key, essentially), you need not factor the number and can immediately decrypt it.

Since the new discovery only relates to patterns prime numbers take which may assist a search for even larger prime numbers than already known, and not in factoring multiples of prime numbers, this discovery should be inconsequential for cryptography.

Herringbone Cat
  • 426
  • 4
  • 4
21

No, because that "discovery" produces nothing of value.

They examined prime numbers up to one billion. In that range, about one in eight numbers ending in 1, 3, 7 or 9 are prime numbers, and which ones are primes is quite unpredictable.

Now if a prime p ends in a digit 9, then the numbers p + 2, p + 4, p + 8, p + 10, p + 12 etc. each have about a one in 8 chance to be primes (p + 6, p + 16 etc. cannot be primes because they end in a five).

However, p + 2 has a one-in-eight chance of being the next prime. p + 4 has a chance of (7/8) * 1/8 of being the next prime, because it cannot be the next prime if p + 2 is prime. p + 8 has a chance of (7/8)^2 * 1/8 of being the next prime, because it cannot be the next prime if p + 2 or p + 4 is, and so on.

So their claim may very well be true, but it is a really trivial and obvious result and of no consequence whatsoever. They also published it 16 days too early.

Take a deck of cards and shuffle it properly. Take the first card, then find the next card of the same color. It is most likely that the second card is the first card of the same color, less likely that the third one is the first card of the same color, and so on.

Now throw a coin, then throw another coin repeatedly until that coin comes with the same face up. 50% chance that it happens at the first throw, 25% chance that it happens at the second throw, 12.5% that it happens on the third throw, etc.

(Now what I said about the primes is not quite precise, because there is an obvious relation between consecutive numbers possible being prime. If p is prime, then p is not divisible by 3, which makes p + 6 also not divisible by 3 and therefore more likely to be prime, while p + 2 and p + 4 have a higher chance than a random number to be divisible by 3, and therefore less likely to be primes. Similar for divisibility by 7; if p is prime then p + 14, p + 28, p + 42 are all not divisible by 7 and therefore slightly more likely to be primes, while the other numbers are not. But that is also long known

And this bit should calm down those who figured that the article went beyond what things would like for random numbers. You can look it all up if you search for "Hardy, Littlewood", and correlations between primality of nearby numbers were known in detail in the mid of the 20th century).

PS. You absolutely, absolutely don't use nearby primes for RSA for example, because a product pq of two primes can be trivially factored if the difference between p and q is not large compared to the square root of p or q.

Shog9
  • 101
  • 5
gnasher729
  • 1,350
  • 7
  • 9
6

Not really - the frequency of primes doesn't change, and it's not a certainty that any given prime isn't followed by another with the same final digit. You'd still have to check all possible primes in the appropriate range, but you could slightly optimise the order of checks. However, given the number of digits in primes used in key based ciphers, there are a lot of potential numbers to look at.

It's a slight improvement, but not enough of one to break the algorithms.

However, it could lead to renewed mathematical interest in large primes, which might produce some more "useful" results in terms of predicting primes.

Matthew
  • 201
  • 3
  • 8