# Un simple oracle \[2/2]

**Category:** Cryptanalysis - **Points:** 991 - **Difficulty:** Medium - **Solves:** 106

**Description:**

Bonjour agent, Suite à votre récente découverte, nous avons pu extraire beaucoup d'informations de ce serveur. Malheureusement, ce service a fermé il y a une semaine, et vient juste de réouvrir après ce qui a été vraisemblablement une mise à jour de sécurité, et il ne semble plus possible d'accéder au secret. Pourriez-vous faire quelque chose?

`nc challenge.404ctf.fr 30594`

**Solution:**

For the second part of this challenge, we do not have the modulus. So we have to calculate it. We have E(x)=x^65537−k⋅n, for some integer k (which will be different for different values of x), and the unknown modulus n. Hence, x^65537−E(x) will always be a multiple of n. So, compute:

gcd(E(2)^2 − E(4), E(3)^2 − E(9))

By applying this method, we can then find n and thus repeat the Chosen Plaintext Attack operation to find the flag.

<details>

<summary>🚩 FLAG</summary>

```
404CTF{L3_m0dul3_357_t0uj0ur5_7r0uv4bl3}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://writeups.ayweth20.com/2022/404ctf/crypto/un-simple-oracle-2-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
