Skip to main content
Challenges Export-grade Diffie-Hellman
Cryptography Hard DH attacks Solves: 8

Export-grade Diffie-Hellman

Author: CyberSamSU
Points
110

In the 1990s, US export laws prohibited the export of strong cryptography, so deliberately weakened "EXPORT" modes were added to protocols: for DH, p was only 512 bits. Even after the law was repealed, these modes remained on servers for years.

In 2015, the Logjam attack showed that a man-in-the-middle can "downgrade" the server to DHE_EXPORT during the TLS handshake — and the client will not notice this because the handshake messages are not protected. And with a small p, the discrete logarithm can be solved.

In our record, p has been made even smaller (42 bits for educational purposes), so it can be cracked even on a regular laptop. Session record: tls_yozuv.txt. The task is to decrypt the HTTP request and read the session cookie.

The session key was derived as follows:

import hashlib
def kdf(s: int) -> bytes:
    return hashlib.sha256(str(s).encode()).digest()   # 32 bayt

from Crypto.Cipher import AES
from Crypto.Util.Padding import pad

s = pow(B, a, p)                       # DH umumiy sir
shifr = AES.new(kdf(s), AES.MODE_CBC, iv).encrypt(pad(sorov, 16))

Here no secret number is given — you must first solve the discrete logarithm.

Attached files
tls_yozuv.txt Log in to download
SHA-256 checksums
tls_yozuv.txt: 7339e82b7bc75e28ac3063fe61cc6479831bac1f000fdfe983e9068b6abca939
Theory: learn the topic
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −11 pts Log in
Hint 2 −22 pts Log in
Hint 3 −33 pts Log in
To submit a flag, log in.

First solvers

1. Stiv_084100 11.09.2026
2. W.o.X 17.09.2026
3. Лазиз 01.10.2026
4. testrejim 09.10.2026
5. 11111tttt 09.10.2026
6. Mirjaxon Qaxxarov 26.10.2026
7. Odam 04.11.2026
8. arcanum 11.11.2026