Skip to main content
Challenges Group order and generator selection
Cryptography Easy Diffie-Hellman Solves: 10

Group order and generator selection

Author: CyberSamSU
Points
20

Diffie-Hellman works in the multiplicative group modulo mod p. This group has p-1 elements (from 1 to p-1). The order of an element is the smallest positive number t such that h^t ≡ 1 (mod p).

According to Lagrange's theorem, the order of any element divides p-1. Thus, there is no need to try all numbers — we only need to check the divisors of p-1.

If the element's order is exactly equal to p-1, it is called a generator (primitive root): its powers cover the entire group. For DH, exactly such g is chosen, because an element with a small order leaves very few options for the shared secret.

p = 25597421
p - 1 = 2^2 * 5 * 1279871

h = 1024

Answer two questions:

  1. What is the order t of the element h?
  2. What is the smallest primitive root g for p?

Flag: BAYROQ{DH_tartib_<t>_ildiz_<g>}

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

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 27.10.2026
3. Odam 06.11.2026
4. Doston Allayarov 12.11.2026
5. Jasmin Xuseinova 15.11.2026
6. Kamron_99 16.11.2026
7. Sevara 16.11.2026
8. Abdinazarova 19.11.2026
9. milanchka_26 21.11.2026
10. Jumanazarov Asilbek 26.11.2026