Challenges › Cryptography

The Hidden Channel

medium · 200 XP · flag · free · solves: 4

Two key pairs were generated on the same machine on the same morning, one for Alice and one for Bob. They insisted the keys had nothing in common. Each half of a secret message was encrypted under one of them, and each key on its own looked strong. But Heidi suspected the machine had been short of randomness that morning, and that the two keys quietly shared something they should never share. If they do, both keys fall together. Can you find the hidden link between them and put the secret message back together?

two RSA keypairs (~512-bit primes each, sympy for primality) generated with a shared prime `p` between both moduli (`n1=p*q1`, `n2=p*q2`) — simulating a real historical "insufficient entropy" key-gen bug. Split the flag into two halves, encrypt each (textbook RSA, fixed-width) under a different key. Ship both public keys and both ciphertexts, nothing else. Solver recovers `p` via `gcd(n1,n2)`, derives both private keys, decrypts, concatenates.

Tags: Cryptography

Try next