Cryptography, Algorithms, Public Key Cryptography.
boils down to this phenomenon. Information of interest here to the attacker is the value of g and g^a(=h). The problem is to solve b = g^a (mod m) for a. In brute force, the attacker loops through all possible values of a (0 to m) and checks if g^a equals to b. This is linear in m, ie. O(m). m