DEV Community

Falme Streamless
Falme Streamless

Posted on

[Hack] picoCTF - Mod 26

This is a challenge from the picoCTF picoGym, the challenge description follows:

"Cryptography can be easy, do you know what ROT13 is? 
Enter fullscreen mode Exit fullscreen mode

This is pretty straightforward, we can use a website to decrypt the ROT13 encrypted message.

But in this case, I used a bash script to do this for me. Here's the script:

# Tring to find a flag using ROT13
# Where $1 is cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_uJdSftmh}

echo "== ROT13 =="
echo ""
output=$(echo "$1" | tr 'N-ZA-Mn-za-m' 'A-Za-z')
echo "${output}"
Enter fullscreen mode Exit fullscreen mode

The tr command is a substitution command, in this case, we will make the A to be N, B to be O and so on. This is the meaning of ROT13, it will shift each char 13 places:

Image description

It's bidirectional, so no worries of the ordering.

Running the script, the flag is revealed:

Flag : picoCTF{next_time_I'll_try_2_rounds_of_rot13_hWqFsgzu}

Top comments (2)

sc0v0ne profile image

Very good post!!!

falme profile image
Falme Streamless

Thanks!! :DDD