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.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Crypto |
| Points | 270 |
| Status | Solved during the event |
| Target | courier 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
CSCTF{01_advance_on_the_mill_a7c3f1}What I took from it
- A deterministic PRNG used to generate 'random' primes turns an RSA factoring problem into a seed-search problem the moment any part of the seed (here, the serial number) is public.