Skip to content
Adam Omar Saleh

hiCTF 2026 placeholder badge (unofficial)hiCTF 2026Cryptography

Log Jam

Diffie-Hellman weakness / AES recovery

Competition
hiCTF 2026 placeholder badge (unofficial)hiCTF 2026
Category
CryptographyMedium · estimated
Analysis status
Flag recovered
Document
Original PDF

01Challenge analysis

The problem

The key exchange looked like ordinary Diffie-Hellman, but the secret exponent had a small enough effective search range to recover the session key.

02Exploit or recovery path

How I solved it

  1. 01

    I inspected the challenge parameters and found that the Diffie-Hellman private exponent was drawn from a restricted 71-bit space.

  2. 02

    I used the small-exponent property to recover the private value, rather than attacking a full-strength discrete logarithm in the intended large group.

  3. 03

    I computed the matching shared secret from the public exchange and followed the challenge key-derivation method to recover the AES key.

  4. 04

    I decrypted the encrypted payload and obtained the hiCTF flag.

Result

RECOVERED FLAG

hiCTF{W0W1_y0u_4ctu4a11y_s01v3d_1t_ju$t_L1k3_tH4t}

Flag recovered

Local Verification
Flag recovered in the archived solving session; server acceptance not documented.
Evidence Limitation
The underlying parameters, key derivation byte layout, and brute-force script are not available in the retained summary.

Original document

Original PDF

The writeup as I first documented it.