subject

Create a program that applies a simple "substitution cipher" to the contents of a text file and writes the encrypted text back to the file. A substitution cipher is given a key word and uses the unique characters from that word to generate a cipher alphabet. Suppose "feather" is used as the key. The following cipher alphabet will be generated: FEATHRZY X W V US OPON MLKJIGD CB A B C D E F G H I J K L M N O P Q R S T U V W X Y Z FEATHRZY X W V USO PONMLKJIGDCB Using this cipher alphabet, read in a text file and replace each character with the corresponding cipher alphabet character (e. g., A -> F) when encoding and vice versa when decoding. In addition to being able to encode or decode, your application should utilize command line input parameters, with the following format: passing -e/-d to your program will cause the file to either encrypt or decrypt using the specified key. passing -k followed by a word will specify the key (e. g., -k feather) (you can use any word for the key you want). the last two strings will denote the input file and output file, respectively. Example: ./test -e -k feather input. txt output. txt
Assuming your compiled program was called "test", this line will read in input. txt, encrypt the text using the cipher alphabet generated by feather to the contents and write them to output. txt. Note: you will only apply the encryption alphabet to characters and leave spaces and punctuation alone. Hints: Use the file stream objects for reading and writing to your files. Use the getline() member function of the file streamer to get entire lines of strings from the input source. Don't forget to use the library for helpful functions for analyzing command line parameters. Also, when developing your cipher encryption, save dealing with capital letters for last. It's an easy conversion that can be applied during the encryption/decryption process.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
question
Computers and Technology, 24.06.2019 02:30
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
question
Computers and Technology, 24.06.2019 14:00
In the microsoft® access® and microsoft excel® programs, the ribbon contains tabs that are divided into with like tools in them. parts groups containers bunches
Answers: 1
You know the right answer?
Create a program that applies a simple "substitution cipher" to the contents of a text file and writ...
Questions
question
Chemistry, 24.02.2021 19:40
question
English, 24.02.2021 19:40
question
Mathematics, 24.02.2021 19:40
question
Mathematics, 24.02.2021 19:40
question
English, 24.02.2021 19:40
question
Mathematics, 24.02.2021 19:40
Questions on the website: 13722367