DL·SYS
Contact ↗

CSCTF 2026 · Crypto · 270 pts

The Courier's Keys.

Nine radios' RSA keys share no common factor pairwise — but their prime generator's seed is only a few thousand epochs wide to search.

RSAMT19937 seeding
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryCrypto
Points270
StatusSolved during the event
Targetcourier pcap, offline

TL;DR. A broadcast in the capture reveals the key-generation recipe: seed Python's Mersenne Twister with `(power_up_epoch << 16) | serial`, then take the first 512-bit odd prime candidate with the top bit set. Checking every pair of the nine moduli for a shared factor found nothing — but brute-forcing the unknown boot epoch and re-deriving one radio's expected prime from the known serial finds the exact epoch that divides its modulus.

Challenge

Nine field radios register with RSA public keys; one ciphertext is addressed to serial 6631. Recover the plaintext order.

Solution

A UDP broadcast in the pcap gives the full recipe: seed = (power_up_epoch << 16) | serial, feed that into Python's random.Random (Mersenne Twister), and take the first 512-bit odd prime candidate with the top bit set as p, then the next as q. Nine radios each broadcast a registration with their modulus N and exponent e=65537.

Checking every pair of the nine moduli for a shared factor via GCD found nothing — the radios don't share primes with each other. Instead, brute-forcing the boot epoch directly: seed random.Random((epoch << 16) | 6631) for every second in a window around the capture's timestamp, generate the expected first prime, and test whether it divides serial 6631's modulus. One epoch, 1699994067, factors the modulus cleanly, and standard RSA decryption with the recovered p/q gives the flag.

Flag

FlagCSCTF{01_advance_on_the_mill_a7c3f1}

What I took from it