Lably
Skip to content

Quadratic residuosity problem

  • 2 min read
  • 3 chapters

Related on Lably

Through Integer, Modular arithmetic and Prime number

The problem was first described by Gauss in his Disquisitiones Arithmeticae in 1801. This problem is believed to be computationally difficult. Several cryptographic methods rely on its hardness, see § Applications.

An efficient algorithm for the quadratic residuosity problem immediately implies efficient algorithms for other number theoretic problems, such as deciding whether a composite N of unknown factorization is the product of 2 or 3 primes.

Precise formulation

Given integers a and T, a is said to be a quadratic residue modulo T if there exists an integer b such that

a≡b2(modT).

Otherwise we say it is a quadratic non-residue. When T=p is a prime, it is customary to use the Legendre symbol:

(ap)={1 if a is a quadratic residue modulo p and a≢0(modp),−1 if a is a quadratic non-residue modulo p,0 if a≡0(modp).

This is a multiplicative character which means (ap)=1 for exactly (p−1)/2 of the values 1,…,p−1, and it is −1 for the remaining.

It is easy to compute using the law of quadratic reciprocity in a manner akin to the Euclidean algorithm; see Legendre symbol.

Consider now some given N=p1p2 where p1 and p2 are two different unknown primes. A given a is a quadratic residue modulo N if and only if a is a quadratic residue modulo both p1 and p2 and gcd(a,N)=1.

Since we don't know p1 or p2, we cannot compute (ap1) and (ap2). However, it is easy to compute their product. This is known as the Jacobi symbol:

(aN)=(ap1)(ap2)

This also can be efficiently computed using the law of quadratic reciprocity for Jacobi symbols.

However, (aN) cannot in all cases tell us whether a is a quadratic residue modulo N or not! More precisely, if (aN)=−1 then a is necessarily a quadratic non-residue modulo either p1 or p2, in which case we are done. But if (aN)=1 then it is either the case that a is a quadratic residue modulo both p1 and p2, or a quadratic non-residue modulo both p1 and p2. We cannot distinguish these cases from knowing just that (aN)=1.

This leads to the precise formulation of the quadratic residue problem:

Problem: Given integers a and N=p1p2, where p1 and p2 are distinct unknown primes, and where (aN)=1, determine whether a is a quadratic residue modulo N or not.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication