subject

In cryptography, we use encryption ciphers to encode ("encrypt") a plaintext into a ciphertext. in theory the ciphertext is only readable by someone who knows how the plaintext was encrypted. if they have this information they can "decrypt" and recover the plaintext. there are some very simple ciphers, known as "substitution ciphers". they're so simple that they're not used any more because they are easy to but they are great for us because they are easy to program! first is the "rot13" cipher. rot13 rotates each letter 13 positions in the alphabet. so an a becomes an n, and an o becomes a b. (the rotation wraps). if the rot13 cipher is applied a second time, the original plantext is restored: n becomes a, b becomes o. obviously the rot13 cipher provides no security! it's really used in various places on the internet to hide joke punch-lines or spoilers. another cipher, the "caesar cipher", is a substitution cipher with a little more security. the cipher uses a dictionary where each plaintext letter has a corresponding ciphertext letter paired with it. for example we might say a is substituted with m, bis substituted with x, etc. to encrypt, each letter is replaced with its ciphertext letter. to decrypt, the reverse process takes place: each ciphertext letter is replaced with the plaintext letter. this cipher is not particularly strong. it is quite easy to guess the plaintext-ciphertext mappings by exploiting knowledge of letter frequency and word length. it is, however, harder to break than rot13 for this assignment, we will write a c++ program capable of doing 4 things: 1. perform a rot13 substitution 2. perform a caesar encryption given a dictionary 3. perform a caesar decryption given a dictionary 4. create a random caesar cipher dictionary the format for the caesar cipher dictionary is a file with 26 pairs of letters, one per letter of the alphabet, in alphabetical order. each pair has two letters: the plaintext letter and the ciphertext letter. the pairs are separated by whitespace. while the dictionary contains only lowercase letters, the mappings also apply for uppercase letters. note that the ciphertext letters must be unique; you cannot have two different plaintext letters that map to the same ciphertext letter. for all of the substitution operations, all upper and lower case letters on input should be substituted (or rotated as the case may be) before being output. all other characters are simply copied unchanged from input to output. the program takes several command line arguments. the first, which is required, tells the program what operation to perform: perform rot 13 substitution. generate a random caesar cipher dictionary encrypt using the caesar cipher decrypt using the caesar cipher if the first argument is missing, the program should print missing command, then stop. if the first argument is not one of the four listed above, print the first argument followed by a space and not a valid command, then stop. for -r, there is an optional second argument. if provided, it is the name of the file to read from. if it is not provided, the program should read from standard input. the output should be generated to the standard output. if a filename is provided but the file cannot open for any reason, the program should print the filename followed by a space and file could not be opened, then stop for-g, the dictionary should be printed to the standard output. you must ensure that each plaintext letter maps to a unique ciphertext letter. for both -e and -d there is a required second argument, which is the filename of the dictionary. if the second argument is missing, print the message no dictionary given, and stop. if the dictionary cannot open for any reason, the program should print the filename followed by a space and dictionary could not be opened, then stop. when reading the dictionary, you must ensure that each plaintext letter maps to a unique ciphertext letter. if you find a case where the dictionary is not in alphabetical order, you must print missing letter l, where l is the missing letter, and stop. both -e and -d support an optional third argument, which is the file to read from. if it is not provided, the program should read from standard input. the output should be generated to the standard output. if a filename is provided but the file cannot open for any reason, the program should print the filename followed by a space and file could not be opened, then stop. in all cases if there are too many command line arguments, your program should print too many arguments, then stop.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Research data that is presented using descriptive language is said to be
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x,y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documentation/point2d.html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
Answers: 1
You know the right answer?
In cryptography, we use encryption ciphers to encode ("encrypt") a plaintext into a ciphertext. in t...
Questions
question
Mathematics, 25.06.2019 18:50
Questions on the website: 13722360