From c3a93f3ce80840db643adf7d3a31c06f746c77be Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Tue, 9 Oct 2018 12:15:07 +0100 Subject: [PATCH] Added script to solve --- 2018/2018-challenge1.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 2018/2018-challenge1.py diff --git a/2018/2018-challenge1.py b/2018/2018-challenge1.py new file mode 100644 index 0000000..dd099a3 --- /dev/null +++ b/2018/2018-challenge1.py @@ -0,0 +1,16 @@ +import os,sys,inspect +currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0,parentdir) + +from cipher.caesar import * +from support.text_prettify import * + +c1a = open('1a.ciphertext').read() +c1b = open('1b.ciphertext').read() + +key_a, score_a = caesar_break(c1a) +open('1a.plaintext', 'w').write(caesar_decipher(c1a, key_a)) + +key_b, score_b = caesar_break(c1b) +open('1b.plaintext', 'w').write(caesar_decipher(c1b, key_b)) -- 2.34.1