# Evil Cipher

### Enoncé

Evil Country a développé et implémenté sur FPGA son propre algorithme de chiffrement par blocs de 45 bits avec une clé de 64 bits. cipher.txt est un message chiffré avec la clé key=0x4447534553494545. Un agent a réussi à récupérer

* le code VHDL de l'algorithme (evil\_cipher.vhd)
* la fin du package VHDL utilisé (extrait\_galois\_field.vhd)
* le schéma de la fonction permutation15 (permutation15.jpg)
* le schéma du composant key\_expansion (key\_expansion.jpg)

Un exemple de texte chiffré se trouve dans le fichier evil\_example.txt (dans l'archive zip)

Déchiffrez le message.

Le flag est de la forme DGSESIEE{x} avec x un hash

evil\_cipher.zip (SHA256=0b8ade55e61e2e0188cea2a3c004287ca16b9b1ee2951fa4ffe1b27963544434) : <https://challengecybersec.fr/d3d2bf6b74ec26fdb57f76171c36c8fa/evil_cipher.zip>

### Solution

Voir : <https://pt0m.github.io/write-ups/evil-cipher>


---

# 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://challenge-friang.gitbook.io/challenge-brigitte-friang/coros-ctf/evil-cipher.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.
