> For the complete documentation index, see [llms.txt](https://writeups.ayweth20.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://writeups.ayweth20.com/2022/404ctf/crypto/un-simple-oracle-2-2.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
