Skip to main content
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.

Hints 2
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −2 pts Log in
Hint 2 −4 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. BlackCipher 08.10.2026
3. Mirjaxon Qaxxarov 27.10.2026
4. Odam 05.11.2026
5. Doston Allayarov 12.11.2026
6. Jasmin Xuseinova 15.11.2026
7. akobir 15.11.2026
8. Kamron_99 16.11.2026
9. milanchka_26 19.11.2026
10. Abdinazarova 19.11.2026