> For the complete documentation index, see [llms.txt](https://ravins-organization.gitbook.io/ctf-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ravins-organization.gitbook.io/ctf-writeups/2024/gryphons-ctf-2024/crypto/eeeeeeee.md).

# EeeeeeeE

Someone deleted p and q from the database! Help me decrypt the data back

I was given the value of the ciphertext and e but nothing else... So how was i supposed to decode this?

Since the public exponent is small (in this case where e = 3), we can perform a Low Exponent Attack, where if the plaintext message , m is small enough such that m^e < n, the ciphertext ct becomes m^e.

Refer to this vid for more

{% embed url="<https://www.youtube.com/watch?v=73oKv-8bPp0>" %}

Solve script

```python
import gmpy2

ct = 18954407074192125221394737376445869042049957165800358125100341212588095954517427811818212451816506973526646008065898871179845615654617950161581812936335489125
e = 3

m, exact = gmpy2.iroot(ct, e)

print(f"Plaintext (integer): {m}")
plaintext = m.to_bytes((m.bit_length() + 7) // 8, 'big')
print(f"Plaintext (decoded): {plaintext.decode()}")
```

The output being

```
Plaintext (integer): 26662655490478048037517590082413291289773937194185085
Plaintext (decoded): GCTF24{e_1s_t0o_sM@l1}
```

Thus the flag is applicable if `GCTF24{e_1s_t0o_sM@l1}`&#x20;
