21.01.05 · number-theory / elementary

Primitive roots and the structure of

shipped3 tiersLean: none

Anchor (Master): Gauss 1801 *Disquisitiones Arithmeticae* arts. 53-94 (first systematic theory of primitive roots and the classification of moduli admitting them); Artin 1927 (unpublished letter to Hasse, the primitive-root density conjecture); Hooley 1967 *J. reine angew. Math.* 225 (Artin's conjecture under GRH); Gupta-Murty 1984 *Invent. Math.* 78 (unconditional positive proportion); Heath-Brown 1986 *Quart. J. Math.* (2) 37 (Artin's conjecture for at least one of three given non-square-non-$-1$ integers); Diffie-Hellman 1976 *IEEE Trans. Inform. Theory* IT-22; Shor 1994/1997 *SIAM J. Comput.* 26 (quantum polynomial-time DLP and factoring); Hardy-Wright 2008 6e §VI-§VIII

Intuition Beginner

A primitive root modulo is a single nonzero residue whose powers, taken modulo , sweep out every other nonzero residue exactly once before returning to . For the prime , the nonzero residues are . Take as the candidate: ; ; ; . The four powers are exactly the four nonzero residues, in a different order. So is a primitive root modulo .

Not every element is a primitive root. For the same prime , take the candidate : ; . The powers of cycle back to after only steps, missing and entirely. The element has order in , not the full order needed to be a primitive root.

Why does this concept exist? Because primitive roots reveal that — the multiplicative group of nonzero residues modulo — has a single generator. Once you know a primitive root , every other nonzero residue is some power of . This is the prime-modulus version of the deeper fact that the unit group is cyclic: built out of one generating element, like the hours on a clock.

The classification of which moduli admit primitive roots is a celebrated theorem of Gauss in his 1801 Disquisitiones Arithmeticae. The moduli for which is cyclic — equivalently, the moduli for which a primitive root exists — are exactly , the odd prime powers , and twice the odd prime powers . For every other , the unit group splits as a product of two or more cyclic pieces, and no single element generates the whole group.

The applied importance of primitive roots is the discrete logarithm problem. Fix a prime and a primitive root modulo . Every nonzero residue is then for a unique with . Computing from is fast (repeated squaring takes about multiplications). Recovering from — the discrete logarithm — appears to be hard: no classical algorithm is known that runs in time polynomial in .

This asymmetry is the cornerstone of Diffie-Hellman key exchange (1976), ElGamal encryption (1985), and the Digital Signature Algorithm — every secure VPN, every TLS handshake done with a non-elliptic-curve cipher suite, every Tor circuit. The quantum algorithm of Peter Shor 1994 would break this asymmetry on a sufficiently large quantum computer, and the post-quantum cryptography programme exists precisely to plan for that future.

Visual Beginner

A diagram of the cyclic orbit of a primitive root modulo a small prime. For the primitive root generates the orbit , , , , , . The six powers form a complete cycle through every nonzero residue modulo , then close back to .

The picture captures the defining property of a primitive root: the orbit visits every nonzero residue exactly once, and then returns to after exactly steps. Compare with the orbit of modulo : — a shorter cycle of length that misses three of the residues. The element has order modulo , and has order ; only the latter is a primitive root.

Worked example Beginner

Find a primitive root modulo , and verify it by listing its orbit.

Step 1. The order of a primitive root must equal . By a basic group fact, the order of any element divides , so the possible orders are . A candidate is a primitive root if and only if its order is — equivalently, and .

Step 2. Test . Compute and . Both order-failing conditions are avoided, so the order of is exactly . The element is a primitive root modulo .

Step 3. List the orbit: ; ; ; ; ; ; ; ; ; .

Step 4. The ten powers exhaust the ten nonzero residues modulo , confirming is a primitive root.

What this tells us: to test whether is a primitive root modulo , you do not need to compute the full orbit. You only need to check that for every prime dividing . For the prime divisors of are and , and the two checks and are enough.

Check your understanding Beginner

Formal definition Intermediate+

We restate the order of an element and the notion of a primitive root in the precise group-theoretic language inherited from 21.01.04.

Definition (multiplicative order modulo ). Let be an integer and an integer with . The multiplicative order of modulo , written , is the least positive integer such that .

Such a exists because is a finite group of order , so the cyclic subgroup generated by is finite. By Lagrange's theorem applied to the finite group , $$ \mathrm{ord}_n(a) ;\big|; \varphi(n). $$

