Write 2 programs in PYTHON using the following steps below. Just to make the pro
ID: 3791834 • Letter: W
Question
Write 2 programs in PYTHON using the following steps below. Just to make the programs as simple as possible please.
Program 1: Vigenere Cipher Write a program named vigenerecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenere cipher to encode the contents of the file according to the cipher. The program should output the cipher text into ‘filename’-cipher.txt where ‘filename’ was the original file name. For example, if the file’s name is message.txt the ciphered text would be saved in the message-cipher.txt The Vigenere cipher is polyalphabetic substitution cipher. It is variation of Caesar’s cipher where the alphabet is shifted by a fixed number of letters. For example, if the alphabet is shifted by eight, then the upshifted alphabet (first line) will map the following letters (second line): ABCDEFGHIJKLMNOPQRSTUVWXYZ
IJKLMNOPQRSTUVWXYZABCDEFGH
The Vigenere cipher uses 26 alphabets that are each progressive shifted from 0 to 26. The code word provides an index into which one of the shifted alphabets will be used to cipher each letter of the clear text message into cipher text. For example, the clear text is “The eagle has landed” and the code word is “lime.” The above text would be ciphered to: Epq iloxi sie plvpio
Program 2: Vigenere De-cipher Write a program named vigeneredecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenere cipher to decode the contents of the file according to the cipher. The program should output the clear text into ‘filename’-clear.txt where ‘filename’ was the original file name. For example, if the input is message-cipher.txt the output of the program is saved in message-cipher-clear.txt
Explanation / Answer
vigenerecipher.py
==========================================================================
vigeneredecipher.py
===========================================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.