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.