Challenges
Small modulus — enumerating the exponent
Cryptography
Easy
Discrete logarithm
Solves: 10
Small modulus — enumerating the exponent
Author: CyberSamSU
Points
22
Diffie-Hellman security relies on the discrete logarithm problem: finding x from the equation g^x ≡ h (mod p). Unlike regular logarithms, there is no formula here.
But it is only "difficult" when p is large. If p is small, a simple brute force is enough: we sequentially calculate g^1, g^2, g^3, ... and find the step where it equals h. Here p is only 7 digits long, meaning at most a few million steps.
In the following session, Alice's public key A has been intercepted. Find her private number a:
p = 3856367
g = 5
A = 1543787 # Alisa jo'natgan (A = g^a mod p)
B = 1055148 # Bob jo'natgan
Flag: BAYROQ{DH_kichik_p_dlp_<a>} — where <a> is Alice's private number.
To submit a flag, log in.