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:
- What is the order
tof the elementh? - What is the smallest primitive root
gforp?
Flag: BAYROQ{DH_tartib_<t>_ildiz_<g>}
To submit a flag, log in.