crypto: add a few more challenges
This commit is contained in:
1
crypto/basic_mod1/message.txt
Normal file
1
crypto/basic_mod1/message.txt
Normal file
@@ -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
|
22
crypto/basic_mod1/solve.py
Executable file
22
crypto/basic_mod1/solve.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# 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.
|
||||
|
||||
with open('message.txt') as file:
|
||||
content = file.read().strip()
|
||||
|
||||
print("picoCTF{", end="")
|
||||
for n in content.split(' '):
|
||||
number = int(n)
|
||||
number %= 37
|
||||
if number < 26:
|
||||
print(chr(number + ord('A')), end="")
|
||||
elif number >= 26 and number < 36:
|
||||
print(number - 26, end="")
|
||||
elif number == 36:
|
||||
print('_', end="")
|
||||
else:
|
||||
print()
|
||||
print(f"Code author seems to have forgotten a number.... {number}")
|
||||
exit(1)
|
||||
print("}")
|
Reference in New Issue
Block a user