input files: "cwords.txt" , "encrypt_matrix.txt"

The purpose of this short project is to decrypt a file that has been encrypted. The encryption method used is a polyalpabetic substitution method. To find the answer to this problem you must read, understand, and then reverse the procedure that was used to encrypt the file.

Encryption Procedure:

1. An 26 X 26 encryption matrix of capital letters was created.

2. When a file was read character by character a modulus of the location of the character in the file was calculated using the number 26. This provided a row index for the encryption matrix. The position of the character in the alphabet provided the column index.

The character in the encryption matrix at the row and column was used to replace the input character. In reading the input file no substitutions were made for spaces or for punctuation. The case of the letters was preserved.

Instructions:

1. Write code to read the content of the file "encrypt_matrix.txt" into a two dimensional [26][26] array.

2. Write code to read and decrypt the content of the file "cwords.txt". Write your answer to a file called "final_translation.txt".

Hints:

1. The ASCII value for the capital letter 'A' is 65.

2. The funtions isalpha(), isupper(), islower(), toupper(), and tolower() can be used to save a great deal of time.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.