DEV Community

loading...
Cover image for picoCTF 2021 -Mod 26 writeup-

picoCTF 2021 -Mod 26 writeup-

dandan profile image Shitian Daxiang ・1 min read

Description

Cryptography can be easy, do you know what ROT13 is?

cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_hyLicInt}

Solution

ROT13 is a method of encrypting textual information, in which all the letters of the alphabet are shifted by 13.
In ROT13, the 26 letters of the alphabet are shifted by exactly half to make the text unreadable while preserving the meaning of the string. If the string converted by ROT13 is run through ROT13 again, the string will return to its original state.

Let's use the nkf command to solve the problem in one-liner.

$ echo "cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_hyLicInt}" | nkf -r
Enter fullscreen mode Exit fullscreen mode

This gives us the following flags.

picoCTF{next_time_I'll_try_2_rounds_of_rot13_ulYvpVag}
Enter fullscreen mode Exit fullscreen mode

nkf stands for "Network Kanji Filter," and is a command for converting character codes and newline codes, which can be a problem when exchanging text data between different operating systems, such as Linux and Windows [1].

The option "-r" means the decryption process by ROT13, which can be decoded by ROT13 just by adding it to nkf.

Conclusion

In this article, I solved the cipher of ROT13 by nkf. In fact, if you want to determine ROT13 without any hint from the problem text, you can check it with a frequency analysis[2]. Here is the reference.

Reference

[1] "nkf(1) - Linux man page",https://linux.die.net/man/1/nkf

[2] Andress, Jason. The basics of information security: understanding the fundamentals of InfoSec in theory and practice. Syngress, 2014.

Discussion (0)

Forem Open with the Forem app