1.Write a program named vigenerecipher.py that takes a file

1.Write a program named vigenerecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenère 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 message-cipher.txt. The Vigenère cipher is a polyalphabetic substitution cipher. It is a 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 unshifted alphabet (first line) will map the following letters (second line): ABCDEFGHIJKLMNOPQRSTUVWXYZIJKLMNOPQRSTUVWXYZABCDEFGHThe Vigenère 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 eagle has landedlim elime lim elimelThe first letter ‘T’ is ciphered using the alphabet that matches ‘l’, which is a shift of 12 letters; ‘l’ is the twelfth letter of the alphabet. The next letter ‘h’ matches ‘i’ which is a shift of 9 letters, etc. The above text would be ciphered to: Epq iloxi sie plvpio2.Write a program named vigeneredecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenère 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.

1.Write a program named vigenerecipher.py that takes a file

1.Write a program named vigenerecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenère 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 message-cipher.txt. The Vigenère cipher is a polyalphabetic substitution cipher. It is a 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 unshifted alphabet (first line) will map the following letters (second line): ABCDEFGHIJKLMNOPQRSTUVWXYZIJKLMNOPQRSTUVWXYZABCDEFGHThe Vigenère 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 eagle has landedlim elime lim elimelThe first letter ‘T’ is ciphered using the alphabet that matches ‘l’, which is a shift of 12 letters; ‘l’ is the twelfth letter of the alphabet. The next letter ‘h’ matches ‘i’ which is a shift of 9 letters, etc. The above text would be ciphered to: Epq iloxi sie plvpio2.Write a program named vigeneredecipher.py that takes a file name and a code word/phrase as arguments. Open the file and use the Vigenère 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.