Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to create a Python module called mixed_cipher. You may have had some experience with writing programs that implement simple Caesar ciphers. In

Your task is to create a Python module called mixed_cipher. You may have had some experience with writing programs that implement simple Caesar ciphers. In this assignment, well be implementing a small program which takes in a filename as a command-line argument and then performs simple substitution on the file contents with a mixed alphabet. A mixed alphabet can be created by prompting the user for the keyword, removing repeated letters in the keyword, and then writing the remaining letters of the alphabet in the usual order. For example, if my keyword is computer, then I have the following:

Plaintext: ABCDEFGHIJKLMNOPQRSTUVWXYZ

Ciphertext: COMPUTERABDFGHIJKLNQSVWXYZ

Your program should output the encrypted text to the screen. Heres an example execution. Lets say I have a file called mixed_test.txt which has the following contents:

This is a file. This file has some WORDS in it.

A sample run of mixed cipher.py with this test file would produce the following output. Note that capitalization and punctuation are kept as-is in the encrypted text.

$ python mixed_cipher.py mixed_test.txt

Please enter a keyword for the mixed cipher: Motherboard

Plaintext: abcdefghijklmnopqrstuvwxyz

Ciphertext: motherbadcfgijklnpqsuvwxyz

Sadq dq m rdge. Sadq rdge amq qkie WKPHQ dj ds.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions