> For the complete documentation index, see [llms.txt](https://codingmace.gitbook.io/masterward/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codingmace.gitbook.io/masterward/ctf/2019/crypto-2019.md).

# Crypto CTF 2019

## Decode Me! - Crypto \[122 pts] <a href="#decode-me" id="decode-me"></a>

> &#x20;**Decode me!** D: mb xwhvxw mlnX 4X6AhPLAR4eupSRJ6FLt8AgE6JsLdBRxq57L8IeMyBRHp6IGsmgFIB5E :ztey xam lb lbaH

I reversed the string because it looked like it needed and got `Habl bl max yetz: E5BIFgmsGI6pHRByMeI8L75qxRBdLsJ6EgA8tLF6JRSpue4RALPhA6X4 Xnlm wxvhwx bm :D` \
Which by the smiley face I know I did something right. I did rot and closest I found was ROT7\
`Ohis is the flag: L5IPMntzNP6wOYIfTlP8S75xeYIkSzQ6LnH8aSM6QYZwbl4YHSWoH6E4 Eust decode it :K`\
Some of that was right but the middle was not base64  and capital was wrong so I went back and checked to get the first letter to T and that was ROT12\
`This is the flag: Q0NURntzSU1wTDNfYlU3X20xeDNkXzV1QnM3aXR1VDEwbl9DMXBoM1J9 Just decode it :P`\
And finally, decode it using base64. Below is the code that helped me do all this.

```python
cipher = "D: mb xwhvxw mlnX 4X6AhPLAR4eupSRJ6FLt8AgE6JsLdBRxq57L8IeMyBRHp6IGsmgFIB5E :ztey xam lb lbaH"
print("Original Cipher: ", cipher)
cipher = cipher[::-1]
print("Cipher Reversed: ", cipher)
decoded_cipher = ""

for i in range(len(cipher)):
    val = ord(cipher[i])
    if cipher[i].isupper():
        val += 12
        if val > ord('Z'):
            val -= 26
        decoded_cipher += chr(val)
    elif cipher[i].islower():
        val += 7
        if val > ord('z'):
            val -= 26
        decoded_cipher += chr(val)
    elif cipher[i].isdigit():
        val = ord('0') + (int(cipher[i])+ 5) % 10
        decoded_cipher += chr(val)
    else:
        decoded_cipher += cipher[i]

print(decoded_cipher)
```

**Flag: CCTF{sIMpL3\_bU7\_m1x3d\_5uBs7ituT10n\_C1ph3R}**


---

# 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://codingmace.gitbook.io/masterward/ctf/2019/crypto-2019.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.
