diff --git a/code/kasiski.py b/code/kasiski.py new file mode 100644 index 0000000..7eca817 --- /dev/null +++ b/code/kasiski.py @@ -0,0 +1,14 @@ +ciphertext = "PPKAMJELQHPIAHLWYPKDDNBGPMJELQHPIAHZWUYJH" + +blocks = ["", "", ""] +output = "" +for i in range(len(ciphertext)): + if i % 3 == 0: + output += "\\textcolor{red}{" + ciphertext[i] + "}" + elif i % 3 == 1: + output += "\\textcolor{blue}{" + ciphertext[i] + "}" + elif i % 3 == 2: + output += "\\textcolor{darkgreen}{" + ciphertext[i] + "}" + blocks[i%3] += ciphertext[i] +print(output) +print(blocks)