Write a program to read the encrypted file, to decrypt one line at a time, and write each decrypted line into another file

computer science

Description

For this lab, you are given a file that is already encrypted using the substitution cipher and a file containing the key used to encrypt the content. Write a program to read the encrypted file, to decrypt one line at a time, and write each decrypted line into another file.  Allow the user to specify the input filename and output filename.  Use exception handling to check for file existence on the input file and to determine if the output file exists so you can ask the user if the output file should be overwritten or not.  Prompt for another output filename if the user does not want the file overwritten or if the output filename is the same as the input filename.

The encrypted file contains capital letters and punctuation characters. To simplify the decryption process, only decrypt letters and leave punctuation and other characters alone.  Leave uppercase letters as uppercase and lowercase letters as lowercase; for example, ‘a’=’t’ and ‘A’=’ T’.  Also, “(“is encrypted or decrypted as “(“, and  “.” as “.”)


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.