Problem

Extend the encryption application of Exercise 25 of Chapter 9 so that the original text...

Extend the encryption application of Exercise 25 of Chapter 9 so that the original text is read from a user-specified text file and the encrypted text is stored to another user-specified text file.

Reference Exercise 25 of Chapter 9

Another encryption technique is called a Vignere cipher. This technique is similar to a Caesar cipher in that a key is applied cyclically to the original message. For this exercise a key is composed of uppercase letters only.

Encryption is done by adding the code values of the key’s characters to the code values of the characters in the original message. Code values for the key characters are assigned as follows: 0 for A, 1 for B, 2 for C, . . . , and 25 for Z. Let’s say the key is COFFEE and the original message is I drink only decaf. Encryption works as follows:

Decryption reverses the process to generate the original message. Write an application that reads in a text and displays the encrypted text. Make sure the ASCII value resulting from encryption or decryption falls between 32 and 126. You can get the code for key characters by (int) keyChar - 65.

Write another application that reads the encrypted text and displays the original text, using the Vignere cipher technique.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12