Definition (primitive root modulo ). A primitive root modulo is an integer with and . Equivalently, generates as a cyclic group: every is for some integer .

The existence of a primitive root modulo is equivalent to being cyclic — generated by a single element. The classification of such is the structure theorem proved in the next subsection.

Definition (discrete logarithm / index). Let be a modulus admitting a primitive root , so is cyclic of order with generator . For every coprime to , the discrete logarithm (or index) of to base modulo is the unique integer with such that . Notation: .

The discrete logarithm is the inverse function of the exponentiation map , which is a group isomorphism . The Gauss index calculus exploits this isomorphism: — multiplicative structure modulo becomes additive structure modulo .

Counterexamples to common slips

  • "Every is cyclic." False already for : the unit group has order but every unit squares to , so is not cyclic. The classification theorem restricts cyclicity to for an odd prime.

  • "The order of modulo equals for some in every modulus." False — the previous slip restated. For the maximum order is , strictly below . The maximum achievable order is the Carmichael function of 21.01.04, which can be strictly less than .

  • "The discrete logarithm is well-defined for every nonzero residue." Only when the residue is coprime to the modulus. The residue modulo has no discrete logarithm to base any primitive root of because . The discrete log lives on the unit group, not on all of .

Key theorem with proof Intermediate+

The signature theorem of this unit is the existence of a primitive root modulo every prime. The proof technique — counting elements of each order via the field structure of and the totient sum — is the prototype for every cyclicity proof in elementary number theory.

Theorem (Gauss; existence of primitive roots modulo ). For every prime , the group is cyclic of order . The number of primitive roots modulo is .

Proof. Let , a finite abelian group of order . For each positive divisor of , let $$ N(d) ;=; # {, [a]_p \in G : \mathrm{ord}([a]p) = d ,}. $$ The element orders are exactly the divisors of (Lagrange), so $$ \sum{d \mid p - 1} N(d) ;=; p - 1. \quad (\star) $$

We bound by the field property of . An element of order dividing is a root of the polynomial . A polynomial of degree over a field has at most roots, so the number of elements of order dividing is at most . Hence $$ \sum_{e \mid d} N(e) ;\leq; d. \quad (\star\star) $$

The crucial step: when , the bound becomes an equality. Suppose has order exactly ; then the powers are distinct elements of order dividing , so they are all of them by . Among these elements, the number of order exactly is the number of with — namely . Hence: $$ N(d) \in {0, \varphi(d)} \quad \text{for every } d \mid p - 1. $$

Combining with and the elementary totient identity (proved in 21.01.03 Proposition 1): $$ p - 1 ;=; \sum_{d \mid p - 1} N(d) ;\leq; \sum_{d \mid p - 1} \varphi(d) ;=; p - 1. $$ The inequality is an equality. Hence for every . In particular since , so there exists an element of order exactly — a primitive root. The cyclic subgroup generated by any such element has order , so it is all of , and is cyclic.

The count of primitive roots is .

Bridge. The polynomial-degree bound is the foundational reason that finite subgroups of multiplicative groups of fields are cyclic — and the central insight is exactly this: the field property of forces every order- root-locus to have exactly elements of order (or zero), and the totient summation forces every divisor to be hit. This is the bridge to 01.02.18 pending finite fields : every is cyclic of order by the same argument (no exception, unlike the integer-modulus case), and the unit group of any field has every finite subgroup cyclic. The proof generalises to the lift from to via Hensel: a primitive root modulo lifts to a primitive root modulo for odd (the technical content of Theorem 1 below), identifying the orbit structure modulo with the orbit structure modulo times a -cyclic radical. The same divisor-counting pattern recurs in 21.01.06 quadratic residues, where the count of squares is via the kernel-image computation of the squaring map.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib supplies the abstract scaffolding for primitive roots and the cyclic structure of . The Lean module Codex.NumberTheory.Elementary.PrimitiveRootsZModUnits packages the existence theorem and the structural classification.

-- Operative imports: Mathlib.Data.ZMod.Basic, Mathlib.Data.ZMod.Units,
-- Mathlib.GroupTheory.SpecificGroups.Cyclic,
-- Mathlib.RingTheory.RootsOfUnity.Basic, Mathlib.NumberTheory.LucasPrimality

#check @ZMod.unitsEquivCoprime
-- Identification of (ZMod n)ˣ with the type of integers coprime to n.

