In [1]:
from challenge import checkAnswer
In [3]:
checkAnswer('this_was_a_bad_idea_from_thestart')
Out[3]:
In [3]:
with open('/usr/share/dict/words') as fobj:
words = fobj.read().split()
In [4]:
for word in words:
if checkAnswer(word):
print(word)
In [88]:
passw = 'this_was_a_bad_idea_from_the'
i = passw.split('_')
In [89]:
len(passw) != 33
Out[89]:
In [90]:
i[0] = [ord(char) - 96 for char in i[0]]
i
Out[90]:
In [91]:
ord('a') - 96
Out[91]:
In [92]:
import string
for l in string.ascii_letters:
x = ord(l) - 96
if x == 20:
print(l, 20)
if x == 8:
print(l, 8)
if x == 9:
print(l, 9)
if x == 19:
print(l, 19)
In [93]:
if not i[0] == [20, 8, 9, 19]:
print(False)
In [94]:
import base64
base64.b64encode(bytes(i[1]))
if base64.b64encode(bytes(i[1])) != 'd2Fz':
print(False)
In [95]:
if int((' '.join(format(ord(x), 'b') for x in i[2]))) != 1100001:
print(False)
In [96]:
n[3].split('a')[0] != 'b'
n[3].split('a')[1] != 'd'
Out[96]:
In [97]:
if not n[3].split('a')[0] != 'b' and n[3].split('a')[1] != 'd':
print(False)
In [98]:
print('69'.decode("hex"))
print('646561'.decode('hex'))
In [99]:
if int(n[4][0].encode('hex')) != 69 and int(n[4][1:].encode('hex')) != 646561:
print(False)
In [100]:
n[5].startswith('fr')
int(n[5]) < 1
int(n[5]) != 0
n[5].endswith('m')
In [101]:
if not n[5].startswith('fr') and not int(n[5]) < 1 and not int(n[5]) != 0 and not n[5].endswith('m'):
print(False)
In [102]:
if not n[6].encode('rot13')[0] == 'g' and n[6].encode('rot13')[1:] != 'urfgneg':
print(False)
In [103]:
u = n
if u.count('_') > 6 and not u.count('_') == 5:
print(False)
In [10]:
passw = 'this_was_a_bad_idea_from_the_star'
i = passw.split('_')
i
Out[10]:
In [11]:
print(len(passw))
if len(passw) != 33:
print(False)
In [12]:
i[0] = [ord(char) - 96 for char in i[0]]
if not i[0] == [20, 8, 9, 19]:
print(False)
if base64.b64encode(bytes(i[1])) != 'd2Fz':
print(False)
if int((' '.join(format(ord(x), 'b') for x in i[2]))) != 1100001:
print(False)
In [13]:
n = i
if not n[3].split('a')[0] != 'b' and n[3].split('a')[1] != 'd':
print False
if int(n[4][0].encode('hex')) != 69 and int(n[4][1:].encode('hex')) != 646561:
print False
In [14]:
n = i
if not n[5].startswith('fr') and not int(n[5]) < 1 and not int(n[5]) != 0 and not n[5].endswith('m'):
print False
if not n[6].encode('rot13')[0] == 'g' and n[6].encode('rot13')[1:] != 'urfgneg':
print False
In [15]:
u = n
if u.count('_') > 6 and not u.count('_') == 5:
print False
In [16]:
checkAnswer(passw)
Out[16]:
In [ ]: