Let *G* be a finite cyclic group with *n* elements. We assume that the group is written multiplicatively. Let *b* be a generator of *G*. Then every element *x* of *G* can be written in the form *x* = *b*^{k} for some integer *k*; furthermore any two such integers representing *x* will be congruent modulo *n*. We can thus define a function

- log
_{b}:*G*→**Z**_{n}

The familiar base change formula for ordinary logarithms remains valid: if *c* is another generator of *G*, then we have

- log
_{c}(*x*) = log_{c}(*b*) log_{b}(*x*).

The Pohlig-Hellman algorithm can be used to compute discrete logarithms in these groups if *p*-1 is a product of small primes, so this should be avoided in those applications. The index calculus is another method to compute discrete logarithms in these groups, as is the birthday attack.

Newer cryptography applications use discrete logarithms in cyclic subgroups of elliptic curves over finite fields. See Elliptic curve cryptography.