Crypto 200 - 3ManyNumbers
Writers: Jacob Edelman and Alex Heifler
Flag: three_digits_isnt_very_secure
The key to this problem is realizing that each number only has the digits "0", "1", and "2", just like ternary (base 3) numbers. This is also alluded to by the name (a pun on "Too many numbers", though not a very good pun). A single very simple modification to the solution to text2numbers would then suffice.
code = "22 12 200 12 1000 212 12 1000 210 201 12 1000 202 12 200 112 1 200 221 1000 202 120 1000 21 12 202 1000 202 22 12 1000 20 110 1 21 1000 202 22 200 12 12 1001 11 100 21 100 202 201 1001 100 201 112 202 1001 211 12 200 221 1001 201 12 10 210 200 12"
text = ""
for x in code.split(" "):
num = int(x, 3)
print(num)
if num == 27:
text += " "
elif num == 28:
text += "_"
else:
text += chr(num+96)
print(text)