Safe and Sophie Germain primes


In number theory, a prime number p is a Sophie Germain prime if 2p + 1 is also prime. The number 2p + 1 associated with a Sophie Germain prime is called a safe prime. For example, 11 is a Sophie Germain prime and 2 × 11 + 1 = 23 is its associated safe prime. Sophie Germain primes are named after French mathematician Sophie Germain, who used them in her investigations of Fermat's Last Theorem. Sophie Germain primes and safe primes have applications in public key cryptography and primality testing. It has been conjectured that there are infinitely many Sophie Germain primes, but this remains unproven.

Individual numbers

The first few Sophie Germain primes are
Hence, the first few safe primes are
In cryptography much larger Sophie Germain primes like 1,846,389,521,368 + 11600 are required.
Two distributed computing projects, PrimeGrid and Twin Prime Search, include searches for large Sophie Germain primes. The largest known Sophie Germain primes are given in the following table.
ValueNumber of digitsTime of discoveryDiscoverer
2618163402417 × 21290000 − 1388342February 2016PrimeGrid
18543637900515 × 2666667 − 1200701April 2012Philipp Bliedung in a distributed PrimeGrid search using the programs TwinGen and LLR
183027 × 2265440 − 179911March 2010Tom Wu using LLR
648621027630345 × 2253824 − 1 and 620366307356565 × 2253824 − 176424November 2009Zoltán Járai, Gábor Farkas, Tímea Csajbók, János Kasza and Antal Járai
1068669447 × 2211088 − 163553May 2020Michael Kwok
99064503957 × 2200008 − 160220April 2016S. Urushihata
607095 × 2176311 − 153081September 2009Tom Wu
48047305725 × 2172403 − 151910January 2007David Underbakke using TwinGen and LLR
137211941292195 × 2171960 − 151780May 2006Járai et al.

On 2 Dec 2019, Fabrice Boudot, Pierrick Gaudry, Aurore Guillevic, Nadia Heninger, Emmanuel Thomé, and Paul Zimmermann announced the computation of a discrete logarithm modulo the 240-digit prime RSA-240 + 49204 using a number field sieve algorithm; see Discrete logarithm records.

Properties

There is no special primality test for safe primes the way there is for Fermat primes and Mersenne primes. However, Pocklington's criterion can be used to prove the primality of 2p + 1 once one has proven the primality of p.
Just as every term except the last one of a Cunningham chain of the first kind is a Sophie Germain prime, so every term except the first of such a chain is a safe prime. Safe primes ending in 7, that is, of the form 10n + 7, are the last terms in such chains when they occur, since 2 + 1 = 20n + 15 is divisible by 5.
If a safe prime q is congruent to 7 modulo 8, then it is a divisor of the Mersenne number with its matching Sophie Germain prime as exponent.
If q > 7 is a safe prime, then q divides 3/2 − 1.

Modular restrictions

With the exception of 7, a safe prime q is of the form 6k − 1 or, equivalently, q ≡ 5 — as is p > 3. Similarly, with the exception of 5, a safe prime q is of the form 4k − 1 or, equivalently, q ≡ 3 — trivially true since / 2 must evaluate to an odd natural number. Combining both forms using lcm we determine that a safe prime q > 7 also must be of the form 12k−1 or, equivalently, q ≡ 11. It follows that 3 is a quadratic residue mod q for any safe prime q > 7.
If p is a Sophie Germain prime greater than 3, then p must be congruent to 2 mod 3. For, if not, it would be congruent to 1 mod 3 and 2p + 1 would be congruent to 3 mod 3, impossible for a prime number. Similar restrictions hold for larger prime moduli, and are the basis for the choice of the "correction factor" 2C in the Hardy–Littlewood estimate on the density of the Sophie Germain primes.
If a Sophie Germain prime p is congruent to 3 , then its matching safe prime 2p + 1 will be a divisor of the Mersenne number 2p − 1. Historically, this result of Leonhard Euler was the first known criterion for a Mersenne number with a prime index to be composite. It can be used to generate the largest Mersenne numbers that are known to be composite.

Infinitude and density

