Question: This project is designed to take a user - provided message, a keyword used in the process, and then encrypts the message as per the

This project is designed to take a user-provided message, a keyword used in the process, and then encrypts the message as per the users request.
Description:
Encode messages using the following scheme:
{'A','B','C','D','E'},
{'F','G','H','I','J'},
{'K','L','M','N','O'},
{'P','Q','R','S','T'},
{'U','V','W','X','Y'}
To encode a letter, use the row number followed by the column number. For instance, G becomes 11 and T becomes 34.
Step 1:
Create the matrix shown above before encryption. To encrypt a message, convert each letter to its corresponding two-digit string, as shown below. Assume the users input message is GATES HILLMAN CENTER. The encrypted string is 110034043312132121220023020423340432.
G A T E S H I L L M A N C E N T E R
110034043312132121220023020423340432
Step 2: Using a keyword without repeated letters, create a grid of the digits using the numerical sequence of your converted message. Ensure the number of columns matches the length of the keyword. For instance, if the keyword is CORTINA, the grid would be:
C O R T I N A
1100340
4331213
2121220
0230204
2334043
2
Step 3: Rearrange the grid by alphabetizing the letters of the keyword and shifting the corresponding digit columns. In our example, the results in:
A C I N O R T
0134100
3421331
0222121
4020230
3204334
2
Step 4: Finally, the message would be written as a sequence of digits, column by column (ignoring the letters at the top of each column):
030431420223222041204131230323301104
This is the final encoded message transmitted. To decode, the decrypter works in reverse using the secret keyword. Without it, cracking the code is challenging but not impossible.
What to do:
Message Input: Enter a message without numbers or symbols at program launch; they will be removed in processing.
Keyword input: Enter a keyword for encryption; it should not contain numbers, symbols, or duplicate characters. The program will convert it to uppercase, and if duplicates are found, it will prompt a new message.
Encryption/Output: After reading the message and keyword, the program will output:
The original message in uppercase with spaces, excluding digits or punctuation.
The numerical sequence for the message.
The grid of numbers for the original keyword.
The sorted grid of numbers for the keyword.
The encrypted message as a sequence of digit "words".
The program will process the input data into an encrypted form, and each step of the process will be output to the user in order:
Message to Be Encrypted
Sequence from Letter Matrix
The Keyword
The Keyword Matrix
The Alphabetical Keyword
The Re-ordered Matrix
The Fully Encrypted Message
(7 pts) Processing user input:
o Message: No numbers or symbols allowed; they will be removed during processing.
o keyword: No numbers, symbols, or duplicate characters; program prompts for a new keyword if duplicates are found.
(7 pts) generateMessageMatrix(): convert each letter to its corresponding two-digits.
(7 pts) generateKeyMatrix(): create a grid of digits using the numerical sequence of the converted message, with the number of columns equal to the keyword length.
(10 pts) rearrangeMatrixOrder(): rearrange the grid so that keyword letters are in alphabetical order, shifting corresponding columns of digits along with the letters.
(5 pts) printEncryptedMessage: write the message as a sequence of digits, column by column.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!