basic-mod1
Description
We found this weird message being passed around on the servers, we think we have a working decrpytion 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}
)
Solving this challenge
- This challenge is an easy one, just some math.
- Taking the numbers from the downloaded messages.txt and modulo them with
37
- In the script solve.py we do the math and get the decoded message
#!/usr/bin/env python
## Defining the variables
charset = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","_"]
flag = "picoCTF{"
encfile = "message.txt"
print("Try to decrypt file " + encfile)
## Open message.txt and doing the math
with open(encfile, 'r', encoding='utf-8') as file:
for line in file:
numbers = line.split()
for number in numbers:
# Here we add the corresponding character to the calculated number
flag = flag + (charset[int(number)%37])
print("If anything worked... this should be the flag...")
## Adding the closing quirly braces
print(flag + "}")
Output
./solve.py
Try to decrypt file message.txt
If anything worked... this should be the flag...
picoCTF{r0und_n_r0und_ce58a3a0}