# Baby Encription

Platform: HTB.

Mission: Desencripte The especial message.

* Unzip the carpet, you will have 2 files one python with the logic to encript the flag and the other with the flag encripted. descomprime la carpeta, encontraras dos archivos 1 sera el codigo python que tiene la logica de la encriptacion de la flag y la otra sera la flag encriptada.

<figure><img src="/files/zF8D5H3rNzP00nTV510f" alt=""><figcaption><p>The content of both files.</p></figcaption></figure>

La solución seria, cambiar la ecuacion para que la flag se otorgue en texto leible. the solution is change the ecuation so you can have the flag desencripte.&#x20;

```
// 
fd = open(‘./msg.enc’,’r’)

secret = fd.read()
ct = bytes.fromhex(secret)

decrypted_str = “”

for char in ct:
for brute_val in range(33, 126):
if ((123 * brute_val + 18) % 256) == char:
decrypted_str += chr(brute_val)
break

print(decrypted_str)
```

Execute the script:

```
// 
HTB{l00k_47_y0u_r3v3rs1ng_3qu4710n5_c0ngr475}
```

Y tendriamos la flag, and we get the flag.


---

# 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://henrys-writeups.gitbook.io/owo/ctfs/baby-encription.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.
