crypto: add a few more challenges

This commit is contained in:
2024-09-02 20:20:46 +02:00
parent dc6284f487
commit 92210003f6
15 changed files with 424 additions and 0 deletions

View 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
View 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("}")