PicoCTF2022 - basic-mod1
Description
We found this weird message being passed around on the servers, we think we have a working decryption scheme. Download the message here. Take each number mod 37 and map it to the following character set: 0-25 is the alphabet (uppercase), 26-35 are the decimal digits, and 36 is an underscore. Wrap your decrypted message in the picoCTF flag format (i.e. picoCTF{decrypted_message})
Information
Point Value: 100 points
Category: Cryptography
Hints
- Do you know what mod 37 means?
- mod 37 means modulo 37. It gives the remainder of a number after being divided by 37.
Solution
Looking at the txt file, we see that it consists of a line of multiple numbers. We want to take the modulo 37
of this, meaning we will divide each number by 37 and take the remainder. Then, we will map each number to the
given character set (ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_). This will give us a string that we can then put
back in as a flag. We can create a simple Python program that translates these instructions into code. Running
the following Python program gives us the flag.
charString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
with open('basicMod1.txt') as f:
lines = f.readline()
nums = lines.split()
flag = ""
for x in nums:
flag += charString[int(x) % 37]
print("picoCTF{"+flag+"}")