diff --git a/basic_mod1/message.txt b/basic_mod1/message.txt new file mode 100755 index 0000000..940caf6 --- /dev/null +++ b/basic_mod1/message.txt @@ -0,0 +1 @@ +128 322 353 235 336 73 198 332 202 285 57 87 262 221 218 405 335 101 256 227 112 140 \ No newline at end of file diff --git a/basic_mod1/sol.py b/basic_mod1/sol.py new file mode 100755 index 0000000..f086db4 --- /dev/null +++ b/basic_mod1/sol.py @@ -0,0 +1,19 @@ +#!/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 %= 37 + if i <= 25: + dec += chr(ord('a') + i) + elif i <= 35: + dec += chr(ord('0') + i - 26) + elif i == 36: + dec += '_' + print(dec) +