SUTD Capture the Flag Competition


SUTD CTF Tournament was an in-house CTF competition that aimed to introduce students to the basic concepts of ciphers and encryptions. Teams were given a chance to create a CTF challenge as well get the flags of other team's challenges.

My team created a challenge that consisted of two layers, a substitution cipher and a transposition cipher.

The attacker has to first solve the substitution cipher provided by the Enigma stage, before solving the transposition cipher provided by the Rubik's Cube stage.

For this project, I was in charge of the logic behind the Enigma stage, as well as coding most of the backend infrastructure for students to solve the challenge.

Stage 1 - Enigma

In this task we converted the Enigma Machine into Python and gave it to the student to pass through different keys and values. The Enigma machine was merely a really complex substitution cipher, and as such we wanted students to learn the history and break the code the same way Alan Turing did it (albeit with fast computers). Students were given the cipher, the first few letters of the answer and the Python Enigma Machine code.
After learning about the history, students will understand that by using the first few letters of the decrypted answer, together with the cipher, they are able to brute force the key out and attain the rest of the encrypted answer.

Stage 2 - Rubik's Cube

The Rubik's Cube stage was the simpler out of the two stages.

The cipher provided by Stage 1 would be mappable onto a given mixed-up Rubik's Cube. OpenCV was used to simulate the cube. The key only had 12 letters, each corresponding to a different type of Rubik's Cube turn. Students were tasked to solving the transposition cipher by solving the Rubik's Cube. By understanding how the Rubik's cube can be solved, they would obtain the key, thus solving the ciphered text.

However smarter groups noticed that it was pointless to solve the Rubik's cube, and instead, just moved cipher around based on the mapping provided by the mixed-up Rubik's Cube.