PicoCTF 2022 - basic-mod1

From: picoCTF 2022


Challenge

Points - 100
Category - Cryptography

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})

Message

The message contains a series of numbers

91 322 57 124 40 406 272 147 239 285 353 272 77 110 296 262 299 323 255 337 150 102 

We will need to use the modulo formula to get our numbers down to the 0-37 range.

Modulo formula

The modulo formula is:

x mod y = r

x = dividend
y = divisor
r = remainder

Example:
91 % 37 = 17

Take the original number (91) and subtract the modulo number (37) until you cannot subtract it anymore. The left over number is your new number.

Methodology

Option 1 - Online tools

  • Stage 1: Use the decoder here
    17 26 20 13 3 36 13 36 17 26 20 13 3 36 0 3 3 27 33 4 2 28
  • Stage 2: Substitute Numbers and Letters per the instructions in the description

Option 2 - 2-stage Python script

  • Stage 1: Use a modulo formula to run through the list of original numbers and output to a new variable
      nums = [91,322,57,124,40,406,272,147,239,285,353,272,77,110,296,262,299,323,255,337,150,102]
      decoded = ""
    
      for number in nums:
          decoded += (str(number % 37)+ ',')
          print(decoded)
    
  • Stage 2: Use new list with the ranges from the description.

      characters = ['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','_']
      list = [17,26,20,13,3,36,13,36,17,26,20,13,3,36,0,3,3,27,33,4,2,28]
      flag = ""
    
      for i in list:
          flag += characters[i]
          print('picoCTF{' + flag + '}')
    

Flag

picoCTF{R####################2}


Tags: CTF  picoCTF  Cryptography 

Written on March 28, 2022