Pythonのプログラム chal.py が与えられた。
chal.py は、入力された文字列の最初と最後の部分をチェックした後、
残りの部分に関数 a から生成されるデータをxorし、結果が指定のものになるかをチェックするものだった。
そこで、まず、Pythonのインタラクティブモードを用い、以下のようにしてxorするデータを求めた。
A Python program chal.py was given.
chal.py first checks the first and last part of the input string.
Then, performs exclusive-or of the remaining part and data generated using a function a, and checks if the result is what is specified.
Seeing this, I firstly obtained the data for exclusive-or in this way, using the interactive mode of Python.
これを指定のデータとxorすることで、flagの一部が得られた。
I obtained a part of the flag by performing exclusive-or with the specified data.
Unescape string, XOR - CyberChef
これを sdctf{} で囲むことで、flagが得られた。
I obtained the flag by putting the result in sdctf{}.