basic-mod2
This commit is contained in:
1
basic_mod2/message.txt
Executable file
1
basic_mod2/message.txt
Executable file
@@ -0,0 +1 @@
|
|||||||
|
432 331 192 108 180 50 231 188 105 51 364 168 344 195 297 342 292 198 448 62 236 342 63
|
||||||
20
basic_mod2/sol.py
Executable file
20
basic_mod2/sol.py
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/home/maxime/.pyvenv/bin/python3
|
||||||
|
|
||||||
|
with open("message.txt", 'r') as f:
|
||||||
|
text = f.read().strip()
|
||||||
|
|
||||||
|
cipher = text.split(' ')
|
||||||
|
|
||||||
|
dec = ""
|
||||||
|
for i in cipher:
|
||||||
|
i = int(i)
|
||||||
|
i %= 41
|
||||||
|
i = pow(i, -1, 41)
|
||||||
|
if i <= 26:
|
||||||
|
dec += chr(ord('a') + i - 1)
|
||||||
|
elif i <= 36:
|
||||||
|
dec += chr(ord('0') + i - 27)
|
||||||
|
elif i == 37:
|
||||||
|
dec += '_'
|
||||||
|
print(dec)
|
||||||
|
|
||||||
Reference in New Issue
Block a user