It is conjectured that there are infinitely many Sophie Germain primes, but this has not been proven. Several other famous conjectures in number theory generalize this and the twin prime conjecture; they include the Dickson's conjecture, Schinzel's hypothesis H, and the Bateman–Horn conjecture.
A heuristic estimate for the number of Sophie Germain primes less than n is
where
is Hardy–Littlewood's twin prime constant. For n = 104, this estimate predicts 156 Sophie Germain primes, which has a 20% error compared to the exact value of 190. For n = 107, the estimate predicts 50822, which is still 10% off from the exact value of 56032. The form of this estimate is due to G. H. Hardy and J. E. Littlewood, who applied a similar estimate to twin primes.
A sequence in which all of the numbers are prime is called a Cunningham chain of the first kind. Every term of such a sequence except the last is a Sophie Germain prime, and every term except the first is a safe prime. Extending the conjecture that there exist infinitely many Sophie Germain primes, it has also been conjectured that arbitrarily long Cunningham chains exist, although infinite chains are known to be impossible.

Strong primes

A prime number q is a strong prime if and both have some large prime factors. For a safe prime, the number naturally has a large prime factor, namely p, and so a safe prime q meets part of the criteria for being a strong prime. The running times of some methods of factoring a number with q as a prime factor depend partly on the size of the prime factors of. This is true, for instance, of the p−1 method.

Applications

Cryptography

Safe primes are also important in cryptography because of their use in discrete logarithm-based techniques like Diffie–Hellman key exchange. If is a safe prime, the multiplicative group of numbers modulo has a subgroup of large prime order. It is usually this prime-order subgroup that is desirable, and the reason for using safe primes is so that the modulus is as small as possible relative to p.
A prime number p = 2q + 1 is called a safe prime if q is prime. Thus, p = 2q + 1 is a safe prime if and only if q is a Sophie Germain prime, so finding safe primes and finding Sophie Germain primes are equivalent in computational difficulty. The notion of a safe prime can be strengthened to a strong prime, for which both p − 1 and p + 1 have large prime factors. Safe and strong primes are useful as the factors of secret keys in the RSA cryptosystem, because they prevent the system being broken by certain factorization algorithms such as Pollard's p − 1 algorithm that would apply to secret keys formed from non-strong primes.
Similar issues apply in other cryptosystems as well, including Diffie–Hellman key exchange and similar systems that depend on the security of the discrete log problem rather than on integer factorization. For this reason, key generation protocols for these methods often rely on efficient algorithms for generating strong primes, which in turn rely on the conjecture that these primes have a sufficiently high density.
In Sophie Germain Counter Mode, it was proposed to use the arithmetic in the finite field of order equal to the Sophie Germain prime 2128 + 12451, to counter weaknesses in Galois/Counter Mode using the binary finite field GF. However, SGCM has been shown to be vulnerable to many of the same cryptographic attacks as GCM.

Primality testing

In the first version of the AKS primality test paper, a conjecture about Sophie Germain primes is used to lower the worst case complexity from to. A later version of the paper is shown to have time complexity which can also be lowered to using the conjecture. Later variants of AKS have been proven to have complexity of without any conjectures or use of Sophie Germain primes.

Pseudorandom number generation

Safe primes obeying certain congruences can be used to generate pseudo-random numbers of use in Monte Carlo simulation.
Similarly, Sophie Germain primes may be used in the generation of pseudo-random numbers. The decimal expansion of 1/q will produce a stream of q − 1 pseudo-random digits, if q is the safe prime of a Sophie Germain prime p, with p congruent to 3, 9, or 11 . Thus "suitable" prime numbers q are 7, 23, 47, 59, 167, 179, etc. . The result is a stream of length q − 1 digits. So, for example, using q = 23 generates the pseudo-random digits 0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6, 9, 5, 6, 5, 2, 1, 7, 3, 9, 1, 3. Note that these digits are not appropriate for cryptographic purposes, as the value of each can be derived from its predecessor in the digit-stream.

In popular culture

Sophie Germain primes are mentioned in the stage play Proof and the subsequent film.