#check @IsPrimitiveRoot
-- The abstract predicate: x is a primitive nth root of unity in M iff x^n = 1
-- and no smaller positive exponent works.

#check @ZMod.isCyclic
-- For p prime, (ZMod p)ˣ is cyclic.

#check @orderOf
-- The order of an element in a group.

#check @orderOf_dvd_card
-- Lagrange: orderOf g divides Fintype.card G for finite G.

#check @Nat.totient
-- The Euler totient function.

The Lean cyclicity result ZMod.isCyclic rests on the polynomial-root bound Polynomial.card_roots_le_degree applied to , mirroring the Key Theorem proof. What Mathlib has not yet packaged: the explicit primitive-root existence proof modulo odd prime powers via Hensel lifting from to ; the explicit decomposition for generated by and ; the Möbius count of primitive roots modulo ; the discrete-logarithm isomorphism with its constructive baby-step giant-step and Pohlig-Hellman implementations; the Lucas and Lucas-Lehmer primality tests as direct applications of the primitive-root framework. These are the formalisation gaps documented in the unit metadata Mathlib gap analysis.

Advanced results Master

Theorem 1 (existence of primitive roots modulo every ; Gauss 1801). For an odd prime and , the group is cyclic of order . The group is cyclic of the same order . [Gauss 1801]. The proof is Hensel lifting: a primitive root modulo (Key Theorem) lifts to a primitive root modulo , with the explicit replacement used when (Exercise 6 above). The CRT decomposition then makes cyclic at no extra cost. Cyclicity fails for with (Theorem 2), and for with at least two distinct odd-prime factors or with and another odd-prime factor — these are the only obstructions. Gauss 1801 arts. 53-89 give the entire classification with constructive proofs.

Theorem 2 (structure of for ). For , , generated by (order ) and (order ). The first factor is the kernel of reduction modulo (so generates it); the second is generated by , with but (verifiable by induction with and expansions). The non-cyclicity for is the unique structural exception to the Gauss cyclicity classification and the operational reason that the Carmichael function is strictly smaller than for . See Hardy-Wright 2008 §VI.10 [Hardy-Wright 2008] for the standard induction.

