mod26 picoctf

PicoCTF — Mod 26

Introduction

This is one of the first challenges that the authors present to us on PicoCTF platform. Let’s see what the challenge is about:

Overview and Solving

The challenge is pretty straightforward—it’s all about Cryptography and specifically focuses on the ROT13 cipher. ROT13 is often one of the first ciphers people come across when learning about cryptography because it’s simple yet really helps understand the basic ideas behind ciphers.

With ROT13, you’re essentially swapping letters in a message with the 13th letter after each letter in the alphabet. For instance, if you take the letter ‘A’ and count 13 letters after it, you end up on the letter ‘N’. So, applying ROT13 to ‘ABC’ would give you ‘NOP’. You can also choose a different starting point to cipher the message.

The challenge provides a ciphered message in red, which we’re supposed to decode. Given that all PicoCTF solutions begin with ‘picoCTF’, we know that these letters are transformed into ‘cvpbPGS’. Using this, we can figure out the rest of the letters.

There’s a simple Python script that helps find the solution.

# initial encrypted text
flag = "cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_MAZyqFQj}"

# A-Z
AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

# a-z
az = "abcdefghijklmnopqrstuvwxyz"

# string to store result
s = ""

# iterate through encrypted flag
for x in flag:
    # if the character is in AZ
    if x in AZ:
        # go 13 characters further from the current character
        s += AZ[(AZ.index(x)+13)%len(AZ)]
        # if the character is in az
    elif x in az:
        # go 13 characters further from the current character
        s += az[(az.index(x)+13)%len(az)]
    else:
        # else add the character
        s += x

# print string
print(s)

Conclusion

The solution to the challenge is:

picoCTF{next_time_I’ll_try_2_rounds_of_rot13_aFxtzQWR}

If you enjoyed this solution, I’d appreciate it if you could follow my channel. I’ll keep posting solutions and staying updated with new challenges as much as possible!


Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions or brave browser to block ads. Please support us by disabling these ads blocker.Our website is made possible by displaying Ads hope you whitelist our site. We use very minimal Ads in our site

 

Scroll to Top