178 words
1 minute
πŸ” PicoGym - rotation

πŸ“‚ Download challenge file.

Description: You will find the flag after decrypting this file. Download the encrypted flag here.
Difficulty: Medium
Author: Loic Shema

Summary#

This challenge uses the concept of a Caesar Cipher.
You are provided with an encoded message file named encrypted.txt and must decrypt it to recover the flag.

Decoding can be done manually by trying different shift keys or automatically using tools like Caesar Cipher.


Analysis#

The file encrypted.txt contains ASCII text:

Terminal window
$ file encrypted.txt
encrypted.txt: ASCII text

So its contents look like this:

xqkwKBN{z0bib1wv_l3kzgxb3l_555957n3}

Based on the format, this appears to be a rotation/shift cipher (like a Caesar cipher), because the beginning of the string xqkwKBN{ matches the flag format picoCTF{ after applying a shift.

I brute-forced the shift keys to find the correct one using the tool Caesar Cipher. The correct key is +8, which gvies the decrypted flag:

picoCTF{r0tat1on_d3crypt3d_555957f3}
⚑ Raikiri

πŸŽ‰ Flag pwned! The Caesar Cipher has been successfully decrypted.

alt text

πŸ’‘ TL;DR / Lesson Learned

The Caesar Cipher works by shifting letters by a fixed number of positions in the alphabet.
By identifying the correct shift key, we can reverse the encryption and recover the hidden flag.