CryptographyLevel 3★★★☆☆80 pts

Cryptanalysis - Diffie-Hellman with a Small Prime

Mission

An old IoT device performed Diffie-Hellman key exchange with a prime p of only 36 bits. handshake.txt contains p, g, A = g^a mod p, B = g^b mod p and configuration data encrypted with a keystream derived from the shared key. Solve the discrete logarithm, recover the shared key and extract the flag from the configuration data. README.md explains how the keystream is built.

#cryptography#diffie-hellman#discrete-log#bsgs