Challenges 6 and 7
[cipher-tools.git] / 2013 / solutions.txt
1 # with open('2013/mona-lisa-words.txt') as f: mona_lisa_words = [line.rstrip() for line in f]
2 # keyword_break(c4a, wordlist=mona_lisa_words)
3
4 c1a = open('2013/1a.ciphertext').read()
5 c1b = open('2013/1b.ciphertext').read()
6 c2a = open('2013/2a.ciphertext').read()
7 c2b = open('2013/2b.ciphertext').read()
8 c3a = open('2013/3a.ciphertext').read()
9 c3b = open('2013/3b.ciphertext').read()
10 c4a = open('2013/4a.ciphertext').read()
11 c4b = open('2013/4b.ciphertext').read()
12 c5a = open('2013/5a.ciphertext').read()
13 c5b = open('2013/5b.ciphertext').read()
14 c6a = open('2013/6a.ciphertext').read()
15 c6b = open('2013/6b.ciphertext').read()
16 c7a = open('2013/6a.ciphertext').read()
17 c7b = open('2013/6b.ciphertext').read()
18
19 p1a = caesar_decipher(c1a, 8)
20 p1b = caesar_decipher(c1b, 14)
21 p2a = affine_decipher(c2a, 3, 3, True)
22 p2b = caesar_decipher(c2b, 6)
23 p3a = affine_decipher(c3a, 7, 8, True)
24 p3b = keyword_decipher(c3b, 'louvigny', 2)
25 p4a = keyword_decipher(c4a, 'montal', 2)
26 p4b = keyword_decipher(c4b, 'salvation', 2)
27 p5a = keyword_decipher(c5a, 'alfredo', 2)
28 p5b = vigenere_decipher(sanitise(c5b), 'florence')
29 p6a = keyword_decipher(c6a, 'parishighcommand', 2)
30 p7a = vigenere_decipher(sanitise(c7a), 'hp')
31