Modern & Applied Cryptography Breakers Intermediate
Breaking Diffie-Hellman with Baby-Step Giant-Step
Diffie-Hellman's security rests on the discrete logarithm problem being hard. For a small prime, it isn't. Baby-step giant-step trades a brute-force search of size p for one of roughly √p, and that's the whole reason real DH needs huge safe primes.