Home
Writeups Misc About
Crossed Wires

Crossed Wires

We are given N, e, d of the sender and N, e of his friends. The flag is encrypted using the friend's public keys e1, e2, ..., e5 under the same modulo N.

As seen in this link, we can factorise N given e, d using the given algorithm. From that, decrypting the plaintext should be trivial.

Sage Implementation (slight modification and this can work on Python too)

Another acute observation by Draco on Cryptohack, is that we do not actually need to factor N. Indeed, denote e1,e2,e3,e4,e5 as the public exponents of the friends. If we encode the flag as the integer m, we have the ciphertext c as

c=me1e2e3e4e5modN

Since we are given e,d, we have ed=kϕ(N). Suppose we have mx=cmodN, then we can compute y=x1modkϕ(N). From this, we actually have xy=1modϕ(N), hence cy=mxy=mmodN.

This lead to this insanely short solution: