Tags: rsa number_theory 

Rating: 4.0

We have:
```
(1) e1 * d = 1 (mod phi)
(2) e2 * (d + 2) = 1 (mod phi)
```
Multiply (2) by e1 and (1) by e2 and subtract them:
```
2 * e1 * e2 = e1 - e2 (mod phi)
```
That means `2 * e1 * e2 - (e1 - e2)` is a multiple of `phi`, and can be used to calculate `d`, like what we normally do:
```
d = inverse(e1, 2 * e1 * e2 - (e1 - e2))
```
Now you know the rest:
```
pt = pow(c, d, n)
print(long_to_bytes(pt))
```
Flag: `TWCTF{even_if_it_is_f4+e}`