Python Forum
Playfair cipher encoder and decoder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playfair cipher encoder and decoder
#1
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 Huh Cry
Reply
#2
Please, don't remove content from posts. If you found solution of your problem, just acknowledge that in new post and eventually share the solution for benefit of others who may face the same problem.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cipher Caesar Azilkhan 1 2,148 Nov-21-2019, 03:40 PM
Last Post: ichabod801
  Monoalphabetic cipher pawlo392 1 12,804 Apr-01-2019, 08:51 PM
Last Post: ichabod801
  Caesar cipher Drone4four 19 10,775 Nov-11-2018, 04:07 AM
Last Post: nilamo
  Homework: Ceaser Cipher encoder and decoder Siylo 10 5,311 Oct-27-2018, 11:11 PM
Last Post: Siylo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020