Tags: reverse-engineering crypto
Rating: 2.0
In this challenge, the source code goes through many steps to make the code's understanding difficult. However, by looking at how it initializes the array containing the flag, something can be noticed:
```py
def _a(self):
c = [self.s]
for i in range(self.t-1):
a = Decimal(random.randint(self.s+1, self.s*2))
c.append(a)
return c
```
In this case, `self.s` represents the flag, and we can observe that it is located at position `0` within the array when it is returned to the caller. \
Continuing to analyze the main function, the challenge allows us to read an element at position `x mod n`, where x is the input we provide and must be within the range `1 <= x <= n`. Now, if we want to retrieve the value at position 0, we just need to send the service an input of `x = n`, so that `x mod n = 0`.