Skip to main content
Challenges Diffie-Hellman: shared secret
Cryptography Easy Diffie-Hellman Solves: 18

Diffie-Hellman: shared secret

Author: CyberSamSU
Points
15

Diffie-Hellman (DH) is a protocol where two people communicate over a public channel and agree on the same shared secret without ever transmitting a private key. It was discovered in 1976 and is at the foundation of today's HTTPS connections.

The way it works is very simple. Two numbers visible to everyone are chosen: a large prime number p and a generator g. Then:

  1. Alice thinks of a private number a and sends A = g^a mod p.
  2. Bob thinks of a private number b and sends B = g^b mod p.
  3. Alice calculates s = B^a mod p.
  4. Bob calculates s = A^b mod p.

Both get g^(ab) mod p — that is, the same number. An eavesdropper, however, only sees p, g, A, B and cannot find a (the discrete logarithm problem).

Below, Alice's private number a has accidentally been exposed. Calculate the shared secret s:

p = 1113764753
g = 3

a = 748479285    # Alisaning maxfiy soni
A = 521666560    # Alisa jo'natgan
B = 1055302623   # Bob jo'natgan

Assemble the flag like this: BAYROQ{DH_umumiy_sir_<s>} — where <s> is the shared secret in decimal format.

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

First solvers

1. Абдул 08.09.2026
2. Лазиз 04.10.2026
3. Mirjaxon Qaxxarov 27.10.2026
4. Odam 04.11.2026
5. Doston Allayarov 12.11.2026
6. Maftuna 13.11.2026
7. Jasmin Xuseinova 15.11.2026
8. akobir 15.11.2026
9. jasmina_05 16.11.2026
10. Sevara 17.11.2026