Theorem 3 (Artin's primitive-root conjecture; Artin 1927, Hooley 1967). Let be an integer that is not and not a perfect square. Then is a primitive root modulo for infinitely many primes , with density $$ \delta(a) ;=; A \cdot \prod_p \left(1 - \frac{1}{p(p - 1)}\right) ;=; A \cdot 0.3739558\ldots ,, $$ where is a rational correction factor depending on the squarefree part of . [Artin 1927; Hooley 1967]. The constant is the Artin constant. Artin 1927 formulated the conjecture in a letter to Hasse based on heuristic considerations: is a primitive root modulo iff for every prime , is not a -th power modulo ; under independence assumptions, this has probability corrections.

Hooley 1967 J. reine angew. Math. 225, 209 [Hooley 1967] proved Artin's conjecture conditionally on the generalised Riemann hypothesis for the Dedekind zeta functions of the Kummer-cyclotomic fields , using Chebotarev density theorem to count primes by splitting. The unconditional progress: Gupta-Murty 1984 Invent. Math. 78, 127 [Gupta-Murty 1984] proved that infinitely many integers have a positive density of primitive-root primes; Heath-Brown 1986 Quart. J. Math. (2) 37, 27 [Heath-Brown 1986] proved that among any three multiplicatively independent integers, at least one is a primitive root modulo infinitely many primes — in particular at least one of is.

Theorem 4 (baby-step giant-step algorithm for the discrete logarithm; Shanks 1971). In a cyclic group of order with generator , the discrete logarithm can be computed in time and space via baby-step giant-step. [Shanks 1971]. The algorithm: set ; precompute and store the baby steps in a hash table; for compute the giant step and check whether it appears in the hash table — if , then . Time and space . Combined with Pohlig-Hellman (Theorem 5), this is the best classical generic algorithm for DLP in groups whose order has no large prime factor.

Theorem 5 (Pohlig-Hellman algorithm; Pohlig-Hellman 1978). Let be a cyclic group of order . The discrete logarithm in reduces by CRT to the discrete logarithm in each cyclic subgroup of order , each solvable by baby-step giant-step in steps. Total complexity: . [Pohlig-Hellman 1978]. Practical consequence: a generic DLP in a group of order with a large prime factor requires at least work, so secure cryptographic groups choose with a single large prime factor — the safe prime condition for , or pairing-friendly curves for elliptic-curve DLP. RFC 3526 standardises safe primes for Diffie-Hellman.

Theorem 6 (index-calculus method for DLP in ; Adleman 1979). There exists a probabilistic sub-exponential algorithm for the discrete logarithm in running in time , refined to via the number-field sieve, where [Adleman 1979]. The algorithm exploits the multiplicative structure of : fix a smoothness bound and a factor base of primes ; for random exponents , factor over (keeping only the smooth values); each successful factorisation gives a linear relation in the unknowns . After collecting linearly independent relations, solve the linear system. Then compute via one more smooth-factorisation step. The number-field sieve adaptation [Gordon 1993 SIAM J. Discrete Math. 6, 124] reaches asymptotic complexity. Pre-computation makes -bit DH insecure (the Logjam attack of Adrian et al. 2015 CCS 2015), motivating the -bit modern minimum.

Theorem 7 (Shor's quantum polynomial-time DLP; Shor 1994/1997). There exists a quantum algorithm computing the discrete logarithm in any cyclic group of order in time on a quantum computer, given oracle access to the group operation [Shor 1994]. The algorithm uses the quantum Fourier transform over to extract the period of the function , whose period along the line encodes . The same period-finding subroutine factors integers via the order of a random element. Polynomial-time quantum factoring breaks RSA; polynomial-time quantum DLP breaks Diffie-Hellman, ElGamal, DSA, ECDH, ECDSA. Motivates the entire post-quantum cryptography programme: NIST PQC standardisation 2016-2024, with the first standards FIPS 203 (ML-KEM / Kyber, lattice-based key encapsulation) and FIPS 204 (ML-DSA / Dilithium, lattice-based signatures) announced August 2024.

Theorem 8 (Lucas primality test; Lucas 1878). An integer is prime if and only if there exists with and for every prime . [Lucas 1878]. The condition is exactly that has order in , hence , hence (the unit group has at most elements), which forces every residue to be a unit, forcing to be prime. The certificate (a primitive root witness) gives a deterministic polynomial-time-verifiable proof of primality — Pratt 1975 SIAM J. Comput. 4, 214 showed that the recursive certificate (a primitive root for , plus primality certificates for each ) has polynomial size, putting PRIMES in NP. The Lucas-Lehmer specialisation to Mersenne primes is the algorithm used by GIMPS to discover the largest known primes (currently , discovered 2018).

Synthesis. The primitive-root framework is the foundational reason that the multiplicative structure of admits a clean discrete-logarithm identification with — when it does, and the obstruction is precisely when the unit group fails to be cyclic and a single primitive root is unavailable. The central insight is exactly that the field property of supplies the polynomial-degree bound , which combined with the totient summation forces every divisor of to have exactly elements of order — and the unique branch produces primitive roots. The bridge to 01.02.18 pending finite fields is this very argument: every is cyclic of order without exception, and the failure-mode non-cyclic for non-prime-power traces to not being a field.

The applied half of the unit is dominated by the discrete-logarithm problem. Putting these together with the Pohlig-Hellman reduction and the baby-step giant-step + index-calculus + number-field-sieve hierarchy, the best classical DLP algorithm in for safe-prime runs in sub-exponential time, fast enough to break -bit Diffie-Hellman in pre-computation (Logjam 2015) but slow enough to keep -bit secure against classical attacks for the foreseeable future. The pattern recurs in elliptic-curve cryptography: DLP in has no known sub-exponential classical attack (no index-calculus analogue), allowing -bit keys to provide -bit security — the modern default in TLS 1.3 and Signal. Shor 1994's quantum polynomial-time DLP identifies all these classical hardness assumptions with a single quantum-Fourier-transform period-finding routine, and the post-quantum transition (NIST FIPS 203 + 204, 2024) replaces the discrete-log + factoring hardness assumptions with lattice-shortest-vector + module-LWE hardness assumptions whose quantum complexity is conjecturally still exponential.

The historical bridge connects 1801 Gauss to 1976 Diffie-Hellman to 1994 Shor in a single arc. Gauss's classification of cyclic identifies the moduli for which the discrete logarithm is well-defined; Diffie-Hellman's 1976 IEEE Trans. Inform. Theory paper repurposed the index calculus as the cornerstone of the first public-key cryptosystem; Lucas's 1878 primality test built on the same primitive-root structure as the first deterministic certificate scheme; the entire post-1976 cryptographic ecosystem inherited the cyclic-group framework, with Artin's 1927 conjecture identifying the candidate primitive roots and Hooley 1967 the conditional density. The bridge is everywhere the same: a single generator of the cyclic unit group converts modular arithmetic into discrete additive arithmetic modulo , and every cryptographic protocol since 1976 has rested on the asymmetry between forward exponentiation (fast) and reverse logarithm extraction (slow).

Full proof set Master

Proposition 1 (cyclicity of ). For every prime , is cyclic of order .

Proof. Reprised from the Key Theorem with sharpened notation. Let . For each let . The element orders divide by Lagrange, so $$ \sum_{d \mid p - 1} N(d) = p - 1. \tag{1} $$

An element has iff , i.e., is a root of . By the field property of , this polynomial has at most roots in , so .

Suppose with witness of order . The cyclic subgroup has elements, all satisfying , so accounts for the full root set of — equality . Among the elements of , the number of order exactly is the number of with , namely .

So for every . Combined with (1) and : $$ p - 1 = \sum_{d \mid p - 1} N(d) \leq \sum_{d \mid p - 1} \varphi(d) = p - 1. $$ Equality forces for every , in particular . A primitive root exists; is cyclic.

Proposition 2 (Hensel lift to ). For an odd prime and , is cyclic of order .

Proof. By Proposition 1 there exists a primitive root modulo . By Exercise 6 above, either or is a primitive root modulo ; without loss assume itself is.

Induction on . For the step : assume has order exactly modulo , with . The order of modulo divides , and reducing modulo shows that divides this order. So the order modulo is either or .

Suppose for contradiction the order is the smaller value . Then . By induction hypothesis (it has order exactly modulo ), so with . Raise to the -th power and expand: $$ g^{p^{k - 1}(p - 1)} = (1 + c p^{k - 1})^p = 1 + p \cdot c p^{k - 1} + \binom{p}{2} (c p^{k - 1})^2 + \cdots. $$ The second term is ; subsequent terms have or higher. Since is odd and , , so modulo : $$ g^{p^{k - 1}(p - 1)} \equiv 1 + c p^k \pmod{p^{k + 1}}. $$ Since , , so — contradiction. Hence the order is , and is a primitive root modulo .

Proposition 3 (structure of for ). For , , generated by and .

Proof. The order of modulo is for every . Claim the order of modulo is for , by induction.

Base case : , so the order of modulo divides . Also , so the order is exactly .

Step for : assume and . Write for some integer . Square: $$ 5^{2^{k - 1}} = (1 + a \cdot 2^k)^2 = 1 + 2 a \cdot 2^k + a^2 \cdot 2^{2k} \equiv 1 + a \cdot 2^{k + 1} \pmod{2^{k + 2}}. $$ So iff , which holds unconditionally. So , i.e., the order of modulo divides . Strict-or-equal: suppose for contradiction . Then , forcing . But then (square-root analysis) lands inside already at , contradicting the inductive non-equality. Hence the order modulo is exactly .

So is cyclic of order for . The subgroup has order .

Intersection: every power of is (since and powers preserve residues mod ), while . So .

Product: . So the product subgroup equals the full unit group.

Hence .

Proposition 4 (discrete-logarithm isomorphism). For with an odd prime, fix a primitive root modulo . The map , , is a group isomorphism.

Proof. For , generates the unit group, so there exists a unique with . This defines .

Group homomorphism: because , and -exponentials are equal modulo iff exponents are congruent modulo .

Injective: gives .

Surjective: is the index of .

So is a bijective homomorphism, hence an isomorphism.

Connections Master

  • Fermat-Euler-Wilson theorems 21.01.04. Just shipped. The order-divides-group-order fact underlying Fermat () and Euler () is sharpened in the present unit to the existence of an element of order exactly when has the right shape — a primitive root. The Key Theorem here builds on the Lagrange-divides framework of 21.01.04 and the totient identity that appears in the totient calculus of 21.01.03. The Carmichael function from 21.01.04 is the tight exponent of and equals exactly when a primitive root exists — the cyclic case.

  • Congruences and the Chinese remainder theorem 21.01.03. Shipped. The CRT decomposition is the operational tool that reduces the cyclicity classification to prime powers (Theorem 1, Theorem 2), and the discrete-logarithm Pohlig-Hellman reduction (Theorem 5) is essentially CRT applied to the cyclic-group order . The structure theorem for proved here gives the explicit CRT factor decomposition: the cyclic factors for odd, the Klein-times-cyclic factor for .

  • Primes and the fundamental theorem of arithmetic 21.01.02. Shipped. The classification of admitting primitive roots — — is stated in terms of the prime factorisation of supplied by the fundamental theorem of arithmetic. Lucas's 1878 primality test (Theorem 8) uses primitive-root certificates to give a deterministic primality proof, refining the Fermat test of 21.01.04; Pratt 1975 showed the resulting recursive certificate has polynomial size, placing PRIMES in NP. The Lucas-Lehmer specialisation to Mersenne primes is the algorithm underlying every record-holding prime since 1952.

  • Quadratic residues and reciprocity 21.01.06. Pending. A nonzero residue is a quadratic residue modulo a prime iff is even for any primitive root modulo . The squaring map , , has kernel and image of index ; the image is exactly the subgroup of quadratic residues. Euler's criterion for the Legendre symbol is the primitive-root identification . Gauss's quadratic reciprocity (1801, six independent proofs) builds on the primitive-root framework as its operational substrate.

  • Group 01.02.01. Shipped. The proofs of the cyclicity classification rest on the standard finite-group structure theorems: Lagrange's theorem (order divides group order), the cyclic-group classification (subgroups of cyclic groups are cyclic, generators are for ), CRT for products of finite cyclic groups (cyclic iff orders are pairwise coprime). The discrete-logarithm isomorphism for cyclic is the prototype of every isomorphism from a finite cyclic group to its additive realisation .

  • Finite fields and Frobenius 01.02.18 pending. Pending. Every finite subgroup of the multiplicative group of a field is cyclic — a generalisation of the prime-case Key Theorem proved here. In particular is cyclic of order for every prime power , without the moduli restriction that holds for (since is a field but for non-prime-power is not). A generator of is also called a primitive root (or primitive element) of , and the construction of via irreducible polynomials of degree over uses primitive-root existence implicitly. The Frobenius endomorphism , , generates the cyclic Galois group , and the discrete-logarithm framework lifts to finite-field DLP — the basis of pairing-based cryptography and Schoof's elliptic-curve point-counting algorithm.

Historical & philosophical context Master

Gauss 1801 Disquisitiones Arithmeticae arts. 53-94 [Gauss 1801] is the canonical originator of the primitive-root theory. Articles 53-54 define the order of a residue modulo — Gauss writes "the period of " — and observe that the period divides via the geometric-series argument . Articles 55-56 prove the polynomial-root bound: has at most roots modulo a prime, a consequence Gauss attributes to himself but which appears earlier in Lagrange 1768 in a less general form. Articles 57-72 give the existence proof of primitive roots modulo every odd prime via the divisor-counting argument of the Key Theorem above. Articles 73-89 lift the existence to odd prime powers and to , classifying the moduli admitting primitive roots — and showing is the lone non-cyclic case among prime powers for . Articles 90-94 develop the index calculus (Gauss's term for the discrete logarithm) as a working tool: a primitive root modulo gives a table of indices for every , reducing multiplicative computations modulo to additive computations modulo . Gauss exhibits explicit tables for and uses them in the proofs of quadratic and biquadratic reciprocity.

The applied legacy is the discrete-logarithm problem. The earliest substantive DLP algorithm is the baby-step giant-step method of Shanks 1971 Proc. Symp. Pure Math. 20, 415 [Shanks 1971], originally introduced for class-group computations. Pohlig-Hellman 1978 IEEE Trans. Inform. Theory IT-24, 106 [Pohlig-Hellman 1978] showed that for with , the DLP reduces by CRT to subgroup DLPs of order , each solvable by Shanks in steps. The Adleman 1979 FOCS 20, 55 [Adleman 1979] index-calculus method achieves sub-exponential complexity via factor-base smooth-relation collection; the number-field sieve adaptation (Gordon 1993, Joux-Lercier 2003) refines this to . The 2015 Logjam attack (Adrian et al. CCS 2015) used pre-computed -bit safe-prime DH discrete logs to break TLS connections in real time, establishing -bit as the modern Diffie-Hellman minimum.

The 1976 invention of public-key cryptography by Diffie-Hellman 1976 IEEE Trans. Inform. Theory IT-22, 644 [Diffie-Hellman 1976] is the watershed moment in modern applied cryptography, and rests entirely on the discrete-logarithm asymmetry in . Alice and Bob agree on a large prime and a primitive root ; Alice publishes , Bob publishes ; the shared secret is , computable by either party from one secret and the other's public value, but apparently uncomputable by an eavesdropper who sees only — the "computational Diffie-Hellman" assumption. ElGamal 1985 IEEE Trans. Inform. Theory IT-31, 469 [ElGamal 1985] extended the framework to public-key encryption and signatures; the U.S. Digital Signature Algorithm (NIST FIPS PUB 186, 1991) is the standardised ElGamal-signature variant; elliptic-curve Diffie-Hellman (ECDH) and ECDSA (NIST FIPS PUB 186-2, 2000) replace by an elliptic-curve group with no known sub-exponential DLP algorithm. Every TLS handshake, every Signal Protocol initial key exchange, every Tor circuit setup uses some descendant of Diffie-Hellman 1976.

The unconditional density of primitive-root primes is the open conjecture of Artin 1927 [Artin 1927], communicated in a letter to Hasse: every integer that is not and not a perfect square is a primitive root modulo infinitely many primes, with positive density. The conjectured density is the Artin constant (corrected by a rational factor for a power), derived from independence heuristics: is a primitive root modulo iff for every prime , is not a -th power modulo . Hooley 1967 J. reine angew. Math. 225, 209 [Hooley 1967] proved Artin's conjecture conditional on the generalised Riemann hypothesis applied to the Kummer-cyclotomic fields . Gupta-Murty 1984 Invent. Math. 78, 127 [Gupta-Murty 1984] gave the first unconditional positive-density result: there are infinitely many for which has a positive density of primitive-root primes. Heath-Brown 1986 Quart. J. Math. (2) 37, 27 [Heath-Brown 1986] proved that among any three multiplicatively independent rationals, at least one satisfies Artin's conjecture — in particular at least one of is a primitive root modulo infinitely many primes, but no specific witness is known unconditionally.

The quantum-computing future is Shor 1994 Proc. FOCS 35, 124 [Shor 1994] (expanded as Shor 1997 SIAM J. Comput. 26, 1484): polynomial-time quantum algorithms for both factoring and the discrete logarithm. The core subroutine is quantum period-finding via the quantum Fourier transform over : the function is periodic with period , and the QFT extracts this period in quantum gates. Combined with continued-fraction post-processing, this gives polynomial-time integer factoring (via the order of a random ) and polynomial-time DLP (via the period of ). On a sufficiently large fault-tolerant quantum computer, Shor's algorithm would break RSA, Diffie-Hellman, ElGamal, DSA, ECDH, ECDSA — the entire post-1976 public-key cryptographic infrastructure. NIST's Post-Quantum Cryptography standardisation process (2016-2024) culminated in FIPS 203 (ML-KEM / Kyber, lattice-based key encapsulation) and FIPS 204 (ML-DSA / Dilithium, lattice-based signatures) announced August 2024, with FIPS 205 (SLH-DSA / SPHINCS+, hash-based signatures) as a backup; the underlying hard problems (module-LWE, module-SIS, hash collisions) replace the discrete-log + factoring framework but inherit the same cyclic-group / discrete-additive-structure backbone that Gauss 1801 first identified.

Bibliography Master

@book{Gauss1801,
  author    = {Gauss, Carl Friedrich},
  title     = {Disquisitiones Arithmeticae},
  publisher = {Gerhard Fleischer},
  address   = {Leipzig},
  year      = {1801},
  note      = {English translation by Arthur A. Clarke, Yale University Press, 1965. Articles 53-94 contain the canonical originator development of primitive roots and the cyclicity classification of $(\mathbb{Z}/n\mathbb{Z})^\times$.}
}

@unpublished{Artin1927,
  author = {Artin, Emil},
  title  = {Conjecture on primitive roots},
  year   = {1927},
  note   = {Letter to Helmut Hasse, 27 September 1927. First reported in Hasse 1933 *Bericht II*, §5. The conjecture: every integer $a$ not equal to $-1$ and not a perfect square is a primitive root modulo infinitely many primes, with positive density.}
}

@article{Lucas1878,
  author  = {Lucas, {\'E}douard},
  title   = {Th\'eorie des fonctions num\'eriques simplement p\'eriodiques},
  journal = {American Journal of Mathematics},
  volume  = {1},
  pages   = {184--240 and 289--321},
  year    = {1878},
  note    = {The Lucas primality test based on primitive-root certificates. The Lucas-Lehmer test for Mersenne primes is a specialisation.}
}

@article{DiffieHellman1976,
  author  = {Diffie, Whitfield and Hellman, Martin E.},
  title   = {New directions in cryptography},
  journal = {IEEE Transactions on Information Theory},
  volume  = {IT-22},
  pages   = {644--654},
  year    = {1976},
  note    = {The first published public-key cryptographic protocol. Diffie-Hellman key exchange rests on the discrete-logarithm hardness assumption in $(\mathbb{Z}/p\mathbb{Z})^\times$.}
}

@article{ElGamal1985,
  author  = {ElGamal, Taher},
  title   = {A public key cryptosystem and a signature scheme based on discrete logarithms},
  journal = {IEEE Transactions on Information Theory},
  volume  = {IT-31},
  pages   = {469--472},
  year    = {1985}
}

@article{Hooley1967,
  author  = {Hooley, Christopher},
  title   = {On Artin's conjecture},
  journal = {Journal f\"ur die reine und angewandte Mathematik},
  volume  = {225},
  pages   = {209--220},
  year    = {1967}
}

@article{GuptaMurty1984,
  author  = {Gupta, Rajiv and Murty, M. Ram},
  title   = {A remark on Artin's conjecture},
  journal = {Inventiones Mathematicae},
  volume  = {78},
  pages   = {127--130},
  year    = {1984}
}

@article{HeathBrown1986,
  author  = {Heath-Brown, D. R.},
  title   = {Artin's conjecture for primitive roots},
  journal = {Quarterly Journal of Mathematics, Oxford Series (2)},
  volume  = {37},
  pages   = {27--38},
  year    = {1986}
}

@article{Shanks1971,
  author  = {Shanks, Daniel},
  title   = {Class number, a theory of factorization, and genera},
  journal = {Proceedings of Symposia in Pure Mathematics},
  volume  = {20},
  pages   = {415--440},
  year    = {1971},
  note    = {Baby-step giant-step algorithm for the discrete logarithm.}
}

@article{PohligHellman1978,
  author  = {Pohlig, Stephen C. and Hellman, Martin E.},
  title   = {An improved algorithm for computing logarithms over {GF}($p$) and its cryptographic significance},
  journal = {IEEE Transactions on Information Theory},
  volume  = {IT-24},
  pages   = {106--110},
  year    = {1978}
}

@inproceedings{Adleman1979,
  author    = {Adleman, Leonard M.},
  title     = {A subexponential algorithm for the discrete logarithm problem with applications to cryptography},
  booktitle = {Proceedings of the 20th Annual IEEE Symposium on Foundations of Computer Science},
  pages     = {55--60},
  year      = {1979}
}

@inproceedings{Shor1994,
  author    = {Shor, Peter W.},
  title     = {Algorithms for quantum computation: discrete logarithms and factoring},
  booktitle = {Proceedings of the 35th Annual Symposium on Foundations of Computer Science},
  pages     = {124--134},
  year      = {1994},
  note      = {Expanded as Shor 1997 *SIAM J. Comput.* 26, 1484-1509.}
}

@book{HardyWright2008,
  author    = {Hardy, G. H. and Wright, E. M.},
  title     = {An Introduction to the Theory of Numbers},
  edition   = {6},
  publisher = {Oxford University Press},
  year      = {2008},
  note      = {Revised by D. R. Heath-Brown and J. H. Silverman. Chapters VI-VIII develop primitive roots, the cyclicity classification, the discrete logarithm, and quadratic reciprocity.}
}

@book{IrelandRosen1990,
  author    = {Ireland, Kenneth and Rosen, Michael},
  title     = {A Classical Introduction to Modern Number Theory},
  edition   = {2},
  series    = {Graduate Texts in Mathematics},
  volume    = {84},
  publisher = {Springer},
  year      = {1990},
  note      = {§4 develops the cyclicity classification of $(\mathbb{Z}/n)^\times$ with the modern group-theoretic framing.}
}

@book{Apostol1976,
  author    = {Apostol, Tom M.},
  title     = {Introduction to Analytic Number Theory},
  series    = {Undergraduate Texts in Mathematics},
  publisher = {Springer},
  year      = {1976},
  note      = {§§6-7 develop primitive roots, the index calculus, and discrete-logarithm tables.}
}

@book{Burton2010,
  author    = {Burton, David M.},
  title     = {Elementary Number Theory},
  edition   = {7},
  publisher = {McGraw-Hill},
  year      = {2010},
  note      = {§8 develops the order of an integer modulo $n$ and primitive roots at the undergraduate Beginner-tier level.}
}