1n_jection
Problem
COVID: *exists* vaccine jokes: *challenge_name*
Solution
We are given the source code and the output:
Rearranging,
Then, we have
Using this knowledge, I implemented the following:
Last updated
COVID: *exists* vaccine jokes: *challenge_name*
We are given the source code and the output:
Rearranging,
Then, we have
Using this knowledge, I implemented the following:
Last updated
By studying the code, we can see that this is basically a recursive algorithm that divides the bytestring into two halves at each layer, until the base case where there are either 1 or 2 characters left. We can clearly see that at each layer, the result can be expressed as
where and are the results of calling the function on the lower and upper half of the input respectively. For each layer, if we are able to recover and from , then we would be able to repeat this all the way until the base case, where we would be able to recover the ASCII characters.
I also noticed one other thing. If we start off with some value of and , then increment by while decrementing by the same amount, then we have
is incremented by the same amount, .
Then, since and are essentially the outputs of the "previous" layer, we can create a recursive function that terminates at the base case where we have reduced the output to its original ASCII characters.
Here's the output. This probably wasn't the intended solution, since the flag talks about a bijection from to .