# Decimal encoded values for the ciphertext
enc = [[9, 9, 12, 22], [3, 4, 26, 24], [27, 4, 30, 22]]
#list is the wordlist I used
f = open('list','r')
for line in f:
line=line[:-1] #Strip newline
line = line.upper() #The keys and text are in upper case
if len(line) == 4:
y = []
for x in enc:
a = [chr(x[i]^ord(line[i])) for i in range(0,4)]
a = ''.join(a)
y.append(a)
flag = True
for i in y:
if i.isalpha() == False:
flag = False
if flag == True and len(y) == 3:
print line+ ": ",
print y
One line in the output is: KEYS: ['BLUE', 'HACK', 'PAGE']
Enter "keys blue hack page" on the webpage to get your points