Aug-08-2022, 07:24 PM
(This post was last modified: Aug-08-2022, 07:24 PM by deanhystad.)
All the steps can be reversed, even the exclusive or (^ 0xb). If you invert everything and perform the steps in reverse order you can find the starting string. I wrote an rbig() and tested if rbig(big(str)) == str. I did the same for bang(). Of the two, I found bang() easier to reverse, so maybe start with that.
The first thing I did was write a comment to describe each step. For example, this removes that last character, swaps the case of the remaining characters, then inserts the old trailing character as the first character.
The starting string looks like gibberish, so if you get a gibberish result from your code breaking don't assume it must be wrong. Test your results by running through the check.
The first thing I did was write a comment to describe each step. For example, this removes that last character, swaps the case of the remaining characters, then inserts the old trailing character as the first character.
enc[-1] + enc[:-1].swapcase()The reverse would be remove the first character, swap all the remaining characters, then append the old leading character as the last character.
The starting string looks like gibberish, so if you get a gibberish result from your code breaking don't assume it must be wrong. Test your results by running through the check.