Rating:

### Solution:
In this challenge, we are given an encrypted txt file in the form of a 2D square array. We are also given a program by which the encryption happened. We have to understand the code and reverse it to decrypt the encrypted file to get the original txt and possibly our flag.

When you open the code in Ghidra, you will find a lot of if-else statements. These were the if-else statements used to encrypt the file. Upon understanding the code, we realize that this code depends on whether the given element is prime or divisible by 2, 3, or 5. This is a form of Markov chain which decides its next state depending on the divisibility of current elements. Once we reverse the code, we get the decrypted 2D matrix in spiral form and, fortunately, our flag.

```
Flag:
VishwaCTF{4nd23y_4nd23y3v1ch_m42k0v}
```

Original writeup (https://github.com/CyberCell-Viit/VishwaCTF-24-Writeups/blob/main/VishwaCTF'24/Reverse%20Engineering/Sandese%20Aate%20Hai.pdf).