Oct-22-2017, 08:54 PM
Hi, I have to make a program that is like the playfair cipher which encodes a specific text and a second program that decodes the text. The instructions state: For the encoding program, the file will contain the
plaintext (original un-encoded text) and a new file will be created
containing the encoded text.
The decoding program will again ask for a keyword and the name of a file
containing encoded text. It should produce a file containing the
un-encoded plaintext.
I currently have this:
import itertools
f = open("Encode.txt", "w+")
key = input("Enter Key: ").replace("j", "i")
alphabet = 'abcdefghiklmnopqrstuvwxyz'
slots =
for x in itertools.chain(key, alphabet):
if not x in slots: slots.append(x)
matrix = [slots[i:i + 5] for i in range(0, 25, 5)]
f.write(str(matrix))
print(str(matrix))
f.close()
and I'm not even sure if that is right, in serious need of help
plaintext (original un-encoded text) and a new file will be created
containing the encoded text.
The decoding program will again ask for a keyword and the name of a file
containing encoded text. It should produce a file containing the
un-encoded plaintext.
I currently have this:
import itertools
f = open("Encode.txt", "w+")
key = input("Enter Key: ").replace("j", "i")
alphabet = 'abcdefghiklmnopqrstuvwxyz'
slots =
for x in itertools.chain(key, alphabet):
if not x in slots: slots.append(x)
matrix = [slots[i:i + 5] for i in range(0, 25, 5)]
f.write(str(matrix))
print(str(matrix))
f.close()
and I'm not even sure if that is right, in serious need of help

