One-Way Function
Statement
A function is one-way if it is easy to evaluate but computationally hard to invert: for any probabilistic polynomial-time algorithm ,
The discrete logarithm function in a prime-order group of order :
is conjectured to be one-way. Evaluating takes multiplications via square-and-multiply; no polynomial-time algorithm to invert it is known.
Note. One-wayness is a computational assumption — it cannot be proved from first principles without resolving . What we can prove formally is that the function is injective on its domain (distinct exponents give distinct group elements when is a generator of order ), and surjective onto (every element is a power of ). These are purely algebraic facts.
Visualization
Discrete log table for , (so , order ):
| (log) | |
|---|---|
Forward direction (easy): given , compute in 3 multiplications.
Inverse direction (hard for large ): given , find such that . For we read off from the table. For with hundreds of digits, no known efficient algorithm exists.
The function is visibly a bijection on : each output in appears exactly once — injectivity is provable, invertibility is hard.
Proof Sketch
-
Well-defined and surjective. If generates of order , then by definition of generator.
-
Injective. If in a group of order , then , so , hence . On this gives .
-
One-way assumption (not provable). The assumption is that no PPT algorithm inverts with non-negligible probability. This is the Discrete Logarithm Assumption (DLA), equivalent to the CDH assumption when the group is suitably chosen.
-
Trapdoor structure. With a trapdoor (the private key ), inversion is trivial. Without it, inversion is believed hard. This asymmetry is the source of all public-key security.
Connections
The discrete log one-way function underlies Diffie–HellmanDiffie–HellmanAlice and Bob derive the same shared secret g^(ab) from public keys g^a and g^b in any commutative group.Read more → and Digital Signature (Schnorr)Digital Signature (Schnorr)A Schnorr signature (R, s) is valid iff g^s = R · y^c, verified by a single group equation.Read more →. Computing efficiently uses Modular ExponentiationModular ExponentiationSquare-and-multiply computes a^n mod m in O(log n) multiplications, agreeing with naive exponentiation.Read more →. The injectivity proof uses that the group order divides , which follows from Fermat's Little TheoremFermat's Little TheoremFor prime p, a^p is congruent to a mod pRead more → for prime-order groups. The surjectivity claim is Cayley's TheoremCayley's TheoremEvery group embeds into a symmetric groupRead more → applied to cyclic groups.
Lean4 Proof
/-- For p = 11, g = 2: the map x ↦ 2^x mod 11 on {0,...,9} is injective.
We verify by listing all 10 values and checking they are distinct. -/
-- The full orbit: 2^0, 2^1, ..., 2^9 (mod 11)
def dlogTable : List ℕ := (List.range 10).map (fun x => 2 ^ x % 11)
-- All 10 values are pairwise distinct.
example : dlogTable = [1, 2, 4, 8, 5, 10, 9, 7, 3, 6] := by decide
example : dlogTable.Nodup := by decide
/-- Consequently the discrete log function is well-defined on this group:
every element of {1,...,10} appears exactly once. -/
example : dlogTable.length = 10 := by decide
/-- Forward direction is O(log x): compute f(7) = 2^7 mod 11 directly. -/
example : 2 ^ 7 % 11 = 7 := by decideReferenced by
- Merkle TreeCryptography