Question: Can anyone figure out a java program for this problem here? It should end up looking like the picture provided This problem introduces a hash

Can anyone figure out a java program for this problem here? It should end up looking like the picture provided
This problem introduces a hash function that operates on letters instead of binary data. Given a message consisting of uppercase letters, the hash function produces a hash value consisting of four letters. First, it divides the message into blocks of 16 letters, ignoring spaces, numbers and punctuation. In fact, all characters, other than letters, should be ignored. And all lowercase letters should be converted to uppercase letters. The messages should be a maximum of 80 characters. If the message length is not divisible by 16, it is padded out with the letter A. A four-number running total is maintained that starts out with the value (0, 0, 0, 0); this is input to a function, known as a compression function, for processing the first block. The compression function consists of two rounds. Round 1: Get the next block of text and arrange it as a row-wise 4 * 4 block of text and covert it to numbers (A = 0, B = 1, etc.). Example: For the block SOFTWARE ENGINEERING TERM PROJECT!, we have Then, add each column mod 26 and add the result to the running total, mod 26. In this example, the running total is (5, 5, 6, 22). Round 2: Using the matrix from round 1, rotate the first row left by 1, second row left by 2, third row left by 3, and reverse the order of the fourth row. In our example, we get Now, add each column mod 26 to get (4, 17, 6, 11); and add the result to the running total, mod 26. The new running total is now (9, 22, 12, 7). This running total is now the input into the first round of the compression function for the next block of text. Round 1 for the Second Block of text is as follows: The running total is now: (14, 7, 13, 19). Round 2 for the Second Block of text is as follows: The running total is now: (17, 19, 17, 3). After the final block is processed, convert the final running total to letters. For the running example, if the message is SOFTWARE ENGINEERING TERM PROJECT!, then converting (17, 19, 17, 3) to letters yields the hash value of RTRD.
Enter the message (max of 80 characters) Software Engineering Term Project! The message with only uppercase letters: SOFTWAREENGINEERINGTERMPROJECT The padded message: SOFTWAREENGINEERINGTERMPROJECTAA The length of the padded message: 32 Block 1 18 14 5 19 22 0 17 4 13 6 8 13 4 417 Block 2 8 13 6 19 4 17 12 15 17 14 94 2 19 00 Start Compressing First Block Column Totals: 5 5 6 22 Running Totals: 5 5 6 22 Transformed Matrix for Round 2: 14 5 19 18 17 4 220 8 413 6 17 4 4 13 Column Totals for Round 2: 4 17 6 11 Running Totals: 9 22 12 7 End Compressing First Block Start Compressing Second Block Column Totals: 5 111 12 Running Totals: 14 7 13 19 Transformed Matrix for Round 2: 13 6 19 8 12 15 4 17 4 17 14 9 0 19 2 Column Totals for Round 2: 3 12 4 10 Running Totals: 17 19 17 3 End Compressing Second Block Hash Value: RIRD
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
