subject

For this assignment you will be implementing simple rotation encryption to be used on a text file. Your program will need to read in text from a text file and encrypt or decrypt it (have the user select which) using the encryption key entered by the user, then write the results out to another file. The user will enter the names of the source and destination files, the encryption key, and will select whether they are encrypting or decrypting the file.
Rotation Encryption:
Rotation encryption involves shifting each letter in the encrypted passage forward by the amount of the encryption key. For example, if the string to encrypt is "Apple" and the encryption key is 2, the encrypted result is "Crrng". Decryption reverses the process by shifting each letter backward by the amount of the encryption key, so "Crrng" decrypts back to "Apple". Note that if someone were to have a copy of an encrypted file and your program, they could recover the original contents only if they also knew the encryption key (while this encryption could easily be "brute-forced," i. e. all possible encryption keys could be tried, real world encryption methods have many more possible encryption keys and decryption is a longer process, making this impractical).
Some notes for our implementation:
We will only be encrypting alphabetical characters, i. e. AZ and a-z. Any nonalphabetical characters should be skipped over and kept as-is by the encryption and decryption functions.
We will maintain case when encrypted, i. e. lowercase letters will remain lowercase and uppercase letters will remain uppercase.
If a character would encrypt or decrypt past the ends of AZ or a-z (i. e. beyond Z/z when encrypting or before A/a when decrypting) we will wrap it around to the other end (i. e. with encryption key 3, Y encrypts to B and decrypts back to Y, and y encrypts to b and decrypts back to y).
Your program should be split into functions. At a minimum, the following four functions must be implemented, though you may use others if desired:
A function that reads from a file (takes a single string parameter for the filename and returns a string).
A function that writes to a file (takes 2 string parameters, one for the filename and one for the contents to be written, return type of void).
A function that performs encryption (takes a string parameter for the string to be encrypted and an int parameter for the encryption key, returns the encrypted result as a string).
A function that performs decryption (takes a string parameter for the string to be encrypted and an int parameter for the encryption key, returns the decrypted result as a string).
Hint: Encryption and decryption are very similar – you might want to have your encryption function call your decryption function or vice versa, or write a third function that encryption and decryption both call in order to avoid repetition.
Note: Main should handle all user input. The encrypted or decrypted result is written to a file. Acceptable encryption keys are in the range 1-25 inclusive, you must validate the user’s entered encryption key and if it is out of range require that they re-enter it.
Submit the following to Cougar Courses:
Your code (all .cpp or .C file(s), and any .h files if applicable)
Screenshot(s) of your program having been compiled and then running on empress, including the compilation line (g++ …)
Contents of a sample file, before encryption, after encryption, and after decryption. (note: before and after should match if your program works properly). Save these as 3 text files, "original. txt", "encrypted. txt" and "decrypted. txt".

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
One subtask in the game is to roll the dice. explain why is roll the dice an abstraction.
Answers: 3
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
You know the right answer?
For this assignment you will be implementing simple rotation encryption to be used on a text file. Y...
Questions
Questions on the website: 13722361