# ASCON Marchombre

**Catégorie:** Cryptanalyse - **Difficulté:** Facile

**Description:**

<figure><img src="/files/45XjQSQ7jPa4mFCeyh57" alt=""><figcaption></figcaption></figure>

* Clef : *`00456c6c616e61206427416c2d466172`*
* Nonce : *`0`*
* Message chiffré : *`ac6679386ffcc3f82d6fec9556202a1be26b8af8eecab98783d08235bfca263793b61997244e785f5cf96e419a23f9b29137d820aab766ce986092180f1f5a690dc7767ef1df76e13315a5c8b04fb782`*
* Données associées : *`80400c0600000000`*

**Solution:**

Pour ce challenge, quelques données nous sont fournies ainsi que le nom de la méthode de chiffrement : ASCON.

En cherchant rapidement sur internet, nous trouvons un [package pypi](https://pypi.org/project/ascon/) à installer pour pouvoir l'utiliser dans un programme python.

Il n'y a pas grand chose à détailler ici à part donner le script utilisé.\
Voici donc le code que j'ai utilisé pour résoudre ce challenge en suivant des exemples trouvés sur internet :&#x20;

```python
import ascon


key = bytes.fromhex("00456c6c616e61206427416c2d466172")
nonce = bytes.fromhex("00000000000000000000000000000000")
data = bytes.fromhex("80400c0600000000")
cipher = bytes.fromhex("ac6679386ffcc3f82d6fec9556202a1be26b8af8eecab98783d08235bfca263793b61997244e785f5cf96e419a23f9b29137d820aab766ce986092180f1f5a690dc7767ef1df76e13315a5c8b04fb782")

print(f"Key: {key}")
print(f"Nonce: {nonce}")
print(f"Ciphertext: {cipher}")
print(f"Data: {data}")

# Decrypt
plaintext = ascon.decrypt(key, nonce, data, cipher, variant="Ascon-128")
print(f"Plaintext: {plaintext}")
```

Lorsque nous exécutons ce script, voici le résultat :&#x20;

<figure><img src="/files/SkYmHoY2e8bWslFIoEPn" alt="" width="563"><figcaption></figcaption></figure>

Nous pouvons donc récupérer le flag en fin d'exécution en remplaçant le *`\xe8`* par son caractère unicode : *`è`*

<details>

<summary>🚩 FLAG</summary>

```
404CTF{V3r5_l4_lum1èr3.}
```

</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/2023/404ctf-2023/cryptanalyse/ascon-marchombre.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.
