---
# System prepended metadata

title: basic-mod2-100pt
tags: [picoCTF, 從零開始的 picoCTF, Cryptography, picoCTF2022]

---

# basic-mod2-100pt
[題目在這](https://play.picoctf.org/practice/challenge/254?originalEvent=70&page=1)
## 題意

![](https://i.imgur.com/pDwdCB8.png)


## 解題思路

code 如下
 
```python=
import string

key = string.ascii_uppercase + string.digits + "_"
text = []
result = ''
with open('message.txt','r') as f:
    s = f.readline().strip(' ')
    text = s.split(' ')

for i in range(len(text)):
    char = int(text[i])
    result += key[pow(char, -1, 41)-1]

print(result)
```

## 困難之處

一開始我很快了的拿前一題的 code 來改，一直過不了看了別人用 pow(x, -1 ,41)，覺得很奇怪 pow 是用來算次方的，阿 -1 是倒數，仔細從看了題目說明 "inverse"，喔，那沒事了...Orz

Date : 2023/04/12
###### tags: `picoCTF2022` [`從零開始的 picoCTF`](https://hackmd.io/-KQeDuzrQMOcFNhwU_5eKA?both=) `picoCTF` `Cryptography` 