We are given decimal numbers in the file message.txt and according to the description we have to wrap those numbers around 41 and then calculate the modular inverses of all of the resulting numbers.
Here’s the script:
message = [104, 372, 110, 436, 262, 173, 354, 393, 351, 297, 241, 86, 262, 359, 256, 441, 124, 154, 165, 165, 219, 288, 42]
alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
decoded = "".join([alphabet[pow(num % 41, -1, 41)] for num in message])
print(decoded)
The message list is the list of the numbers that I was given in the challenge.
I used the online Programiz Python Interpreter, ran the script and got the flag. I put it in the picoCTF{FLAG} format and submitted it.
Happy hacking!
Top comments (0)