We develop a formalism for studying the discrete logarithm problem for the multiplicative group and for elliptic curves over finite fields by lifting the respective group to an algebraic number field and using global duality. One of our main tools is the signature of a Dirichlet character (in the multiplicative group case) or principal homogeneous space (in the elliptic curve case), which is a measure of its ramification at certain places. We then develop signature calculus, which generalizes and refines the index calculus method. Finally, using some heuristics, we show the random polynomial time equivalence for these two cases between the problem of computing signatures and the discrete logarithm problem. This relates the discrete logarithm problem to some very well-known problems in algebraic number theory and arithmetic geometry.