code for generating tex output for kasiski
This commit is contained in:
parent
a93eb46871
commit
3b1b03c338
14
code/kasiski.py
Normal file
14
code/kasiski.py
Normal file
|
@ -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)
|
Loading…
Reference in New Issue
Block a user