THM - W1seGuy

Francesco Pastore
3 min readDec 6, 2024

A writeup for the room W1seGuy on TryHackMe.

Analyzing the code

The code in the room runs a basic encryption algorithm.

Initially, it reads the first flag from an external file and encrypts it using a key.

The encryption process involves performing an XOR operation between the flag and the key, repeating the key cyclically if it is shorter than the flag.

The encrypted flag is then displayed in hexadecimal format, where each byte of the flag is represented by two hexadecimal characters.

Finally, the machine prompts for the key. If the provided key is correct, it reveals a second flag.

Exploiting the bad encryption​

The key is 5 characters long, as can be seen in the code due to the k=5 parameter.

--

--

Francesco Pastore
Francesco Pastore

Written by Francesco Pastore

An engineering student in Milan and a web developer for an IT company. Write about programming and cybersecurity topics.

No responses yet